@mechane-ai/elements 0.17.2 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
- import { a as e, n as t, r as n, s as r, t as i } from "../chart-frame-Bf1l_7-R.js";
2
- import { n as a, r as o, t as s } from "../chart-input-fBuRm0Lc.js";
1
+ import { a as e, n as t, r as n, s as r, t as i } from "../chart-frame-vwS7YVgv.js";
2
+ import { n as a, r as o, t as s } from "../chart-input-D6Fw2UGV.js";
3
3
  import { t as c } from "../plot-width--OgdohB5.js";
4
4
  import * as l from "@stylexjs/stylex";
5
5
  import { Fragment as u, jsx as d, jsxs as f } from "react/jsx-runtime";
@@ -1,5 +1,5 @@
1
- import { a as e, n as t, r as n, s as r, t as i } from "../chart-frame-Bf1l_7-R.js";
2
- import { n as a, t as o } from "../chart-input-fBuRm0Lc.js";
1
+ import { a as e, n as t, r as n, s as r, t as i } from "../chart-frame-vwS7YVgv.js";
2
+ import { n as a, t as o } from "../chart-input-D6Fw2UGV.js";
3
3
  import * as s from "@stylexjs/stylex";
4
4
  import { useId as c } from "react";
5
5
  import { Fragment as l, jsx as u, jsxs as d } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
- import { i as e, r as t, t as n } from "../categorical-values-l5YTG9G3.js";
2
- import { o as r, r as i, s as a } from "../chart-frame-Bf1l_7-R.js";
3
- import { t as o } from "../chart-input-fBuRm0Lc.js";
1
+ import { i as e, r as t, t as n } from "../categorical-values-D-sSI9JB.js";
2
+ import { o as r, r as i, s as a } from "../chart-frame-vwS7YVgv.js";
3
+ import { t as o } from "../chart-input-D6Fw2UGV.js";
4
4
  import { t as s } from "../plot-width--OgdohB5.js";
5
5
  import * as c from "@stylexjs/stylex";
6
6
  import { jsx as l, jsxs as u } from "react/jsx-runtime";
@@ -1,6 +1,6 @@
1
1
  import { r as e } from "../tokens.stylex-DTHHFbyl.js";
2
- import { n as t, r as n, t as r } from "../chart-input-fBuRm0Lc.js";
3
- import { a as i, n as a, r as o, s, t as c } from "../chart-frame-Bf1l_7-R.js";
2
+ import { n as t, r as n, t as r } from "../chart-input-D6Fw2UGV.js";
3
+ import { a as i, n as a, r as o, s, t as c } from "../chart-frame-vwS7YVgv.js";
4
4
  import * as l from "@stylexjs/stylex";
5
5
  import { jsx as u, jsxs as d } from "react/jsx-runtime";
6
6
  // packages/charts/src/matrix/heatmap-scale.ts
@@ -1,5 +1,5 @@
1
1
  import { c as e } from "../src-BXh4g2VY.js";
2
- import { n as t, t as n } from "../chart-input-fBuRm0Lc.js";
2
+ import { n as t, t as n } from "../chart-input-D6Fw2UGV.js";
3
3
  import * as r from "@stylexjs/stylex";
4
4
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
5
5
  import { scaleLinear as o } from "@visx/scale";
package/dist/charts.js CHANGED
@@ -1 +1 @@
1
- export { r as ChartFrame, i as ChartLegend } from "./chart-frame-Bf1l_7-R.js";
1
+ export { r as ChartFrame, i as ChartLegend } from "./chart-frame-vwS7YVgv.js";
package/dist/elements.css CHANGED
@@ -1097,6 +1097,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
1097
1097
  flex-shrink: 1;
1098
1098
  }
1099
1099
 
1100
+ .xozqiw3 {
1101
+ flex-wrap: nowrap;
1102
+ }
1103
+
1100
1104
  .x1a02dak {
1101
1105
  flex-wrap: wrap;
1102
1106
  }
@@ -1581,6 +1585,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
1581
1585
  transform: translateY(calc(-100% - 16px));
1582
1586
  }
1583
1587
 
1588
+ .x1hj3fc7 {
1589
+ transform-origin: 0 0;
1590
+ }
1591
+
1584
1592
  .x1mq3mr6 {
1585
1593
  transition-duration: 0s;
1586
1594
  }
@@ -1605,6 +1613,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
1605
1613
  transition-property: opacity;
1606
1614
  }
1607
1615
 
1616
+ .xwcsmn1 {
1617
+ transition-property: transform, opacity;
1618
+ }
1619
+
1608
1620
  .x11xpdln {
1609
1621
  transition-property: transform;
1610
1622
  }
@@ -1989,6 +2001,12 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
1989
2001
  text-decoration-line: underline;
1990
2002
  }
1991
2003
 
2004
+ @media (prefers-reduced-motion: reduce) {
2005
+ .x12w9bfk.x12w9bfk {
2006
+ transition-duration: 0s;
2007
+ }
2008
+ }
2009
+
1992
2010
  @container inspector (width <= 860px) {
1993
2011
  .xdctr63.xdctr63 {
1994
2012
  border-inline-start-width: 0;
@@ -2393,6 +2411,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
2393
2411
  max-width: min(360px, 100vw - 24px);
2394
2412
  }
2395
2413
 
2414
+ .x1x1rfll {
2415
+ max-width: none;
2416
+ }
2417
+
2396
2418
  .x9g60mw {
2397
2419
  max-width: var(--x11mzuvh);
2398
2420
  }
@@ -2421,6 +2443,10 @@ html[dir=ltr],[data-sonner-toaster][dir=ltr]{--toast-icon-margin-start:-3px;--to
2421
2443
  min-height: 35px;
2422
2444
  }
2423
2445
 
2446
+ .x1rtsecp {
2447
+ min-height: calc(var(--xdvbmuj) * 2);
2448
+ }
2449
+
2424
2450
  .x1avwmir {
2425
2451
  min-height: var(--x10l6e8v);
2426
2452
  }
@@ -1,12 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { ChartSelection } from '../chart-frame.tsx';
3
- import type { ChartTone } from '../chart-theme.ts';
4
- export type BarSeries = {
5
- readonly id: string;
6
- readonly label: string;
7
- readonly values: ReadonlyArray<number | null>;
8
- readonly tone?: ChartTone | undefined;
9
- };
3
+ import type { BarComposition, BarSeries } from './bar-data.ts';
4
+ export type { BarSeries, BarBucket, BarComposition } from './bar-data.ts';
10
5
  export type BarChartProps = {
11
6
  readonly title: string;
12
7
  readonly description?: string | undefined;
@@ -18,6 +13,7 @@ export type BarChartProps = {
18
13
  readonly series: ReadonlyArray<BarSeries>;
19
14
  readonly domain: readonly [number, number];
20
15
  readonly mode?: 'grouped' | 'stacked' | undefined;
16
+ readonly composition?: BarComposition | undefined;
21
17
  readonly formatValue: (value: number) => string;
22
18
  readonly selection?: ChartSelection | undefined;
23
19
  readonly height?: number | undefined;
@@ -27,4 +23,4 @@ export type BarChartPlaceholderProps = Pick<BarChartProps, 'description' | 'heig
27
23
  readonly series?: ReadonlyArray<Pick<BarSeries, 'id' | 'label' | 'tone'>> | undefined;
28
24
  };
29
25
  export declare function BarChartPlaceholder({ title, description, series, height, }: BarChartPlaceholderProps): ReactNode;
30
- export declare function BarChart({ title, description, categories, series, domain, mode, formatValue, selection, height, }: BarChartProps): ReactNode;
26
+ export declare function BarChart({ title, description, categories, series, domain, mode, formatValue, selection, height, composition, }: BarChartProps): ReactNode;
@@ -0,0 +1,31 @@
1
+ import type { ChartTone } from '../chart-theme.ts';
2
+ export type BarSeries = {
3
+ readonly id: string;
4
+ readonly label: string;
5
+ readonly values: ReadonlyArray<number | null>;
6
+ readonly tone?: ChartTone | undefined;
7
+ };
8
+ export type BarBucket = {
9
+ readonly kind: 'parts' | 'total';
10
+ readonly total: number;
11
+ } | {
12
+ readonly kind: 'gap';
13
+ };
14
+ export type BarComposition = {
15
+ readonly buckets: ReadonlyArray<BarBucket>;
16
+ readonly contextLabel: string;
17
+ readonly focusedSeries?: BarSeries | undefined;
18
+ readonly annotation?: {
19
+ readonly categoryId: string;
20
+ readonly value: number;
21
+ readonly label: string;
22
+ } | undefined;
23
+ };
24
+ type CompositionInput = {
25
+ readonly composition: BarComposition | undefined;
26
+ readonly series: ReadonlyArray<BarSeries>;
27
+ readonly categoryIds: ReadonlyArray<string>;
28
+ readonly domain: readonly [number, number];
29
+ };
30
+ export declare function validateComposition({ composition, series, categoryIds, domain, }: CompositionInput): string | undefined;
31
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { BarBucket, BarSeries } from './bar-data.ts';
3
+ type CompositionBarsProps = {
4
+ readonly bucket: BarBucket;
5
+ readonly series: ReadonlyArray<BarSeries>;
6
+ readonly focusedSeries: BarSeries | undefined;
7
+ readonly index: number;
8
+ readonly x: number;
9
+ readonly width: number;
10
+ readonly y: (value: number) => number;
11
+ readonly isHighlighted: boolean;
12
+ };
13
+ export declare function CompositionBars({ bucket, series, focusedSeries, index, x, width, y, isHighlighted, }: CompositionBarsProps): ReactNode;
14
+ export {};
@@ -1,4 +1,4 @@
1
- export type { BarSeries, BarChartProps, BarChartPlaceholderProps } from './bar-chart.tsx';
1
+ export type { BarSeries, BarBucket, BarComposition, BarChartProps, BarChartPlaceholderProps } from './bar-chart.tsx';
2
2
  export { BarChart, BarChartPlaceholder } from './bar-chart.tsx';
3
3
  export type { BreakdownBarProps } from './breakdown-bar.tsx';
4
4
  export { BreakdownBar } from './breakdown-bar.tsx';
@@ -19,9 +19,10 @@ export type ChartLegendItem = {
19
19
  export type ChartLegendProps = {
20
20
  readonly items: ReadonlyArray<ChartLegendItem>;
21
21
  readonly label?: string | undefined;
22
+ readonly isScrollable?: boolean | undefined;
22
23
  };
23
24
  export declare function ChartFrame({ title, description, children, actions, footer }: ChartFrameProps): ReactNode;
24
- export declare function ChartLegend({ items, label }: ChartLegendProps): ReactNode;
25
+ export declare function ChartLegend({ items, label, isScrollable }: ChartLegendProps): ReactNode;
25
26
  export declare function ChartDatumButton({ label, isSelected, onSelect, children, }: {
26
27
  readonly label: string;
27
28
  readonly isSelected?: boolean | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mechane-ai/elements",
3
- "version": "0.17.2",
3
+ "version": "0.18.0",
4
4
  "description": "Elements by Mechane — React components for applications, AI interfaces, and analytical graphics",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {