@wallarm-org/design-system 4.1.0 → 4.2.0-rc-fix-filter-input-flaky-e2e.1

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 (24) hide show
  1. package/README.md +4 -2
  2. package/dist/components/FilterInput/hooks/useFilterInputAutocomplete/useFocusManagement.js +4 -0
  3. package/dist/components/SimpleCharts/ColumnChart/ColumnChart.d.ts +28 -0
  4. package/dist/components/SimpleCharts/ColumnChart/ColumnChart.js +163 -0
  5. package/dist/components/SimpleCharts/ColumnChart/ColumnChartBody.d.ts +9 -0
  6. package/dist/components/SimpleCharts/ColumnChart/ColumnChartBody.js +92 -0
  7. package/dist/components/SimpleCharts/ColumnChart/ColumnChartStack.d.ts +7 -0
  8. package/dist/components/SimpleCharts/ColumnChart/ColumnChartStack.js +123 -0
  9. package/dist/components/SimpleCharts/ColumnChart/ColumnChartXAxis.d.ts +13 -0
  10. package/dist/components/SimpleCharts/ColumnChart/ColumnChartXAxis.js +40 -0
  11. package/dist/components/SimpleCharts/ColumnChart/classes.d.ts +2 -0
  12. package/dist/components/SimpleCharts/ColumnChart/classes.js +7 -0
  13. package/dist/components/SimpleCharts/ColumnChart/constants.d.ts +8 -0
  14. package/dist/components/SimpleCharts/ColumnChart/constants.js +12 -0
  15. package/dist/components/SimpleCharts/ColumnChart/index.d.ts +4 -0
  16. package/dist/components/SimpleCharts/ColumnChart/index.js +4 -0
  17. package/dist/components/SimpleCharts/ColumnChart/lib/resolveColumnWidth.d.ts +8 -0
  18. package/dist/components/SimpleCharts/ColumnChart/lib/resolveColumnWidth.js +7 -0
  19. package/dist/components/SimpleCharts/LineChart/lib/dropEdgeGridLines.js +5 -3
  20. package/dist/components/SimpleCharts/index.d.ts +1 -0
  21. package/dist/components/SimpleCharts/index.js +1 -0
  22. package/dist/components/ThemeProvider/ThemeProvider.js +5 -1
  23. package/dist/metadata/components.json +4410 -1191
  24. package/package.json +1 -1
package/README.md CHANGED
@@ -6,7 +6,8 @@ Modern React component library for building user interfaces.
6
6
 
7
7
  All documentation is available in:
8
8
 
9
- - [Storybook](https://wallarm.github.io/design-system/) - Interactive component examples
9
+ - [Docs site](https://wallarm.github.io/design-system/) - Guides, component docs and API reference
10
+ - [Storybook](https://wallarm.github.io/design-system/storybook/) - Interactive component examples
10
11
  - [Installation Guide](docs/installation.md) - Setup instructions
11
12
  - [Getting Started](docs/getting-started.md) - Introduction and overview
12
13
 
@@ -116,7 +117,8 @@ The command writes the component files, `src/icons/index.ts`, the gallery catego
116
117
 
117
118
  ## 📖 Resources
118
119
 
119
- - [Storybook](https://wallarm.github.io/design-system/) - Interactive examples
120
+ - [Docs site](https://wallarm.github.io/design-system/) - Guides and component docs
121
+ - [Storybook](https://wallarm.github.io/design-system/storybook/) - Interactive examples
120
122
  - [NPM](https://www.npmjs.com/package/@wallarm-org/design-system) - NPM package
121
123
  - [GitHub](https://github.com/wallarm/design-system) - Source code
122
124
 
@@ -20,6 +20,10 @@ const useFocusManagement = ({ menuState, isFocused, conditionsLength, inputText,
20
20
  if ((null != editingSegment || !focusStaysInside) && blurCommitRef.current?.()) {
21
21
  setIsFocused(false);
22
22
  related?.focus();
23
+ if (!focusStaysInside) {
24
+ setMenuState('closed');
25
+ if (document.activeElement === inputRef.current) inputRef.current?.blur();
26
+ }
23
27
  return;
24
28
  }
25
29
  if (focusStaysInside) return;
@@ -0,0 +1,28 @@
1
+ import type { HTMLAttributes, ReactElement, Ref } from 'react';
2
+ import { type TestableProps } from '../../../utils/testId.js';
3
+ import { type LineChartDatum, type LineChartSeries } from '../LineChart/LineChartContext.js';
4
+ /**
5
+ * Generic over the datum shape, as `LineChart<T>`: pass a concrete datum interface and
6
+ * `xKey` / `series[].key` become compile-time-checked keys of it.
7
+ */
8
+ export interface ColumnChartProps<T extends LineChartDatum = LineChartDatum> extends HTMLAttributes<HTMLDivElement>, TestableProps {
9
+ ref?: Ref<HTMLDivElement>;
10
+ /** One entry per column (step), sorted ascending by `xKey`. */
11
+ data: T[];
12
+ /**
13
+ * The categories each column is split into, in legend order — the first one stacks on top.
14
+ * The same schema drives the legend, the parts and the hover popover rows.
15
+ */
16
+ series: LineChartSeries<Extract<keyof T, string>>[];
17
+ /** Key on each datum used as the X-axis value (the step: a day, an hour, …). */
18
+ xKey: Extract<keyof T, string>;
19
+ }
20
+ /**
21
+ * Vertical stacked columns: a column per step, split by category. Built on the `LineChart`
22
+ * contexts, so `LineChartLegend` / `LineChartLegendItem`, `LineChartGrid`, `LineChartYAxis`
23
+ * and `LineChartTooltip` compose inside it unchanged.
24
+ */
25
+ export declare function ColumnChart<T extends LineChartDatum = LineChartDatum>({ data, series, xKey, className, children, ref, 'data-testid': testId, ...props }: ColumnChartProps<T>): ReactElement;
26
+ export declare namespace ColumnChart {
27
+ var displayName: string;
28
+ }
@@ -0,0 +1,163 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import { cn } from "../../../utils/cn.js";
4
+ import { TestIdProvider } from "../../../utils/testId.js";
5
+ import { useLineChartActiveKey } from "../LineChart/hooks/useLineChartActiveKey.js";
6
+ import { useLineChartDataWarnings } from "../LineChart/hooks/useLineChartDataWarnings.js";
7
+ import { EMPTY_HIDDEN_SET, LineChartActiveContext, LineChartDataContext } from "../LineChart/LineChartContext.js";
8
+ import { columnChartRootClasses } from "./classes.js";
9
+ const noop = ()=>void 0;
10
+ function ColumnChart(t0) {
11
+ const $ = c(42);
12
+ let children;
13
+ let className;
14
+ let data;
15
+ let props;
16
+ let ref;
17
+ let series;
18
+ let testId;
19
+ let xKey;
20
+ if ($[0] !== t0) {
21
+ ({ data, series, xKey, className, children, ref, "data-testid": testId, ...props } = t0);
22
+ $[0] = t0;
23
+ $[1] = children;
24
+ $[2] = className;
25
+ $[3] = data;
26
+ $[4] = props;
27
+ $[5] = ref;
28
+ $[6] = series;
29
+ $[7] = testId;
30
+ $[8] = xKey;
31
+ } else {
32
+ children = $[1];
33
+ className = $[2];
34
+ data = $[3];
35
+ props = $[4];
36
+ ref = $[5];
37
+ series = $[6];
38
+ testId = $[7];
39
+ xKey = $[8];
40
+ }
41
+ let t1;
42
+ if ($[9] !== series) {
43
+ t1 = new Map(series.map(_temp));
44
+ $[9] = series;
45
+ $[10] = t1;
46
+ } else t1 = $[10];
47
+ const seriesByKey = t1;
48
+ let t2;
49
+ if ($[11] !== data || $[12] !== series || $[13] !== xKey) {
50
+ t2 = {
51
+ data,
52
+ series,
53
+ xKey
54
+ };
55
+ $[11] = data;
56
+ $[12] = series;
57
+ $[13] = xKey;
58
+ $[14] = t2;
59
+ } else t2 = $[14];
60
+ useLineChartDataWarnings(t2);
61
+ let t3;
62
+ if ($[15] !== seriesByKey) {
63
+ t3 = {
64
+ controlledActiveKey: void 0,
65
+ onActiveKeyChange: void 0,
66
+ seriesByKey
67
+ };
68
+ $[15] = seriesByKey;
69
+ $[16] = t3;
70
+ } else t3 = $[16];
71
+ const { activeKey, setActiveKey } = useLineChartActiveKey(t3);
72
+ let t4;
73
+ if ($[17] !== data || $[18] !== series || $[19] !== seriesByKey || $[20] !== setActiveKey || $[21] !== xKey) {
74
+ t4 = {
75
+ data,
76
+ series,
77
+ seriesByKey,
78
+ xKey,
79
+ hiddenSet: EMPTY_HIDDEN_SET,
80
+ setActiveKey,
81
+ emitZoom: noop,
82
+ syncId: void 0,
83
+ syncMethod: void 0
84
+ };
85
+ $[17] = data;
86
+ $[18] = series;
87
+ $[19] = seriesByKey;
88
+ $[20] = setActiveKey;
89
+ $[21] = xKey;
90
+ $[22] = t4;
91
+ } else t4 = $[22];
92
+ const dataValue = t4;
93
+ let t5;
94
+ if ($[23] !== activeKey) {
95
+ t5 = {
96
+ activeKey
97
+ };
98
+ $[23] = activeKey;
99
+ $[24] = t5;
100
+ } else t5 = $[24];
101
+ let t6;
102
+ if ($[25] !== className) {
103
+ t6 = cn(columnChartRootClasses, className);
104
+ $[25] = className;
105
+ $[26] = t6;
106
+ } else t6 = $[26];
107
+ let t7;
108
+ if ($[27] !== children || $[28] !== props || $[29] !== ref || $[30] !== t6 || $[31] !== testId) {
109
+ t7 = /*#__PURE__*/ jsx("div", {
110
+ ...props,
111
+ ref: ref,
112
+ "data-slot": "column-chart",
113
+ "data-testid": testId,
114
+ className: t6,
115
+ children: children
116
+ });
117
+ $[27] = children;
118
+ $[28] = props;
119
+ $[29] = ref;
120
+ $[30] = t6;
121
+ $[31] = testId;
122
+ $[32] = t7;
123
+ } else t7 = $[32];
124
+ let t8;
125
+ if ($[33] !== t7 || $[34] !== testId) {
126
+ t8 = /*#__PURE__*/ jsx(TestIdProvider, {
127
+ value: testId,
128
+ children: t7
129
+ });
130
+ $[33] = t7;
131
+ $[34] = testId;
132
+ $[35] = t8;
133
+ } else t8 = $[35];
134
+ let t9;
135
+ if ($[36] !== t5 || $[37] !== t8) {
136
+ t9 = /*#__PURE__*/ jsx(LineChartActiveContext.Provider, {
137
+ value: t5,
138
+ children: t8
139
+ });
140
+ $[36] = t5;
141
+ $[37] = t8;
142
+ $[38] = t9;
143
+ } else t9 = $[38];
144
+ let t10;
145
+ if ($[39] !== dataValue || $[40] !== t9) {
146
+ t10 = /*#__PURE__*/ jsx(LineChartDataContext.Provider, {
147
+ value: dataValue,
148
+ children: t9
149
+ });
150
+ $[39] = dataValue;
151
+ $[40] = t9;
152
+ $[41] = t10;
153
+ } else t10 = $[41];
154
+ return t10;
155
+ }
156
+ function _temp(s) {
157
+ return [
158
+ s.key,
159
+ s
160
+ ];
161
+ }
162
+ ColumnChart.displayName = "ColumnChart";
163
+ export { ColumnChart };
@@ -0,0 +1,9 @@
1
+ import { type FC, type HTMLAttributes, type ReactNode, type Ref } from 'react';
2
+ export interface ColumnChartBodyProps extends HTMLAttributes<HTMLDivElement> {
3
+ ref?: Ref<HTMLDivElement>;
4
+ /** Plot slots — `<LineChartGrid>`, `<ColumnChartXAxis>`, `<LineChartYAxis>`, `<ColumnChartStack>`, `<LineChartTooltip>`. */
5
+ children?: ReactNode;
6
+ /** Plot height passed to recharts' `<ResponsiveContainer>`. Defaults to the Figma 164px. */
7
+ height?: number;
8
+ }
9
+ export declare const ColumnChartBody: FC<ColumnChartBodyProps>;
@@ -0,0 +1,92 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useContext } from "react";
4
+ import { ComposedChart, ResponsiveContainer } from "recharts";
5
+ import { cn } from "../../../utils/cn.js";
6
+ import { useTestId } from "../../../utils/testId.js";
7
+ import { LineChartDataContext } from "../LineChart/LineChartContext.js";
8
+ import { columnChartBodyClasses } from "./classes.js";
9
+ import { COLUMN_CARD_HEIGHT, COLUMN_DEFAULT_BODY_MARGIN, COLUMN_HEADER_HEIGHT } from "./constants.js";
10
+ const DEFAULT_BODY_HEIGHT = COLUMN_CARD_HEIGHT - COLUMN_HEADER_HEIGHT;
11
+ const ColumnChartBody = (t0)=>{
12
+ const $ = c(22);
13
+ let children;
14
+ let className;
15
+ let props;
16
+ let ref;
17
+ let t1;
18
+ if ($[0] !== t0) {
19
+ ({ height: t1, className, ref, children, ...props } = t0);
20
+ $[0] = t0;
21
+ $[1] = children;
22
+ $[2] = className;
23
+ $[3] = props;
24
+ $[4] = ref;
25
+ $[5] = t1;
26
+ } else {
27
+ children = $[1];
28
+ className = $[2];
29
+ props = $[3];
30
+ ref = $[4];
31
+ t1 = $[5];
32
+ }
33
+ const height = void 0 === t1 ? DEFAULT_BODY_HEIGHT : t1;
34
+ const testId = useTestId("body");
35
+ const dataCtx = useContext(LineChartDataContext);
36
+ let t2;
37
+ if ($[6] !== className) {
38
+ t2 = cn(columnChartBodyClasses, className);
39
+ $[6] = className;
40
+ $[7] = t2;
41
+ } else t2 = $[7];
42
+ let t3;
43
+ if ($[8] !== dataCtx?.data) {
44
+ t3 = dataCtx?.data ?? [];
45
+ $[8] = dataCtx?.data;
46
+ $[9] = t3;
47
+ } else t3 = $[9];
48
+ let t4;
49
+ if ($[10] !== children || $[11] !== t3) {
50
+ t4 = /*#__PURE__*/ jsx(ComposedChart, {
51
+ data: t3,
52
+ margin: COLUMN_DEFAULT_BODY_MARGIN,
53
+ accessibilityLayer: false,
54
+ children: children
55
+ });
56
+ $[10] = children;
57
+ $[11] = t3;
58
+ $[12] = t4;
59
+ } else t4 = $[12];
60
+ let t5;
61
+ if ($[13] !== height || $[14] !== t4) {
62
+ t5 = /*#__PURE__*/ jsx(ResponsiveContainer, {
63
+ width: "100%",
64
+ height: height,
65
+ children: t4
66
+ });
67
+ $[13] = height;
68
+ $[14] = t4;
69
+ $[15] = t5;
70
+ } else t5 = $[15];
71
+ let t6;
72
+ if ($[16] !== props || $[17] !== ref || $[18] !== t2 || $[19] !== t5 || $[20] !== testId) {
73
+ t6 = /*#__PURE__*/ jsx("div", {
74
+ ...props,
75
+ ref: ref,
76
+ "data-slot": "column-chart-body",
77
+ "data-testid": testId,
78
+ "aria-hidden": "true",
79
+ className: t2,
80
+ children: t5
81
+ });
82
+ $[16] = props;
83
+ $[17] = ref;
84
+ $[18] = t2;
85
+ $[19] = t5;
86
+ $[20] = testId;
87
+ $[21] = t6;
88
+ } else t6 = $[21];
89
+ return t6;
90
+ };
91
+ ColumnChartBody.displayName = "ColumnChartBody";
92
+ export { ColumnChartBody };
@@ -0,0 +1,7 @@
1
+ import { type FC } from 'react';
2
+ /**
3
+ * The columns: every `series` entry stacked into one column per datum, in legend order with the
4
+ * first series on top. Mount once inside `<ColumnChartBody>`. Column width follows the step
5
+ * (see `resolveColumnWidth`); hovering a legend item fades the other parts out.
6
+ */
7
+ export declare const ColumnChartStack: FC;
@@ -0,0 +1,123 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useContext } from "react";
4
+ import { Bar, BarStack, usePlotArea } from "recharts";
5
+ import { useTestId } from "../../../utils/testId.js";
6
+ import { LineChartActiveContext, LineChartDataContext } from "../LineChart/LineChartContext.js";
7
+ import { CHART_PALETTE_FILL, resolveChartColor } from "../lib/chartPalette.js";
8
+ import { COLUMN_INACTIVE_OPACITY, COLUMN_PART_GAP, COLUMN_RADIUS } from "./constants.js";
9
+ import { resolveColumnWidth } from "./lib/resolveColumnWidth.js";
10
+ const ColumnChartPart = (t0)=>{
11
+ const $ = c(10);
12
+ const { x, y, width, height, value, fill, seriesKey, active, dimmed, testId } = t0;
13
+ const base = Array.isArray(value) ? Number(value[0]) : 0;
14
+ const partHeight = height - (base > 0 ? COLUMN_PART_GAP : 0);
15
+ if (!(width > 0) || !(partHeight > 0)) return null;
16
+ const t1 = dimmed ? COLUMN_INACTIVE_OPACITY : 1;
17
+ const t2 = active ? "true" : void 0;
18
+ let t3;
19
+ if ($[0] !== fill || $[1] !== partHeight || $[2] !== seriesKey || $[3] !== t1 || $[4] !== t2 || $[5] !== testId || $[6] !== width || $[7] !== x || $[8] !== y) {
20
+ t3 = /*#__PURE__*/ jsx("rect", {
21
+ x: x,
22
+ y: y,
23
+ width: width,
24
+ height: partHeight,
25
+ fill: fill,
26
+ opacity: t1,
27
+ "data-slot": "column-chart-part",
28
+ "data-testid": testId,
29
+ "data-key": seriesKey,
30
+ "data-active": t2
31
+ });
32
+ $[0] = fill;
33
+ $[1] = partHeight;
34
+ $[2] = seriesKey;
35
+ $[3] = t1;
36
+ $[4] = t2;
37
+ $[5] = testId;
38
+ $[6] = width;
39
+ $[7] = x;
40
+ $[8] = y;
41
+ $[9] = t3;
42
+ } else t3 = $[9];
43
+ return t3;
44
+ };
45
+ const ColumnChartStack = ()=>{
46
+ const $ = c(18);
47
+ const dataCtx = useContext(LineChartDataContext);
48
+ const { activeKey } = useContext(LineChartActiveContext);
49
+ const plotArea = usePlotArea();
50
+ const testId = useTestId("part");
51
+ if (!dataCtx) return null;
52
+ const steps = dataCtx.data.length;
53
+ let t0;
54
+ if ($[0] !== plotArea || $[1] !== steps) {
55
+ t0 = plotArea && steps > 0 ? resolveColumnWidth(plotArea.width / steps) : void 0;
56
+ $[0] = plotArea;
57
+ $[1] = steps;
58
+ $[2] = t0;
59
+ } else t0 = $[2];
60
+ const barSize = t0;
61
+ let T0;
62
+ let t1;
63
+ let t2;
64
+ if ($[3] !== activeKey || $[4] !== barSize || $[5] !== dataCtx.series || $[6] !== testId) {
65
+ const stacked = [
66
+ ...dataCtx.series
67
+ ].reverse();
68
+ T0 = BarStack;
69
+ t1 = COLUMN_RADIUS;
70
+ let t3;
71
+ if ($[10] !== activeKey || $[11] !== barSize || $[12] !== testId) {
72
+ t3 = (s)=>{
73
+ const active = activeKey === s.key;
74
+ const dimmed = null !== activeKey && !active;
75
+ return /*#__PURE__*/ jsx(Bar, {
76
+ dataKey: s.key,
77
+ name: s.label,
78
+ barSize: barSize,
79
+ fill: resolveChartColor(s.color) ?? CHART_PALETTE_FILL.slate,
80
+ activeBar: false,
81
+ isAnimationActive: false,
82
+ shape: (props)=>/*#__PURE__*/ jsx(ColumnChartPart, {
83
+ ...props,
84
+ seriesKey: s.key,
85
+ active: active,
86
+ dimmed: dimmed,
87
+ testId: testId
88
+ })
89
+ }, s.key);
90
+ };
91
+ $[10] = activeKey;
92
+ $[11] = barSize;
93
+ $[12] = testId;
94
+ $[13] = t3;
95
+ } else t3 = $[13];
96
+ t2 = stacked.map(t3);
97
+ $[3] = activeKey;
98
+ $[4] = barSize;
99
+ $[5] = dataCtx.series;
100
+ $[6] = testId;
101
+ $[7] = T0;
102
+ $[8] = t1;
103
+ $[9] = t2;
104
+ } else {
105
+ T0 = $[7];
106
+ t1 = $[8];
107
+ t2 = $[9];
108
+ }
109
+ let t3;
110
+ if ($[14] !== T0 || $[15] !== t1 || $[16] !== t2) {
111
+ t3 = /*#__PURE__*/ jsx(T0, {
112
+ radius: t1,
113
+ children: t2
114
+ });
115
+ $[14] = T0;
116
+ $[15] = t1;
117
+ $[16] = t2;
118
+ $[17] = t3;
119
+ } else t3 = $[17];
120
+ return t3;
121
+ };
122
+ ColumnChartStack.displayName = "ColumnChartStack";
123
+ export { ColumnChartStack };
@@ -0,0 +1,13 @@
1
+ import { type FC } from 'react';
2
+ export interface ColumnChartXAxisProps {
3
+ /** Format the rendered tick label. Receives the raw `xKey` value of the column. */
4
+ tickFormatter?: (value: unknown, index: number) => string;
5
+ /**
6
+ * Recharts tick interval. Defaults to `'preserveStartEnd'`: the first and last columns keep
7
+ * their labels and middle ones drop out when the labels would collide. `0` labels every column.
8
+ */
9
+ interval?: number | 'preserveStart' | 'preserveEnd' | 'preserveStartEnd';
10
+ /** Minimum gap (in pixels) between rendered tick labels. */
11
+ minTickGap?: number;
12
+ }
13
+ export declare const ColumnChartXAxis: FC<ColumnChartXAxisProps>;
@@ -0,0 +1,40 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c } from "react/compiler-runtime";
3
+ import { useContext } from "react";
4
+ import { XAxis } from "recharts";
5
+ import { LINE_X_LABEL_HEIGHT } from "../LineChart/constants.js";
6
+ import { LineChartDataContext } from "../LineChart/LineChartContext.js";
7
+ import { renderAxisTick } from "../LineChart/lib/renderAxisTick.js";
8
+ const AXIS_LINE_PROPS = {
9
+ stroke: "var(--color-border-primary-light)"
10
+ };
11
+ const renderTick = renderAxisTick();
12
+ const ColumnChartXAxis = (t0)=>{
13
+ const $ = c(5);
14
+ const { tickFormatter, interval: t1, minTickGap } = t0;
15
+ const interval = void 0 === t1 ? "preserveStartEnd" : t1;
16
+ const dataCtx = useContext(LineChartDataContext);
17
+ const t2 = dataCtx?.xKey;
18
+ const t3 = tickFormatter;
19
+ let t4;
20
+ if ($[0] !== interval || $[1] !== minTickGap || $[2] !== t2 || $[3] !== t3) {
21
+ t4 = /*#__PURE__*/ jsx(XAxis, {
22
+ dataKey: t2,
23
+ height: LINE_X_LABEL_HEIGHT,
24
+ tickLine: false,
25
+ axisLine: AXIS_LINE_PROPS,
26
+ tick: renderTick,
27
+ tickFormatter: t3,
28
+ interval: interval,
29
+ minTickGap: minTickGap
30
+ });
31
+ $[0] = interval;
32
+ $[1] = minTickGap;
33
+ $[2] = t2;
34
+ $[3] = t3;
35
+ $[4] = t4;
36
+ } else t4 = $[4];
37
+ return t4;
38
+ };
39
+ ColumnChartXAxis.displayName = "ColumnChartXAxis";
40
+ export { ColumnChartXAxis };
@@ -0,0 +1,2 @@
1
+ export { lineChartRootClasses as columnChartRootClasses } from '../LineChart/classes.js';
2
+ export declare const columnChartBodyClasses: string;
@@ -0,0 +1,7 @@
1
+ import { lineChartBodyClasses, lineChartRootClasses } from "../LineChart/classes.js";
2
+ const columnChartBodyClasses = [
3
+ lineChartBodyClasses,
4
+ '[&_.recharts-bar]:animate-[ds-chart-fade-in_400ms_ease-out]',
5
+ 'motion-reduce:[&_.recharts-bar]:animate-none'
6
+ ].join(' ');
7
+ export { columnChartBodyClasses, lineChartRootClasses as columnChartRootClasses };
@@ -0,0 +1,8 @@
1
+ export { LINE_CARD_HEIGHT as COLUMN_CARD_HEIGHT, LINE_DEFAULT_BODY_MARGIN as COLUMN_DEFAULT_BODY_MARGIN, LINE_HEADER_HEIGHT as COLUMN_HEADER_HEIGHT, LINE_INACTIVE_OPACITY as COLUMN_INACTIVE_OPACITY, } from '../LineChart/constants.js';
2
+ export declare const COLUMN_MAX_WIDTH = 32;
3
+ export declare const COLUMN_MIN_WIDTH = 16;
4
+ export declare const COLUMN_GAP = 22;
5
+ /** 1px gap between the parts of a column. */
6
+ export declare const COLUMN_PART_GAP = 1;
7
+ /** Top corners of the whole column (the topmost part), via recharts' `BarStack` clip-path. */
8
+ export declare const COLUMN_RADIUS: [number, number, number, number];
@@ -0,0 +1,12 @@
1
+ const COLUMN_MAX_WIDTH = 32;
2
+ const COLUMN_MIN_WIDTH = 16;
3
+ const COLUMN_GAP = 22;
4
+ const COLUMN_PART_GAP = 1;
5
+ const COLUMN_RADIUS = [
6
+ 4,
7
+ 4,
8
+ 0,
9
+ 0
10
+ ];
11
+ export { LINE_CARD_HEIGHT as COLUMN_CARD_HEIGHT, LINE_DEFAULT_BODY_MARGIN as COLUMN_DEFAULT_BODY_MARGIN, LINE_HEADER_HEIGHT as COLUMN_HEADER_HEIGHT, LINE_INACTIVE_OPACITY as COLUMN_INACTIVE_OPACITY } from "../LineChart/constants.js";
12
+ export { COLUMN_GAP, COLUMN_MAX_WIDTH, COLUMN_MIN_WIDTH, COLUMN_PART_GAP, COLUMN_RADIUS };
@@ -0,0 +1,4 @@
1
+ export { ColumnChart, type ColumnChartProps } from './ColumnChart.js';
2
+ export { ColumnChartBody, type ColumnChartBodyProps } from './ColumnChartBody.js';
3
+ export { ColumnChartStack } from './ColumnChartStack.js';
4
+ export { ColumnChartXAxis, type ColumnChartXAxisProps } from './ColumnChartXAxis.js';
@@ -0,0 +1,4 @@
1
+ export { ColumnChart } from "./ColumnChart.js";
2
+ export { ColumnChartBody } from "./ColumnChartBody.js";
3
+ export { ColumnChartStack } from "./ColumnChartStack.js";
4
+ export { ColumnChartXAxis } from "./ColumnChartXAxis.js";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Column width for a step of `band` px: the band minus the 22px gap, clamped to 16–32px and
3
+ * rounded to whole pixels so column edges stay crisp. Kept strictly under the band: recharts
4
+ * ignores a `barSize` that fills the band and draws 90% of it instead. Under 16px per step the
5
+ * columns shrink to leave 1px or less between them — Figma leaves that case open (see
6
+ * `docs/ColumnChart.md` → Open questions).
7
+ */
8
+ export declare const resolveColumnWidth: (band: number) => number;
@@ -0,0 +1,7 @@
1
+ import { COLUMN_GAP, COLUMN_MAX_WIDTH, COLUMN_MIN_WIDTH } from "../constants.js";
2
+ const resolveColumnWidth = (band)=>{
3
+ if (!(band > 1)) return 0;
4
+ const width = Math.min(COLUMN_MAX_WIDTH, Math.max(COLUMN_MIN_WIDTH, band - COLUMN_GAP));
5
+ return Math.min(Math.ceil(band - 1e-6) - 1, Math.round(width));
6
+ };
7
+ export { resolveColumnWidth };
@@ -17,13 +17,15 @@ const dropEdgeGridLines = ({ keepTop = false, keepBottom = false } = {})=>{
17
17
  let cachedYs = null;
18
18
  let cachedAxis = null;
19
19
  return (props)=>{
20
- const { offset, x1, x2, y1, y2, key, index: _index, yAxis, ...rest } = props;
20
+ const { offset, x1, x2, y1, y2, key, yAxis, stroke, strokeDasharray } = props;
21
21
  const line = asSvgElement(createElement('line', {
22
- ...rest,
23
22
  x1,
24
23
  x2,
25
24
  y1,
26
- y2
25
+ y2,
26
+ stroke,
27
+ strokeDasharray,
28
+ fill: 'none'
27
29
  }));
28
30
  if ('number' != typeof y1 || !yAxis) return line;
29
31
  if (cachedAxis !== yAxis) {
@@ -1,6 +1,7 @@
1
1
  export { AreaChart, AreaChartArea, type AreaChartAreaProps, AreaChartBody, type AreaChartBodyProps, type AreaChartProps, type AreaChartVariant, } from './AreaChart/index.js';
2
2
  export { BarList, BarListBar, type BarListBarProps, BarListItem, type BarListItemProps, BarListLabel, type BarListLabelProps, BarListPercent, type BarListPercentProps, type BarListProps, BarListSkeleton, type BarListSkeletonProps, BarListValue, type BarListValueProps, } from './BarList/index.js';
3
3
  export { Chart, ChartActions, type ChartActionsProps, ChartEmpty, type ChartEmptyProps, ChartHeader, type ChartHeaderProps, type ChartProps, ChartTitle, type ChartTitleProps, } from './Chart/index.js';
4
+ export { ColumnChart, ColumnChartBody, type ColumnChartBodyProps, type ColumnChartProps, ColumnChartStack, ColumnChartXAxis, type ColumnChartXAxisProps, } from './ColumnChart/index.js';
4
5
  export { HorizontalBarStack, type HorizontalBarStackDatum, type HorizontalBarStackProps, HorizontalBarStackSkeleton, type HorizontalBarStackSkeletonProps, } from './HorizontalBarStack/index.js';
5
6
  export { type ChartTimeFormatters, useChartTimeFormatters } from './hooks/index.js';
6
7
  export { LineChart, LineChartBody, type LineChartBodyProps, type LineChartDatum, LineChartEmpty, type LineChartEmptyProps, LineChartGrid, type LineChartGridProps, LineChartHoverPopover, LineChartHoverPopoverDot, type LineChartHoverPopoverDotProps, type LineChartHoverPopoverProps, LineChartHoverPopoverRow, type LineChartHoverPopoverRowProps, LineChartHoverPopoverTimestamp, type LineChartHoverPopoverTimestampProps, LineChartLegend, LineChartLegendItem, type LineChartLegendItemProps, type LineChartLegendOrientation, type LineChartLegendProps, LineChartLine, type LineChartLineProps, type LineChartProps, type LineChartSeries, LineChartTooltip, type LineChartTooltipProps, type LineChartTooltipRenderArgs, LineChartXAxis, type LineChartXAxisProps, LineChartYAxis, type LineChartYAxisProps, LineChartZoomBrush, type LineChartZoomBrushProps, LineChartZoomPopover, LineChartZoomPopoverConfirm, type LineChartZoomPopoverConfirmProps, type LineChartZoomPopoverProps, LineChartZoomPopoverRange, type LineChartZoomPopoverRangeProps, type LineChartZoomRange, } from './LineChart/index.js';
@@ -1,6 +1,7 @@
1
1
  export { AreaChart, AreaChartArea, AreaChartBody } from "./AreaChart/index.js";
2
2
  export { BarList, BarListBar, BarListItem, BarListLabel, BarListPercent, BarListSkeleton, BarListValue } from "./BarList/index.js";
3
3
  export { Chart, ChartActions, ChartEmpty, ChartHeader, ChartTitle } from "./Chart/index.js";
4
+ export { ColumnChart, ColumnChartBody, ColumnChartStack, ColumnChartXAxis } from "./ColumnChart/index.js";
4
5
  export { HorizontalBarStack, HorizontalBarStackSkeleton } from "./HorizontalBarStack/index.js";
5
6
  export { useChartTimeFormatters } from "./hooks/index.js";
6
7
  export { LineChart, LineChartBody, LineChartEmpty, LineChartGrid, LineChartHoverPopover, LineChartHoverPopoverDot, LineChartHoverPopoverRow, LineChartHoverPopoverTimestamp, LineChartLegend, LineChartLegendItem, LineChartLine, LineChartTooltip, LineChartXAxis, LineChartYAxis, LineChartZoomBrush, LineChartZoomPopover, LineChartZoomPopoverConfirm, LineChartZoomPopoverRange } from "./LineChart/index.js";
@@ -33,7 +33,10 @@ const ThemeProvider = (t0)=>{
33
33
  const frameStyleStorageKey = void 0 === t4 ? "wasd-frame-style" : t4;
34
34
  let t5;
35
35
  if ($[7] !== defaultTheme || $[8] !== storageKey) {
36
- t5 = ()=>localStorage.getItem(storageKey) || defaultTheme;
36
+ t5 = ()=>{
37
+ if ("u" < typeof localStorage) return defaultTheme;
38
+ return localStorage.getItem(storageKey) || defaultTheme;
39
+ };
37
40
  $[7] = defaultTheme;
38
41
  $[8] = storageKey;
39
42
  $[9] = t5;
@@ -42,6 +45,7 @@ const ThemeProvider = (t0)=>{
42
45
  let t6;
43
46
  if ($[10] !== defaultFrameStyle || $[11] !== frameStyleStorageKey) {
44
47
  t6 = ()=>{
48
+ if ("u" < typeof localStorage) return defaultFrameStyle;
45
49
  const stored = localStorage.getItem(frameStyleStorageKey);
46
50
  return "neutral" === stored || "branded" === stored ? stored : defaultFrameStyle;
47
51
  };