@nocoo/basalt 2.1.2 → 2.1.8

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 (81) hide show
  1. package/ai/INTEGRATION.md +19 -1
  2. package/ai/USAGE.md +1 -1
  3. package/ai/registry.json +81 -81
  4. package/dist/charts/charts.d.ts +1 -1
  5. package/dist/charts/charts.js +3 -16
  6. package/dist/charts/charts.js.map +1 -1
  7. package/dist/charts/custom-chart.d.ts +1 -1
  8. package/dist/charts/custom-chart.js +3 -16
  9. package/dist/charts/custom-chart.js.map +1 -1
  10. package/dist/charts/grouped-bar.d.ts +1 -1
  11. package/dist/charts/grouped-bar.js +11 -48
  12. package/dist/charts/grouped-bar.js.map +1 -1
  13. package/dist/charts/heatmap-calendar.js +80 -136
  14. package/dist/charts/heatmap-calendar.js.map +1 -1
  15. package/dist/charts/slot-bar.js +2 -12
  16. package/dist/charts/slot-bar.js.map +1 -1
  17. package/dist/charts/stat-card.js +2 -7
  18. package/dist/charts/stat-card.js.map +1 -1
  19. package/dist/charts/timeseries.d.ts +1 -1
  20. package/dist/charts/timeseries.js +3 -16
  21. package/dist/charts/timeseries.js.map +1 -1
  22. package/dist/charts/tooltip.js +13 -51
  23. package/dist/charts/tooltip.js.map +1 -1
  24. package/dist/components/autocomplete.d.ts +1 -1
  25. package/dist/components/autocomplete.js +3 -16
  26. package/dist/components/autocomplete.js.map +1 -1
  27. package/dist/components/banner.js +28 -28
  28. package/dist/components/banner.js.map +1 -1
  29. package/dist/components/button.js +8 -9
  30. package/dist/components/button.js.map +1 -1
  31. package/dist/components/chat-composer.js +1 -2
  32. package/dist/components/chat-composer.js.map +1 -1
  33. package/dist/components/checkbox.js +50 -82
  34. package/dist/components/checkbox.js.map +1 -1
  35. package/dist/components/code.js +1 -1
  36. package/dist/components/code.js.map +1 -1
  37. package/dist/components/combobox.d.ts +1 -1
  38. package/dist/components/combobox.js +3 -16
  39. package/dist/components/combobox.js.map +1 -1
  40. package/dist/components/confirm-dialog.js +1 -1
  41. package/dist/components/confirm-dialog.js.map +1 -1
  42. package/dist/components/context-menu.d.ts +1 -67
  43. package/dist/components/context-menu.js.map +1 -1
  44. package/dist/components/data-table.js +112 -124
  45. package/dist/components/data-table.js.map +1 -1
  46. package/dist/components/date-picker.js +236 -245
  47. package/dist/components/date-picker.js.map +1 -1
  48. package/dist/components/delete-resource.js +1 -1
  49. package/dist/components/delete-resource.js.map +1 -1
  50. package/dist/components/dock.js +15 -16
  51. package/dist/components/dock.js.map +1 -1
  52. package/dist/components/field.js +20 -23
  53. package/dist/components/field.js.map +1 -1
  54. package/dist/components/layer-card.d.ts +1 -1
  55. package/dist/components/layer-card.js +44 -51
  56. package/dist/components/layer-card.js.map +1 -1
  57. package/dist/components/skeleton-line.d.ts +2 -2
  58. package/dist/components/skeleton-line.js +1 -1
  59. package/dist/components/skeleton-line.js.map +1 -1
  60. package/dist/components/switch.js +46 -78
  61. package/dist/components/switch.js.map +1 -1
  62. package/dist/components/toggle-group.js +2 -2
  63. package/dist/components/toggle-group.js.map +1 -1
  64. package/dist/components/toggle.js +1 -1
  65. package/dist/components/toggle.js.map +1 -1
  66. package/dist/components/tooltip.js +14 -13
  67. package/dist/components/tooltip.js.map +1 -1
  68. package/dist/providers/accent.js +89 -198
  69. package/dist/providers/accent.js.map +1 -1
  70. package/dist/providers/theme.js +46 -144
  71. package/dist/providers/theme.js.map +1 -1
  72. package/dist/styles/standalone.css +37 -13
  73. package/dist/utils/preference-store.d.ts +16 -0
  74. package/dist/utils/preference-store.js +106 -0
  75. package/dist/utils/preference-store.js.map +1 -0
  76. package/dist/utils/selection-indicator.js +1 -1
  77. package/dist/utils/selection-indicator.js.map +1 -1
  78. package/dist/utils/use-checkable-group.d.ts +19 -0
  79. package/dist/utils/use-checkable-group.js +61 -0
  80. package/dist/utils/use-checkable-group.js.map +1 -0
  81. package/package.json +2 -3
@@ -1 +1 @@
1
- {"version":3,"file":"charts.js","names":[],"sources":["../../src/charts/charts.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n\tLineChart,\n\ttype LineChartAxisDomain,\n\ttype LineChartLegendRenderer,\n\ttype LineChartNumericKeys,\n\ttype LineChartTooltipRenderer,\n} from \"./line\";\nimport type { ChartSeriesDescriptor, XYPoint } from \"./series\";\n\nexport type ChartsProps<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n> = {\n\t/**\n\t * Dataset array where each record requires an `x` category or time coordinate.\n\t * Any remaining fields with numeric, nullable, or optional number values are inferred as valid series keys.\n\t */\n\tdata: TData[];\n\t/**\n\t * Series descriptors identifying which numeric keys to plot.\n\t * Inferred strictly from numeric keys of `TData` (rejects non-numeric fields, `x`, and typos).\n\t */\n\tseries?: Array<ChartSeriesDescriptor<NoInfer<K>>>;\n\tariaLabel?: string;\n\tclassName?: string;\n\tshowAxes?: boolean;\n\tshowLegend?: boolean;\n\tcolor?: string;\n\t/**\n\t * Value formatter for Y-axis tick values and fallback tooltip values.\n\t */\n\tvalueFormatter?: (value: number) => string;\n\t/**\n\t * Formatter for X-axis category or time tick labels.\n\t */\n\txValueFormatter?: (value: string | number) => string;\n\t/**\n\t * Custom numerical or keyword bounds for the Y-axis.\n\t */\n\tyDomain?: LineChartAxisDomain;\n\t/**\n\t * Custom legend slot or render function receiving resolved series descriptors.\n\t */\n\tlegend?: ReactNode | LineChartLegendRenderer<K>;\n\t/**\n\t * Custom tooltip content renderer receiving Recharts payload, active status, and coordinate label.\n\t */\n\tcustomTooltip?: LineChartTooltipRenderer;\n\t/**\n\t * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.\n\t * Associated with the chart via useId and aria-describedby.\n\t */\n\tsummary?: ReactNode;\n\t/**\n\t * Accessible tabular or structured data alternative rendered outside the plot area.\n\t */\n\tdataAlternative?: ReactNode;\n\t/**\n\t * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.\n\t * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.\n\t * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.\n\t * @default true\n\t */\n\taccessibilityLayer?: boolean;\n};\n\nexport function Charts<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n>({\n\tdata,\n\tseries,\n\tariaLabel = \"Charts\",\n\tclassName,\n\tshowAxes = false,\n\tshowLegend = false,\n\tcolor,\n\tvalueFormatter,\n\txValueFormatter,\n\tyDomain,\n\tlegend,\n\tcustomTooltip,\n\tsummary,\n\tdataAlternative,\n\taccessibilityLayer,\n}: ChartsProps<TData, K>) {\n\treturn (\n\t\t<LineChart\n\t\t\tdata={data}\n\t\t\tseries={series}\n\t\t\tariaLabel={ariaLabel}\n\t\t\tclassName={className}\n\t\t\tshowAxes={showAxes}\n\t\t\tshowLegend={showLegend}\n\t\t\tcolor={color}\n\t\t\tvalueFormatter={valueFormatter}\n\t\t\txValueFormatter={xValueFormatter}\n\t\t\tyDomain={yDomain}\n\t\t\tlegend={legend}\n\t\t\tcustomTooltip={customTooltip}\n\t\t\tsummary={summary}\n\t\t\tdataAlternative={dataAlternative}\n\t\t\taccessibilityLayer={accessibilityLayer}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;AAmEA,SAAgB,EAGd,EACD,SACA,WACA,eAAY,UACZ,cACA,cAAW,IACX,gBAAa,IACb,UACA,mBACA,oBACA,YACA,WACA,kBACA,YACA,oBACA,yBACyB;CACzB,OACC,kBAAC,GAAD;EACO;EACE;EACG;EACA;EACD;EACE;EACL;EACS;EACC;EACR;EACD;EACO;EACN;EACQ;EACG;CACpB,CAAA;AAEH"}
1
+ {"version":3,"file":"charts.js","names":[],"sources":["../../src/charts/charts.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n\tLineChart,\n\ttype LineChartAxisDomain,\n\ttype LineChartLegendRenderer,\n\ttype LineChartNumericKeys,\n\ttype LineChartTooltipRenderer,\n} from \"./line\";\nimport type { ChartSeriesDescriptor, XYPoint } from \"./series\";\n\nexport type ChartsProps<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n> = {\n\t/**\n\t * Dataset array where each record requires an `x` category or time coordinate.\n\t * Any remaining fields with numeric, nullable, or optional number values are inferred as valid series keys.\n\t */\n\tdata: TData[];\n\t/**\n\t * Series descriptors identifying which numeric keys to plot.\n\t * Inferred strictly from numeric keys of `TData` (rejects non-numeric fields, `x`, and typos).\n\t */\n\tseries?: Array<ChartSeriesDescriptor<NoInfer<K>>>;\n\tariaLabel?: string;\n\tclassName?: string;\n\tshowAxes?: boolean;\n\tshowLegend?: boolean;\n\tcolor?: string;\n\t/**\n\t * Value formatter for Y-axis tick values and fallback tooltip values.\n\t */\n\tvalueFormatter?: (value: number) => string;\n\t/**\n\t * Formatter for X-axis category or time tick labels.\n\t */\n\txValueFormatter?: (value: string | number) => string;\n\t/**\n\t * Custom numerical or keyword bounds for the Y-axis.\n\t */\n\tyDomain?: LineChartAxisDomain;\n\t/**\n\t * Custom legend slot or render function receiving resolved series descriptors.\n\t */\n\tlegend?: ReactNode | LineChartLegendRenderer<K>;\n\t/**\n\t * Custom tooltip content renderer receiving Recharts payload, active status, and coordinate label.\n\t */\n\tcustomTooltip?: LineChartTooltipRenderer;\n\t/**\n\t * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.\n\t * Associated with the chart via useId and aria-describedby.\n\t */\n\tsummary?: ReactNode;\n\t/**\n\t * Accessible tabular or structured data alternative rendered outside the plot area.\n\t */\n\tdataAlternative?: ReactNode;\n\t/**\n\t * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.\n\t * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.\n\t * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.\n\t * @default true\n\t */\n\taccessibilityLayer?: boolean;\n};\n\nexport function Charts<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n>({ ariaLabel = \"Charts\", ...props }: ChartsProps<TData, K>) {\n\treturn <LineChart<TData, K> ariaLabel={ariaLabel} {...props} />;\n}\n"],"mappings":";;;;AAmEA,SAAgB,EAGd,EAAE,eAAY,UAAU,GAAG,KAAgC;CAC5D,OAAO,kBAAC,GAAD;EAAgC;EAAW,GAAI;CAAQ,CAAA;AAC/D"}
@@ -58,4 +58,4 @@ export type CustomChartProps<TData extends {
58
58
  };
59
59
  export declare function CustomChart<TData extends {
60
60
  x: string | number;
61
- } = XYPoint, K extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string>({ data, series, ariaLabel, className, showAxes, showLegend, color, valueFormatter, xValueFormatter, yDomain, legend, customTooltip, summary, dataAlternative, accessibilityLayer, }: CustomChartProps<TData, K>): import("react").JSX.Element;
61
+ } = XYPoint, K extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string>({ ariaLabel, ...props }: CustomChartProps<TData, K>): import("react").JSX.Element;
@@ -2,23 +2,10 @@
2
2
  import { LineChart as e } from "./line.js";
3
3
  import { jsx as t } from "react/jsx-runtime";
4
4
  //#region src/charts/custom-chart.tsx
5
- function n({ data: n, series: r, ariaLabel: i = "Custom chart", className: a, showAxes: o = !1, showLegend: s = !1, color: c, valueFormatter: l, xValueFormatter: u, yDomain: d, legend: f, customTooltip: p, summary: m, dataAlternative: h, accessibilityLayer: g }) {
5
+ function n({ ariaLabel: n = "Custom chart", ...r }) {
6
6
  return /* @__PURE__ */ t(e, {
7
- data: n,
8
- series: r,
9
- ariaLabel: i,
10
- className: a,
11
- showAxes: o,
12
- showLegend: s,
13
- color: c,
14
- valueFormatter: l,
15
- xValueFormatter: u,
16
- yDomain: d,
17
- legend: f,
18
- customTooltip: p,
19
- summary: m,
20
- dataAlternative: h,
21
- accessibilityLayer: g
7
+ ariaLabel: n,
8
+ ...r
22
9
  });
23
10
  }
24
11
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"custom-chart.js","names":[],"sources":["../../src/charts/custom-chart.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n\tLineChart,\n\ttype LineChartAxisDomain,\n\ttype LineChartLegendRenderer,\n\ttype LineChartNumericKeys,\n\ttype LineChartTooltipRenderer,\n} from \"./line\";\nimport type { ChartSeriesDescriptor, XYPoint } from \"./series\";\n\nexport type CustomChartProps<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n> = {\n\t/**\n\t * Dataset array where each record requires an `x` category or time coordinate.\n\t * Any remaining fields with numeric, nullable, or optional number values are inferred as valid series keys.\n\t */\n\tdata: TData[];\n\t/**\n\t * Series descriptors identifying which numeric keys to plot.\n\t * Inferred strictly from numeric keys of `TData` (rejects non-numeric fields, `x`, and typos).\n\t */\n\tseries?: Array<ChartSeriesDescriptor<NoInfer<K>>>;\n\tariaLabel?: string;\n\tclassName?: string;\n\tshowAxes?: boolean;\n\tshowLegend?: boolean;\n\tcolor?: string;\n\t/**\n\t * Value formatter for Y-axis tick values and fallback tooltip values.\n\t */\n\tvalueFormatter?: (value: number) => string;\n\t/**\n\t * Formatter for X-axis category or time tick labels.\n\t */\n\txValueFormatter?: (value: string | number) => string;\n\t/**\n\t * Custom numerical or keyword bounds for the Y-axis.\n\t */\n\tyDomain?: LineChartAxisDomain;\n\t/**\n\t * Custom legend slot or render function receiving resolved series descriptors.\n\t */\n\tlegend?: ReactNode | LineChartLegendRenderer<K>;\n\t/**\n\t * Custom tooltip content renderer receiving Recharts payload, active status, and coordinate label.\n\t */\n\tcustomTooltip?: LineChartTooltipRenderer;\n\t/**\n\t * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.\n\t * Associated with the chart via useId and aria-describedby.\n\t */\n\tsummary?: ReactNode;\n\t/**\n\t * Accessible tabular or structured data alternative rendered outside the plot area.\n\t */\n\tdataAlternative?: ReactNode;\n\t/**\n\t * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.\n\t * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.\n\t * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.\n\t * @default true\n\t */\n\taccessibilityLayer?: boolean;\n};\n\nexport function CustomChart<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n>({\n\tdata,\n\tseries,\n\tariaLabel = \"Custom chart\",\n\tclassName,\n\tshowAxes = false,\n\tshowLegend = false,\n\tcolor,\n\tvalueFormatter,\n\txValueFormatter,\n\tyDomain,\n\tlegend,\n\tcustomTooltip,\n\tsummary,\n\tdataAlternative,\n\taccessibilityLayer,\n}: CustomChartProps<TData, K>) {\n\treturn (\n\t\t<LineChart\n\t\t\tdata={data}\n\t\t\tseries={series}\n\t\t\tariaLabel={ariaLabel}\n\t\t\tclassName={className}\n\t\t\tshowAxes={showAxes}\n\t\t\tshowLegend={showLegend}\n\t\t\tcolor={color}\n\t\t\tvalueFormatter={valueFormatter}\n\t\t\txValueFormatter={xValueFormatter}\n\t\t\tyDomain={yDomain}\n\t\t\tlegend={legend}\n\t\t\tcustomTooltip={customTooltip}\n\t\t\tsummary={summary}\n\t\t\tdataAlternative={dataAlternative}\n\t\t\taccessibilityLayer={accessibilityLayer}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;AAmEA,SAAgB,EAGd,EACD,SACA,WACA,eAAY,gBACZ,cACA,cAAW,IACX,gBAAa,IACb,UACA,mBACA,oBACA,YACA,WACA,kBACA,YACA,oBACA,yBAC8B;CAC9B,OACC,kBAAC,GAAD;EACO;EACE;EACG;EACA;EACD;EACE;EACL;EACS;EACC;EACR;EACD;EACO;EACN;EACQ;EACG;CACpB,CAAA;AAEH"}
1
+ {"version":3,"file":"custom-chart.js","names":[],"sources":["../../src/charts/custom-chart.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport {\n\tLineChart,\n\ttype LineChartAxisDomain,\n\ttype LineChartLegendRenderer,\n\ttype LineChartNumericKeys,\n\ttype LineChartTooltipRenderer,\n} from \"./line\";\nimport type { ChartSeriesDescriptor, XYPoint } from \"./series\";\n\nexport type CustomChartProps<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n> = {\n\t/**\n\t * Dataset array where each record requires an `x` category or time coordinate.\n\t * Any remaining fields with numeric, nullable, or optional number values are inferred as valid series keys.\n\t */\n\tdata: TData[];\n\t/**\n\t * Series descriptors identifying which numeric keys to plot.\n\t * Inferred strictly from numeric keys of `TData` (rejects non-numeric fields, `x`, and typos).\n\t */\n\tseries?: Array<ChartSeriesDescriptor<NoInfer<K>>>;\n\tariaLabel?: string;\n\tclassName?: string;\n\tshowAxes?: boolean;\n\tshowLegend?: boolean;\n\tcolor?: string;\n\t/**\n\t * Value formatter for Y-axis tick values and fallback tooltip values.\n\t */\n\tvalueFormatter?: (value: number) => string;\n\t/**\n\t * Formatter for X-axis category or time tick labels.\n\t */\n\txValueFormatter?: (value: string | number) => string;\n\t/**\n\t * Custom numerical or keyword bounds for the Y-axis.\n\t */\n\tyDomain?: LineChartAxisDomain;\n\t/**\n\t * Custom legend slot or render function receiving resolved series descriptors.\n\t */\n\tlegend?: ReactNode | LineChartLegendRenderer<K>;\n\t/**\n\t * Custom tooltip content renderer receiving Recharts payload, active status, and coordinate label.\n\t */\n\tcustomTooltip?: LineChartTooltipRenderer;\n\t/**\n\t * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.\n\t * Associated with the chart via useId and aria-describedby.\n\t */\n\tsummary?: ReactNode;\n\t/**\n\t * Accessible tabular or structured data alternative rendered outside the plot area.\n\t */\n\tdataAlternative?: ReactNode;\n\t/**\n\t * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.\n\t * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.\n\t * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.\n\t * @default true\n\t */\n\taccessibilityLayer?: boolean;\n};\n\nexport function CustomChart<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n>({ ariaLabel = \"Custom chart\", ...props }: CustomChartProps<TData, K>) {\n\treturn <LineChart<TData, K> ariaLabel={ariaLabel} {...props} />;\n}\n"],"mappings":";;;;AAmEA,SAAgB,EAGd,EAAE,eAAY,gBAAgB,GAAG,KAAqC;CACvE,OAAO,kBAAC,GAAD;EAAgC;EAAW,GAAI;CAAQ,CAAA;AAC/D"}
@@ -57,4 +57,4 @@ export type GroupedBarChartProps<TData extends {
57
57
  };
58
58
  export declare function GroupedBarChart<TData extends {
59
59
  x: string | number;
60
- } = XYPoint, K extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string>({ data, series, ariaLabel, className, showAxes, showLegend, valueFormatter, xValueFormatter, yDomain, legend, customTooltip, summary, dataAlternative, accessibilityLayer, }: GroupedBarChartProps<TData, K>): import("react").JSX.Element;
60
+ } = XYPoint, K extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string>({ series, ariaLabel, ...props }: GroupedBarChartProps<TData, K>): import("react").JSX.Element;
@@ -1,55 +1,18 @@
1
1
  "use client";
2
- import { ANIMATION_PROPS as e, BAR_RADIUS as t, CHART_PLOT_MARGIN as n, CHART_PLOT_MARGIN_BARE as r, GRID_PROPS as i, cartesianAxisProps as a, chartTooltipProps as o, seriesColor as s } from "./config.js";
3
- import { resolveChartSeries as c } from "./series.js";
4
- import { ChartShell as l } from "./frame.js";
5
- import { ChartLegend as u } from "./legend.js";
6
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
7
- import { Bar as p, BarChart as m, CartesianGrid as h, Tooltip as g, XAxis as _, YAxis as v } from "recharts";
2
+ import { resolveChartSeries as e } from "./series.js";
3
+ import { BarChart as t } from "./bar.js";
4
+ import { jsx as n } from "react/jsx-runtime";
8
5
  //#region src/charts/grouped-bar.tsx
9
- function y({ data: y, series: b, ariaLabel: x = "Grouped bar chart", className: S, showAxes: C = !1, showLegend: w = !1, valueFormatter: T, xValueFormatter: E, yDomain: D, legend: O, customTooltip: k, summary: A, dataAlternative: j, accessibilityLayer: M }) {
10
- let N = c(b, ["y", "y2"]), P = O === void 0 ? w ? /* @__PURE__ */ d(u, {
11
- items: N,
12
- shape: "bar"
13
- }) : void 0 : typeof O == "function" ? O({ items: N }) : O;
14
- return /* @__PURE__ */ d(l, {
15
- ariaLabel: x,
16
- className: S,
17
- legend: P,
18
- summary: A,
19
- dataAlternative: j,
20
- accessibilityLayer: M,
21
- children: /* @__PURE__ */ f(m, {
22
- data: y,
23
- margin: C ? n : r,
24
- children: [
25
- C ? /* @__PURE__ */ d(h, { ...i }) : null,
26
- /* @__PURE__ */ d(_, {
27
- dataKey: "x",
28
- ...a(!C),
29
- tickFormatter: E
30
- }),
31
- /* @__PURE__ */ d(v, {
32
- ...a(!C),
33
- tickFormatter: T,
34
- ...D ? { domain: D } : {}
35
- }),
36
- /* @__PURE__ */ d(g, { ...o({
37
- formatter: T,
38
- cursor: "bar",
39
- customTooltip: k
40
- }) }),
41
- N.map((n, r) => /* @__PURE__ */ d(p, {
42
- dataKey: n.key,
43
- name: n.label ?? n.key,
44
- fill: s(n, r),
45
- radius: t.vertical,
46
- ...e
47
- }, n.key))
48
- ]
49
- })
6
+ function r({ series: r, ariaLabel: i = "Grouped bar chart", ...a }) {
7
+ let o = e(r, ["y", "y2"]);
8
+ return /* @__PURE__ */ n(t, {
9
+ series: o,
10
+ ariaLabel: i,
11
+ ...a,
12
+ color: void 0
50
13
  });
51
14
  }
52
15
  //#endregion
53
- export { y as GroupedBarChart };
16
+ export { r as GroupedBarChart };
54
17
 
55
18
  //# sourceMappingURL=grouped-bar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"grouped-bar.js","names":[],"sources":["../../src/charts/grouped-bar.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { Bar, CartesianGrid, BarChart as RechartsBar, Tooltip, XAxis, YAxis } from \"recharts\";\nimport {\n\tANIMATION_PROPS,\n\tBAR_RADIUS,\n\tCHART_PLOT_MARGIN,\n\tCHART_PLOT_MARGIN_BARE,\n\tcartesianAxisProps,\n\tchartTooltipProps,\n\tGRID_PROPS,\n\tseriesColor,\n} from \"./config\";\nimport { ChartShell } from \"./frame\";\nimport { ChartLegend } from \"./legend\";\nimport type {\n\tLineChartAxisDomain,\n\tLineChartLegendRenderer,\n\tLineChartNumericKeys,\n\tLineChartTooltipRenderer,\n} from \"./line\";\nimport { type ChartSeriesDescriptor, resolveChartSeries, type XYPoint } from \"./series\";\n\nexport type GroupedBarChartProps<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n> = {\n\t/**\n\t * Dataset array where each record requires an `x` category or time coordinate.\n\t * Any remaining fields with numeric, nullable, or optional number values are inferred as valid series keys.\n\t */\n\tdata: TData[];\n\t/**\n\t * Series descriptors identifying which numeric keys to plot.\n\t * Inferred strictly from numeric keys of `TData` (rejects non-numeric fields, `x`, and typos).\n\t */\n\tseries?: Array<ChartSeriesDescriptor<NoInfer<K>>>;\n\tariaLabel?: string;\n\tclassName?: string;\n\tshowAxes?: boolean;\n\tshowLegend?: boolean;\n\t/**\n\t * Value formatter for Y-axis tick values and fallback tooltip values.\n\t */\n\tvalueFormatter?: (value: number) => string;\n\t/**\n\t * Formatter for X-axis category or time tick labels.\n\t */\n\txValueFormatter?: (value: string | number) => string;\n\t/**\n\t * Custom numerical or keyword bounds for the Y-axis.\n\t */\n\tyDomain?: LineChartAxisDomain;\n\t/**\n\t * Custom legend slot or render function receiving resolved series descriptors.\n\t */\n\tlegend?: ReactNode | LineChartLegendRenderer<K>;\n\t/**\n\t * Custom tooltip content renderer receiving Recharts payload, active status, and coordinate label.\n\t */\n\tcustomTooltip?: LineChartTooltipRenderer;\n\t/**\n\t * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.\n\t * Associated with the chart via useId and aria-describedby.\n\t */\n\tsummary?: ReactNode;\n\t/**\n\t * Accessible tabular or structured data alternative rendered outside the plot area.\n\t */\n\tdataAlternative?: ReactNode;\n\t/**\n\t * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.\n\t * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.\n\t * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.\n\t * @default true\n\t */\n\taccessibilityLayer?: boolean;\n};\n\nexport function GroupedBarChart<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n>({\n\tdata,\n\tseries,\n\tariaLabel = \"Grouped bar chart\",\n\tclassName,\n\tshowAxes = false,\n\tshowLegend = false,\n\tvalueFormatter,\n\txValueFormatter,\n\tyDomain,\n\tlegend,\n\tcustomTooltip,\n\tsummary,\n\tdataAlternative,\n\taccessibilityLayer,\n}: GroupedBarChartProps<TData, K>) {\n\tconst defaultKeys = [\"y\", \"y2\"] as K[];\n\tconst bars = resolveChartSeries(series, defaultKeys);\n\tconst resolvedLegend =\n\t\tlegend !== undefined ? (\n\t\t\ttypeof legend === \"function\" ? (\n\t\t\t\tlegend({ items: bars })\n\t\t\t) : (\n\t\t\t\tlegend\n\t\t\t)\n\t\t) : showLegend ? (\n\t\t\t<ChartLegend items={bars} shape=\"bar\" />\n\t\t) : undefined;\n\n\treturn (\n\t\t<ChartShell\n\t\t\tariaLabel={ariaLabel}\n\t\t\tclassName={className}\n\t\t\tlegend={resolvedLegend}\n\t\t\tsummary={summary}\n\t\t\tdataAlternative={dataAlternative}\n\t\t\taccessibilityLayer={accessibilityLayer}\n\t\t>\n\t\t\t<RechartsBar data={data} margin={showAxes ? CHART_PLOT_MARGIN : CHART_PLOT_MARGIN_BARE}>\n\t\t\t\t{showAxes ? <CartesianGrid {...GRID_PROPS} /> : null}\n\t\t\t\t<XAxis dataKey=\"x\" {...cartesianAxisProps(!showAxes)} tickFormatter={xValueFormatter} />\n\t\t\t\t<YAxis\n\t\t\t\t\t{...cartesianAxisProps(!showAxes)}\n\t\t\t\t\ttickFormatter={valueFormatter}\n\t\t\t\t\t{...(yDomain ? { domain: yDomain as [number, number] } : {})}\n\t\t\t\t/>\n\t\t\t\t<Tooltip\n\t\t\t\t\t{...chartTooltipProps({\n\t\t\t\t\t\tformatter: valueFormatter,\n\t\t\t\t\t\tcursor: \"bar\",\n\t\t\t\t\t\tcustomTooltip,\n\t\t\t\t\t})}\n\t\t\t\t/>\n\t\t\t\t{bars.map((item, index) => (\n\t\t\t\t\t<Bar\n\t\t\t\t\t\tkey={item.key}\n\t\t\t\t\t\tdataKey={item.key}\n\t\t\t\t\t\tname={item.label ?? item.key}\n\t\t\t\t\t\tfill={seriesColor(item, index)}\n\t\t\t\t\t\tradius={BAR_RADIUS.vertical}\n\t\t\t\t\t\t{...ANIMATION_PROPS}\n\t\t\t\t\t/>\n\t\t\t\t))}\n\t\t\t</RechartsBar>\n\t\t</ChartShell>\n\t);\n}\n"],"mappings":";;;;;;;;AA8EA,SAAgB,EAGd,EACD,SACA,WACA,eAAY,qBACZ,cACA,cAAW,IACX,gBAAa,IACb,mBACA,oBACA,YACA,WACA,kBACA,YACA,oBACA,yBACkC;CAElC,IAAM,IAAO,EAAmB,GAAQ,CADnB,KAAK,IACc,CAAW,GAC7C,IACL,MAAW,KAAA,IAMP,IACH,kBAAC,GAAD;EAAa,OAAO;EAAM,OAAM;CAAO,CAAA,IACpC,KAAA,IAPH,OAAO,KAAW,aACjB,EAAO,EAAE,OAAO,EAAK,CAAC,IAEtB;CAMH,OACC,kBAAC,GAAD;EACY;EACA;EACX,QAAQ;EACC;EACQ;EACG;EAEpB,UAAA,kBAAC,GAAD;GAAmB;GAAM,QAAQ,IAAW,IAAoB;GAAhE,UAAA;IACE,IAAW,kBAAC,GAAD,EAAe,GAAI,EAAa,CAAA,IAAI;IAChD,kBAAC,GAAD;KAAO,SAAQ;KAAI,GAAI,EAAmB,CAAC,CAAQ;KAAG,eAAe;IAAkB,CAAA;IACvF,kBAAC,GAAD;KACC,GAAI,EAAmB,CAAC,CAAQ;KAChC,eAAe;KACf,GAAK,IAAU,EAAE,QAAQ,EAA4B,IAAI,CAAC;IAC1D,CAAA;IACD,kBAAC,GAAD,EACC,GAAI,EAAkB;KACrB,WAAW;KACX,QAAQ;KACR;IACD,CAAC,EACD,CAAA;IACA,EAAK,KAAK,GAAM,MAChB,kBAAC,GAAD;KAEC,SAAS,EAAK;KACd,MAAM,EAAK,SAAS,EAAK;KACzB,MAAM,EAAY,GAAM,CAAK;KAC7B,QAAQ,EAAW;KACnB,GAAI;IACJ,GANK,EAAK,GAMV,CACD;GACW;;CACF,CAAA;AAEd"}
1
+ {"version":3,"file":"grouped-bar.js","names":[],"sources":["../../src/charts/grouped-bar.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { BarChart } from \"./bar\";\nimport type {\n\tLineChartAxisDomain,\n\tLineChartLegendRenderer,\n\tLineChartNumericKeys,\n\tLineChartTooltipRenderer,\n} from \"./line\";\nimport { type ChartSeriesDescriptor, resolveChartSeries, type XYPoint } from \"./series\";\n\nexport type GroupedBarChartProps<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n> = {\n\t/**\n\t * Dataset array where each record requires an `x` category or time coordinate.\n\t * Any remaining fields with numeric, nullable, or optional number values are inferred as valid series keys.\n\t */\n\tdata: TData[];\n\t/**\n\t * Series descriptors identifying which numeric keys to plot.\n\t * Inferred strictly from numeric keys of `TData` (rejects non-numeric fields, `x`, and typos).\n\t */\n\tseries?: Array<ChartSeriesDescriptor<NoInfer<K>>>;\n\tariaLabel?: string;\n\tclassName?: string;\n\tshowAxes?: boolean;\n\tshowLegend?: boolean;\n\t/**\n\t * Value formatter for Y-axis tick values and fallback tooltip values.\n\t */\n\tvalueFormatter?: (value: number) => string;\n\t/**\n\t * Formatter for X-axis category or time tick labels.\n\t */\n\txValueFormatter?: (value: string | number) => string;\n\t/**\n\t * Custom numerical or keyword bounds for the Y-axis.\n\t */\n\tyDomain?: LineChartAxisDomain;\n\t/**\n\t * Custom legend slot or render function receiving resolved series descriptors.\n\t */\n\tlegend?: ReactNode | LineChartLegendRenderer<K>;\n\t/**\n\t * Custom tooltip content renderer receiving Recharts payload, active status, and coordinate label.\n\t */\n\tcustomTooltip?: LineChartTooltipRenderer;\n\t/**\n\t * Textual summary describing key insights, highs, lows, and keyboard exploration instructions.\n\t * Associated with the chart via useId and aria-describedby.\n\t */\n\tsummary?: ReactNode;\n\t/**\n\t * Accessible tabular or structured data alternative rendered outside the plot area.\n\t */\n\tdataAlternative?: ReactNode;\n\t/**\n\t * Whether the interactive accessibility layer is enabled on the underlying Recharts graphic.\n\t * Enables keyboard exploration with Tab and arrow keys where supported by the underlying chart type.\n\t * Non-interactive compact or decorative charts without tooltip navigation should provide summary or dataAlternative.\n\t * @default true\n\t */\n\taccessibilityLayer?: boolean;\n};\n\nexport function GroupedBarChart<\n\tTData extends { x: string | number } = XYPoint,\n\tK extends LineChartNumericKeys<TData> & string = LineChartNumericKeys<TData> & string,\n>({ series, ariaLabel = \"Grouped bar chart\", ...props }: GroupedBarChartProps<TData, K>) {\n\tconst resolvedSeries = resolveChartSeries(series, [\"y\", \"y2\"] as K[]);\n\treturn (\n\t\t<BarChart<TData, K>\n\t\t\tseries={resolvedSeries}\n\t\t\tariaLabel={ariaLabel}\n\t\t\t{...props}\n\t\t\tcolor={undefined}\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;AAkEA,SAAgB,EAGd,EAAE,WAAQ,eAAY,qBAAqB,GAAG,KAAyC;CACxF,IAAM,IAAiB,EAAmB,GAAQ,CAAC,KAAK,IAAI,CAAQ;CACpE,OACC,kBAAC,GAAD;EACC,QAAQ;EACG;EACX,GAAI;EACJ,OAAO,KAAA;CACP,CAAA;AAEH"}
@@ -56,33 +56,9 @@ function _(e, t, n) {
56
56
  return Math.ceil(i * r);
57
57
  }
58
58
  function v(e) {
59
- if ("data" in e) {
60
- let { colorScale: t = f.green, valueFormatter: n = (e) => e.toLocaleString(), metricLabel: r = "Value", cellSize: i = 12, cellGap: a = 2, locale: o = "en-US", weekdayLabels: s, monthLabels: c, lessLabel: l = "Less", moreLabel: d = "More", ariaLabel: p = "Heatmap calendar", className: m } = e;
61
- return /* @__PURE__ */ u(b, {
62
- data: e.data,
63
- year: e.year,
64
- colorScale: t,
65
- valueFormatter: n,
66
- metricLabel: r,
67
- cellSize: i,
68
- cellGap: a,
69
- locale: o,
70
- weekdayLabels: s,
71
- monthLabels: c,
72
- lessLabel: l,
73
- moreLabel: d,
74
- ariaLabel: p,
75
- className: m
76
- });
77
- }
78
- let { ariaLabel: t = "Heatmap calendar", className: n } = e;
79
- return /* @__PURE__ */ u(y, {
80
- values: e.values,
81
- ariaLabel: t,
82
- className: n
83
- });
59
+ return "data" in e ? /* @__PURE__ */ u(b, { ...e }) : /* @__PURE__ */ u(y, { ...e });
84
60
  }
85
- function y({ values: o, ariaLabel: s, className: f }) {
61
+ function y({ values: o, ariaLabel: s = "Heatmap calendar", className: f }) {
86
62
  let [p, m] = l(0), [h, g] = l(null), _ = c(null), v = c([]), y = c(!1);
87
63
  a(() => {
88
64
  let e = y.current;
@@ -107,20 +83,7 @@ function y({ values: o, ariaLabel: s, className: f }) {
107
83
  else if (e.key === "End") n = o.length - 1;
108
84
  else return;
109
85
  e.preventDefault(), m(n), g(n), v.current[n]?.focus();
110
- };
111
- return o.length === 0 ? /* @__PURE__ */ u("div", {
112
- ref: _,
113
- tabIndex: -1,
114
- role: "region",
115
- "aria-label": s,
116
- onFocus: () => {
117
- y.current = !0;
118
- },
119
- onBlur: (e) => {
120
- e.currentTarget.contains(e.relatedTarget) || (y.current = !1);
121
- },
122
- className: e("grid grid-cols-7 gap-1 p-0.5 outline-none", f)
123
- }) : /* @__PURE__ */ u(r, { children: /* @__PURE__ */ u("div", {
86
+ }, x = /* @__PURE__ */ u("div", {
124
87
  ref: _,
125
88
  tabIndex: -1,
126
89
  role: "region",
@@ -166,35 +129,30 @@ function y({ values: o, ariaLabel: s, className: f }) {
166
129
  ]
167
130
  }) })]
168
131
  }, r))
169
- }) });
132
+ });
133
+ return o.length === 0 ? x : /* @__PURE__ */ u(r, { children: x });
170
134
  }
171
- function b({ data: f, year: v, colorScale: y, valueFormatter: b, metricLabel: x, cellSize: S, cellGap: C, locale: w, weekdayLabels: T, monthLabels: E, lessLabel: D, moreLabel: O, ariaLabel: k, className: A }) {
172
- let j = T ?? p(w), M = E ?? m(w), N = o(), P = c(null), { weeks: F, dataMap: I, maxValue: L, labels: R, validDays: z, dateToValidIndex: B } = s(() => {
173
- let e = h(v), t = /* @__PURE__ */ new Map(), n = 0;
174
- for (let e of f) t.set(e.date, e.value), e.value > n && (n = e.value);
135
+ function b({ data: v, year: y, colorScale: b = f.green, valueFormatter: x = (e) => e.toLocaleString(), metricLabel: S = "Value", cellSize: C = 12, cellGap: w = 2, locale: T = "en-US", weekdayLabels: E, monthLabels: D, lessLabel: O = "Less", moreLabel: k = "More", ariaLabel: A = "Heatmap calendar", className: j }) {
136
+ let M = E ?? p(T), N = D ?? m(T), P = o(), F = c(null), { weeks: I, dataMap: L, maxValue: R, labels: z, validDays: B, dateToValidIndex: V } = s(() => {
137
+ let e = h(y), t = /* @__PURE__ */ new Map(), n = 0;
138
+ for (let e of v) t.set(e.date, e.value), e.value > n && (n = e.value);
175
139
  let r = [], i = -1;
176
140
  e.forEach((e, t) => {
177
- let n = e.find((e) => e.getFullYear() === v);
141
+ let n = e.find((e) => e.getFullYear() === y);
178
142
  if (n) {
179
143
  let e = n.getMonth();
180
144
  e !== i && (r.push({
181
- month: M[e],
145
+ month: N[e],
182
146
  weekIndex: t
183
147
  }), i = e);
184
148
  }
185
149
  });
186
150
  let a = [], o = /* @__PURE__ */ new Map();
187
- return e.forEach((e, r) => {
188
- e.forEach((e, i) => {
189
- if (e.getFullYear() === v) {
190
- let s = g(e), c = t.get(s) ?? 0, l = _(c, n, y);
191
- o.set(s, a.length), a.push({
192
- dateStr: s,
193
- value: c,
194
- weekIndex: r,
195
- dayIndex: i,
196
- colorIndex: l
197
- });
151
+ return e.forEach((e) => {
152
+ e.forEach((e) => {
153
+ if (e.getFullYear() === y) {
154
+ let t = g(e);
155
+ o.set(t, a.length), a.push(t);
198
156
  }
199
157
  });
200
158
  }), {
@@ -206,80 +164,72 @@ function b({ data: f, year: v, colorScale: y, valueFormatter: b, metricLabel: x,
206
164
  dateToValidIndex: o
207
165
  };
208
166
  }, [
209
- f,
210
- M,
211
167
  v,
168
+ N,
212
169
  y
213
- ]), [V, H] = l(() => z[0]?.dateStr ?? `${v}-01-01`), [U, W] = l(null), G = c(/* @__PURE__ */ new Map()), K = c(!1);
170
+ ]), [H, U] = l(() => B[0] ?? `${y}-01-01`), [W, G] = l(null), K = c(/* @__PURE__ */ new Map()), q = c(!1);
214
171
  a(() => {
215
- let e = K.current;
216
- if (z.length === 0) H(""), W(null), e && P.current?.focus();
217
- else if (!B.has(V)) {
218
- let t = z[0]?.dateStr ?? "";
219
- H(t), e && G.current.get(t)?.focus();
172
+ let e = q.current;
173
+ if (B.length === 0) U(""), G(null), e && F.current?.focus();
174
+ else if (!V.has(H)) {
175
+ let t = B[0] ?? "";
176
+ U(t), e && K.current.get(t)?.focus();
220
177
  }
221
178
  }, [
222
- z,
223
179
  B,
224
- V
225
- ]);
226
- let q = s(() => {
227
- let e = B.get(V);
228
- return e === void 0 ? z[0] : z[e];
229
- }, [
230
180
  V,
231
- B,
232
- z
233
- ]), J = (e) => {
234
- e && (H(e.dateStr), W(e.dateStr), G.current.get(e.dateStr)?.focus());
235
- }, Y = (e, t) => {
236
- if (z.length === 0) return;
237
- let n = B.get(t.dateStr) ?? 0;
181
+ H
182
+ ]);
183
+ let J = V.has(H) ? H : B[0], Y = (e) => {
184
+ e && (U(e), G(e), K.current.get(e)?.focus());
185
+ }, X = (e, t) => {
186
+ if (B.length === 0) return;
187
+ let n = V.get(t) ?? 0;
238
188
  if (e.key === "Escape") {
239
- W(null);
189
+ G(null);
240
190
  return;
241
191
  }
242
192
  if (e.key === "ArrowDown") {
243
193
  e.preventDefault();
244
- let t = z[n + 1];
245
- t && J(t);
194
+ let t = B[n + 1];
195
+ t && Y(t);
246
196
  } else if (e.key === "ArrowUp") {
247
197
  e.preventDefault();
248
- let t = z[n - 1];
249
- t && J(t);
198
+ let t = B[n - 1];
199
+ t && Y(t);
250
200
  } else if (e.key === "ArrowRight") {
251
201
  e.preventDefault();
252
202
  let t = n + 7;
253
- t < z.length ? J(z[t]) : J(z[z.length - 1]);
203
+ t < B.length ? Y(B[t]) : Y(B[B.length - 1]);
254
204
  } else if (e.key === "ArrowLeft") {
255
205
  e.preventDefault();
256
206
  let t = n - 7;
257
- J(t >= 0 ? z[t] : z[0]);
258
- } else e.key === "Home" ? (e.preventDefault(), J(z[0])) : e.key === "End" && (e.preventDefault(), J(z[z.length - 1]));
207
+ Y(t >= 0 ? B[t] : B[0]);
208
+ } else e.key === "Home" ? (e.preventDefault(), Y(B[0])) : e.key === "End" && (e.preventDefault(), Y(B[B.length - 1]));
259
209
  };
260
210
  return /* @__PURE__ */ u("div", {
261
- ref: P,
211
+ ref: F,
262
212
  tabIndex: -1,
263
213
  role: "region",
264
- "aria-label": `${k} scrollable view`,
214
+ "aria-label": `${A} scrollable view`,
265
215
  onFocus: () => {
266
- K.current = !0;
216
+ q.current = !0;
267
217
  },
268
218
  onBlur: (e) => {
269
- e.currentTarget.contains(e.relatedTarget) || (K.current = !1);
219
+ e.currentTarget.contains(e.relatedTarget) || (q.current = !1);
270
220
  },
271
- className: e("overflow-x-auto rounded-md outline-none focus-visible:ring-1 focus-visible:ring-basalt-ring", A),
221
+ className: e("overflow-x-auto rounded-md outline-none focus-visible:ring-1 focus-visible:ring-basalt-ring", j),
272
222
  children: /* @__PURE__ */ u(r, { children: /* @__PURE__ */ d("div", {
273
223
  className: "inline-block p-1",
274
224
  role: "group",
275
- "aria-label": k,
225
+ "aria-label": A,
276
226
  children: [
277
227
  /* @__PURE__ */ u("div", {
278
228
  className: "relative mb-1 h-4 text-xs text-basalt-muted-foreground",
279
229
  style: { marginLeft: 30 },
280
- children: R.map((e) => /* @__PURE__ */ u("div", {
230
+ children: z.map((e) => /* @__PURE__ */ u("div", {
281
231
  className: "absolute",
282
- style: { left: e.weekIndex * (S + C) },
232
+ style: { left: e.weekIndex * (C + w) },
283
233
  children: e.month
284
234
  }, `${e.month}-${e.weekIndex}`))
285
235
  }),
@@ -289,83 +239,77 @@ function b({ data: f, year: v, colorScale: y, valueFormatter: b, metricLabel: x,
289
239
  className: "mr-1 flex flex-col text-xs text-basalt-muted-foreground select-none",
290
240
  style: { width: 30 },
291
241
  "aria-hidden": "true",
292
- children: j.map((e, t) => /* @__PURE__ */ u("div", {
242
+ children: M.map((e, t) => /* @__PURE__ */ u("div", {
293
243
  style: {
294
- height: S + C,
295
- lineHeight: `${S + C}px`,
244
+ height: C + w,
245
+ lineHeight: `${C + w}px`,
296
246
  visibility: t % 2 == 1 ? "visible" : "hidden"
297
247
  },
298
248
  children: e
299
249
  }, `${e}-${t}`))
300
250
  }), /* @__PURE__ */ u("div", {
301
251
  className: "flex",
302
- style: { gap: C },
303
- children: F.map((e, r) => /* @__PURE__ */ u("div", {
252
+ style: { gap: w },
253
+ children: I.map((e, r) => /* @__PURE__ */ u("div", {
304
254
  className: "flex flex-col",
305
- style: { gap: C },
306
- children: e.map((e, a) => {
307
- let o = g(e);
308
- if (e.getFullYear() !== v) return /* @__PURE__ */ u("div", {
255
+ style: { gap: w },
256
+ children: e.map((e, r) => {
257
+ let a = g(e);
258
+ if (e.getFullYear() !== y) return /* @__PURE__ */ u("div", {
309
259
  style: {
310
- width: S,
311
- height: S,
260
+ width: C,
261
+ height: C,
312
262
  visibility: "hidden"
313
263
  },
314
264
  "aria-hidden": "true"
315
- }, a);
316
- let s = I.get(o) ?? 0, c = _(s, L, y), l = q?.dateStr === o, f = b(s, o), p = `${o}, ${x}: ${f}`, m = U === o, h = {
317
- dateStr: o,
318
- value: s,
319
- weekIndex: r,
320
- dayIndex: a,
321
- colorIndex: c
322
- };
265
+ }, r);
266
+ let o = L.get(a) ?? 0, s = _(o, R, b), c = J === a, l = x(o, a), f = `${a}, ${S}: ${l}`;
323
267
  return /* @__PURE__ */ d(t, {
324
- open: m,
268
+ open: W === a,
325
269
  onOpenChange: (e) => {
326
- W(e ? o : (e) => e === o ? document.activeElement === G.current.get(o) ? e : null : e);
270
+ G(e ? a : (e) => e === a ? document.activeElement === K.current.get(a) ? e : null : e);
327
271
  },
328
272
  children: [/* @__PURE__ */ u(i, {
329
273
  asChild: !0,
330
274
  children: /* @__PURE__ */ u("button", {
331
275
  ref: (e) => {
332
- e ? G.current.set(o, e) : G.current.delete(o);
276
+ e ? K.current.set(a, e) : K.current.delete(a);
333
277
  },
334
278
  type: "button",
335
- "aria-label": p,
336
- tabIndex: l ? 0 : -1,
279
+ "aria-label": f,
280
+ tabIndex: c ? 0 : -1,
337
281
  onFocus: () => {
338
- H(o), W(o);
282
+ U(a), G(a);
339
283
  },
340
284
  onBlur: () => {
341
- W((e) => e === o ? null : e);
285
+ G((e) => e === a ? null : e);
342
286
  },
343
- onKeyDown: (e) => Y(e, h),
287
+ onKeyDown: (e) => X(e, a),
344
288
  className: "box-border m-0 cursor-pointer rounded-sm border-0 p-0 transition-colors hover:ring-1 hover:ring-basalt-foreground focus-visible:outline-2 focus-visible:outline-offset-1 focus-visible:outline-basalt-ring",
345
289
  style: {
346
- width: S,
347
- height: S,
348
- backgroundColor: y[c]
290
+ width: C,
291
+ height: C,
292
+ backgroundColor: b[s]
349
293
  }
350
294
  })
351
295
  }), /* @__PURE__ */ u(n, {
352
- id: `${N}-${o}`,
296
+ id: `${P}-${a}`,
353
297
  children: /* @__PURE__ */ d("div", {
354
298
  className: "text-sm",
355
299
  children: [/* @__PURE__ */ u("div", {
356
300
  className: "font-medium",
357
- children: o
301
+ children: a
358
302
  }), /* @__PURE__ */ d("div", {
359
303
  className: "text-basalt-muted-foreground",
360
304
  children: [
361
- x,
305
+ S,
362
306
  ": ",
363
- f
307
+ l
364
308
  ]
365
309
  })]
366
310
  })
367
311
  })]
368
- }, a);
312
+ }, r);
369
313
  })
370
314
  }, r))
371
315
  })]
@@ -374,16 +318,16 @@ function b({ data: f, year: v, colorScale: y, valueFormatter: b, metricLabel: x,
374
318
  className: "mt-2 flex items-center justify-end gap-1 text-xs text-basalt-muted-foreground select-none",
375
319
  "aria-hidden": "true",
376
320
  children: [
377
- /* @__PURE__ */ u("span", { children: D }),
378
- y.map((e) => /* @__PURE__ */ u("div", {
321
+ /* @__PURE__ */ u("span", { children: O }),
322
+ b.map((e) => /* @__PURE__ */ u("div", {
379
323
  className: "rounded-sm",
380
324
  style: {
381
- width: S,
382
- height: S,
325
+ width: C,
326
+ height: C,
383
327
  backgroundColor: e
384
328
  }
385
329
  }, e)),
386
- /* @__PURE__ */ u("span", { children: O })
330
+ /* @__PURE__ */ u("span", { children: k })
387
331
  ]
388
332
  })
389
333
  ]