@refraction-ui/react 0.22.0 → 0.23.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.
- package/dist/{chunk-V24GDHUX.js → chunk-4ACSHPCM.js} +2 -2
- package/dist/{chunk-SDAJVXD4.js → chunk-5P56PN3J.js} +2 -2
- package/dist/chunk-75BKRTPO.js +417 -0
- package/dist/{chunk-2Q6HHFAN.js.map → chunk-75BKRTPO.js.map} +1 -1
- package/dist/chunk-7P7EJ56S.js +7 -0
- package/dist/{chunk-QPCKJ2YR.js → chunk-GG6MZDGV.js} +2 -2
- package/dist/{chunk-QDMLIDYN.js → chunk-GU5MI7FX.js} +2 -2
- package/dist/{chunk-3Y2T26QD.js → chunk-JZQ5ZL46.js} +6 -4
- package/dist/{chunk-3Y2T26QD.js.map → chunk-JZQ5ZL46.js.map} +2 -2
- package/dist/{chunk-RSWOLRIC.js → chunk-KIZD73DK.js} +2 -2
- package/dist/{chunk-XMFNBOPO.js → chunk-PY2TIFCT.js} +2 -2
- package/dist/{chunk-XWP763SH.js → chunk-V727VZOE.js} +4 -2
- package/dist/{chunk-XWP763SH.js.map → chunk-V727VZOE.js.map} +2 -2
- package/dist/{chunk-3I3DYDHR.js → chunk-WNLYPQOS.js} +2 -2
- package/dist/{chunk-63N4PZUJ.js → chunk-X6HEKRWE.js} +2 -2
- package/dist/{chunk-WYKPPK3W.js → chunk-XAJDSVZR.js} +2 -2
- package/dist/faro-engine-VIUXJAPH-FSARIABU.js +3 -0
- package/dist/{faro-engine-47HGRAQH-JKINJPMH.js.map → faro-engine-VIUXJAPH-FSARIABU.js.map} +1 -1
- package/dist/index.cjs +736 -274
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/internal/avatar/index.d.cts +4 -1
- package/dist/internal/avatar/index.d.ts +4 -1
- package/dist/internal/data-table/index.d.cts +48 -3
- package/dist/internal/data-table/index.d.ts +48 -3
- package/dist/internal/line-chart/index.d.ts +17 -3
- package/dist/internal/native-select/index.d.ts +21 -0
- package/dist/internal/react-avatar/index.d.cts +4 -2
- package/dist/internal/react-avatar/index.d.ts +4 -2
- package/dist/internal/react-command/index.d.cts +13 -2
- package/dist/internal/react-command/index.d.ts +13 -2
- package/dist/internal/react-data-table/index.d.cts +27 -9
- package/dist/internal/react-data-table/index.d.ts +27 -9
- package/dist/internal/react-dialog/index.d.cts +5 -0
- package/dist/internal/react-dialog/index.d.ts +5 -0
- package/dist/internal/react-dropdown-menu/index.d.cts +19 -1
- package/dist/internal/react-dropdown-menu/index.d.ts +19 -1
- package/dist/internal/react-line-chart/index.d.ts +7 -2
- package/dist/internal/react-native-select/index.d.ts +19 -0
- package/dist/internal/react-stat-grid/index.d.ts +22 -11
- package/dist/internal/react-table/index.d.ts +39 -0
- package/dist/internal/stat-grid/index.d.ts +49 -7
- package/dist/internal/table/index.d.ts +46 -0
- package/dist/react-accordion.js +1 -1
- package/dist/react-action-list.js +1 -1
- package/dist/react-ai.js +1 -1
- package/dist/react-analytics.js +16 -4
- package/dist/react-analytics.js.map +2 -2
- package/dist/react-animated-text.js +1 -1
- package/dist/react-app-shell.js +1 -1
- package/dist/react-audience-feature-card.js +1 -1
- package/dist/react-audio-room.js +1 -1
- package/dist/react-auth.js +1 -1
- package/dist/react-avatar-group.js +1 -1
- package/dist/react-avatar.js +13 -9
- package/dist/react-avatar.js.map +2 -2
- package/dist/react-badge.js +1 -1
- package/dist/react-bottom-nav.js +1 -1
- package/dist/react-brand-network-cell.js +1 -1
- package/dist/react-breadcrumbs.js +1 -1
- package/dist/react-browser-chrome-mock.js +1 -1
- package/dist/react-button.js +3 -3
- package/dist/react-calendar.js +1 -1
- package/dist/react-call-controls.js +1 -1
- package/dist/react-callout.js +1 -1
- package/dist/react-card-grid.js +1 -1
- package/dist/react-card.js +1 -1
- package/dist/react-carousel.js +1 -1
- package/dist/react-charts.js +1 -1
- package/dist/react-checkbox.js +1 -1
- package/dist/react-checklist.js +1 -1
- package/dist/react-code-block.js +1 -1
- package/dist/react-code-editor.js +1 -1
- package/dist/react-collapsible.js +1 -1
- package/dist/react-combobox.js +1 -1
- package/dist/react-command-input.js +1 -1
- package/dist/react-command.js +115 -70
- package/dist/react-command.js.map +3 -3
- package/dist/react-composer.js +3 -3
- package/dist/react-content-protection.js +1 -1
- package/dist/react-conversation.js +5 -5
- package/dist/react-cookie-consent.js +1 -1
- package/dist/react-data-table.js +125 -114
- package/dist/react-data-table.js.map +2 -2
- package/dist/react-date-picker.js +1 -1
- package/dist/react-device-frame.js +1 -1
- package/dist/react-dialog.js +33 -9
- package/dist/react-dialog.js.map +2 -2
- package/dist/react-diff-viewer.js +1 -1
- package/dist/react-dropdown-menu.js +61 -8
- package/dist/react-dropdown-menu.js.map +3 -3
- package/dist/react-editor-status-bar.js +1 -1
- package/dist/react-editor-tabs.js +1 -1
- package/dist/react-emoji-picker.js +2 -2
- package/dist/react-empty-state.js +1 -1
- package/dist/react-feedback-dialog.js +2 -2
- package/dist/react-file-tree.js +1 -1
- package/dist/react-file-upload.js +1 -1
- package/dist/react-floating-reactions.js +1 -1
- package/dist/react-flow-editor.js +2 -2
- package/dist/react-footer.js +1 -1
- package/dist/react-funnel-chart.js +1 -1
- package/dist/react-graph-view.js +2 -2
- package/dist/react-infinite-canvas.js +2 -2
- package/dist/react-inline-editor.js +1 -1
- package/dist/react-input-group.js +1 -1
- package/dist/react-input.js +2 -2
- package/dist/react-install-prompt.js +1 -1
- package/dist/react-kanban-board.js +1 -1
- package/dist/react-keyboard-shortcut.js +2 -2
- package/dist/react-language-selector.js +1 -1
- package/dist/react-line-chart.js +49 -11
- package/dist/react-line-chart.js.map +2 -2
- package/dist/react-link-card.js +1 -1
- package/dist/react-live-captions.js +1 -1
- package/dist/react-live-cursors.js +1 -1
- package/dist/react-live-transcript.js +1 -1
- package/dist/react-location-selector.js +1 -1
- package/dist/react-logger.js +3 -3
- package/dist/react-markdown-renderer.js +2 -2
- package/dist/react-marquee-strip.js +1 -1
- package/dist/react-mascot.js +1 -1
- package/dist/react-mastery-bar.js +1 -1
- package/dist/react-mini-map.js +1 -1
- package/dist/react-mobile-nav.js +1 -1
- package/dist/react-native-select.js +52 -0
- package/dist/react-native-select.js.map +7 -0
- package/dist/react-navbar.js +1 -1
- package/dist/react-numbered-steps.js +1 -1
- package/dist/react-otp-input.js +1 -1
- package/dist/react-page-header.js +1 -1
- package/dist/react-pagination.js +1 -1
- package/dist/react-password-input.js +2 -2
- package/dist/react-payment.js +1 -1
- package/dist/react-popover.js +1 -1
- package/dist/react-pre-call-lobby.js +1 -1
- package/dist/react-presence-indicator.js +1 -1
- package/dist/react-pricing-card.js +1 -1
- package/dist/react-progress-display.js +1 -1
- package/dist/react-radial-gauge.js +1 -1
- package/dist/react-radio.js +1 -1
- package/dist/react-rating-scale.js +1 -1
- package/dist/react-reaction-bar.js +1 -1
- package/dist/react-resizable-layout.js +1 -1
- package/dist/react-search-bar.js +1 -1
- package/dist/react-section-head.js +1 -1
- package/dist/react-segmented-control.js +1 -1
- package/dist/react-select.js +1 -1
- package/dist/react-separator.js +1 -1
- package/dist/react-sheet.js +1 -1
- package/dist/react-sidebar.js +1 -1
- package/dist/react-skeleton.js +1 -1
- package/dist/react-skip-to-content.js +1 -1
- package/dist/react-slide-viewer.js +1 -1
- package/dist/react-slider.js +1 -1
- package/dist/react-slot-picker.js +1 -1
- package/dist/react-social-auth-button.js +3 -3
- package/dist/react-sortable-list.js +1 -1
- package/dist/react-stat-grid.js +91 -22
- package/dist/react-stat-grid.js.map +2 -2
- package/dist/react-status-indicator.js +1 -1
- package/dist/react-steps.js +1 -1
- package/dist/react-sticky-note.js +1 -1
- package/dist/react-switch.js +1 -1
- package/dist/react-table-of-contents.js +1 -1
- package/dist/react-table.js +148 -0
- package/dist/react-table.js.map +7 -0
- package/dist/react-tabs.js +35 -6
- package/dist/react-tabs.js.map +2 -2
- package/dist/react-terminal.js +1 -1
- package/dist/react-test-results.js +1 -1
- package/dist/react-textarea.js +1 -1
- package/dist/react-thread-view.js +2 -2
- package/dist/react-timeline.js +1 -1
- package/dist/react-toast.js +1 -1
- package/dist/react-tooltip.js +1 -1
- package/dist/react-version-selector.js +1 -1
- package/dist/react-video-grid.js +2 -2
- package/dist/react-video-player.js +1 -1
- package/dist/react-video-tile.js +2 -2
- package/dist/react-voice-pill.js +1 -1
- package/dist/react-waveform.js +1 -1
- package/dist/react-wizard.js +1 -1
- package/dist/shared.js +53 -0
- package/dist/shared.js.map +7 -0
- package/package.json +3 -1
- package/dist/chunk-2Q6HHFAN.js +0 -164
- package/dist/chunk-SDZ3LROZ.js +0 -7
- package/dist/faro-engine-47HGRAQH-JKINJPMH.js +0 -3
- /package/dist/{chunk-V24GDHUX.js.map → chunk-4ACSHPCM.js.map} +0 -0
- /package/dist/{chunk-SDAJVXD4.js.map → chunk-5P56PN3J.js.map} +0 -0
- /package/dist/{chunk-SDZ3LROZ.js.map → chunk-7P7EJ56S.js.map} +0 -0
- /package/dist/{chunk-QPCKJ2YR.js.map → chunk-GG6MZDGV.js.map} +0 -0
- /package/dist/{chunk-QDMLIDYN.js.map → chunk-GU5MI7FX.js.map} +0 -0
- /package/dist/{chunk-RSWOLRIC.js.map → chunk-KIZD73DK.js.map} +0 -0
- /package/dist/{chunk-XMFNBOPO.js.map → chunk-PY2TIFCT.js.map} +0 -0
- /package/dist/{chunk-3I3DYDHR.js.map → chunk-WNLYPQOS.js.map} +0 -0
- /package/dist/{chunk-63N4PZUJ.js.map → chunk-X6HEKRWE.js.map} +0 -0
- /package/dist/{chunk-WYKPPK3W.js.map → chunk-XAJDSVZR.js.map} +0 -0
package/dist/react-line-chart.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cn
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-75BKRTPO.js";
|
|
4
4
|
|
|
5
5
|
// ../react-line-chart/dist/index.js
|
|
6
6
|
import * as React from "react";
|
|
@@ -16,11 +16,24 @@ var DEFAULT_LINE_CHART_WIDTH = 760;
|
|
|
16
16
|
var DEFAULT_LINE_CHART_HEIGHT = 230;
|
|
17
17
|
var DEFAULT_TICK_COUNT = 4;
|
|
18
18
|
var DEFAULT_HEADROOM = 1.08;
|
|
19
|
-
var
|
|
19
|
+
var MIN_LABEL_SPACING = 48;
|
|
20
20
|
var CHART_TOKEN_COUNT = 5;
|
|
21
21
|
function lineChartColor(index) {
|
|
22
22
|
return `hsl(var(--chart-${index % CHART_TOKEN_COUNT + 1}))`;
|
|
23
23
|
}
|
|
24
|
+
var NICE_STEPS = [1, 2, 5, 10];
|
|
25
|
+
function niceScale(rawMax, tickCount) {
|
|
26
|
+
const intervals = Math.max(1, Math.floor(tickCount));
|
|
27
|
+
if (!(rawMax > 0)) return { max: 1, step: 1 / intervals, ticks: Array.from({ length: intervals + 1 }, (_, i) => i / intervals) };
|
|
28
|
+
const target = rawMax / intervals;
|
|
29
|
+
const magnitude = 10 ** Math.floor(Math.log10(target));
|
|
30
|
+
const step = NICE_STEPS.map((m) => m * magnitude).find((candidate) => candidate >= target) ?? 10 * magnitude;
|
|
31
|
+
const count = Math.ceil(rawMax / step - 1e-9);
|
|
32
|
+
const decimals = Math.max(0, -Math.floor(Math.log10(step)));
|
|
33
|
+
const clean = (value) => Number(value.toFixed(decimals));
|
|
34
|
+
const ticks = Array.from({ length: count + 1 }, (_, i) => clean(i * step));
|
|
35
|
+
return { max: ticks[ticks.length - 1], step: clean(step), ticks };
|
|
36
|
+
}
|
|
24
37
|
function pathFrom(points) {
|
|
25
38
|
return points.map(([px, py], i) => (i ? "L" : "M") + px.toFixed(1) + " " + py.toFixed(1)).join(" ");
|
|
26
39
|
}
|
|
@@ -31,24 +44,22 @@ function computeLineChart(options) {
|
|
|
31
44
|
width,
|
|
32
45
|
height,
|
|
33
46
|
tickCount = DEFAULT_TICK_COUNT,
|
|
34
|
-
headroom = DEFAULT_HEADROOM
|
|
35
|
-
labelEvery = DEFAULT_LABEL_EVERY
|
|
47
|
+
headroom = DEFAULT_HEADROOM
|
|
36
48
|
} = options;
|
|
37
49
|
const padding = { ...DEFAULT_LINE_CHART_PADDING, ...options.padding };
|
|
38
50
|
const n = labels.length;
|
|
39
51
|
const values = series.flatMap((s) => s.data);
|
|
40
52
|
const peak = values.length ? Math.max(...values) : 0;
|
|
41
|
-
const
|
|
53
|
+
const scale = niceScale(peak > 0 ? peak * headroom : 0, tickCount);
|
|
54
|
+
const max = scale.max;
|
|
42
55
|
const plotW = width - padding.left - padding.right;
|
|
43
56
|
const plotTop = padding.top;
|
|
44
57
|
const plotBottom = height - padding.bottom;
|
|
45
58
|
const plotH = plotBottom - plotTop;
|
|
59
|
+
const labelEvery = options.labelEvery ?? Math.max(1, Math.ceil(n / Math.max(1, Math.floor(plotW / MIN_LABEL_SPACING))));
|
|
46
60
|
const x = (index) => padding.left + (n > 1 ? index / (n - 1) * plotW : plotW / 2);
|
|
47
61
|
const y = (value) => plotTop + (1 - value / max) * plotH;
|
|
48
|
-
const ticks =
|
|
49
|
-
const value = max / tickCount * t;
|
|
50
|
-
return { value, y: y(value) };
|
|
51
|
-
});
|
|
62
|
+
const ticks = scale.ticks.map((value) => ({ value, y: y(value) }));
|
|
52
63
|
const xLabels = labels.map((label, index) => ({ index, label, x: x(index) })).filter(({ index }) => index % labelEvery === 0 || index === n - 1);
|
|
53
64
|
const paths = series.map((s, si) => {
|
|
54
65
|
const points = s.data.map((v, i) => [x(i), y(v)]);
|
|
@@ -107,19 +118,46 @@ var defaultFormat = (value) => String(Math.round(value));
|
|
|
107
118
|
var MARKER_RADIUS = 3.5;
|
|
108
119
|
var STROKE_WIDTH = 2.2;
|
|
109
120
|
var TOOLTIP_TOP_PX = 8;
|
|
121
|
+
var useIsomorphicLayoutEffect = typeof window !== "undefined" ? React.useLayoutEffect : React.useEffect;
|
|
122
|
+
function useMeasuredWidth(ref) {
|
|
123
|
+
const [measured, setMeasured] = React.useState(null);
|
|
124
|
+
useIsomorphicLayoutEffect(() => {
|
|
125
|
+
const node = ref.current;
|
|
126
|
+
if (!node || typeof ResizeObserver === "undefined") return;
|
|
127
|
+
const apply = (w) => {
|
|
128
|
+
const rounded = Math.round(w);
|
|
129
|
+
if (rounded > 0) setMeasured((prev) => prev === rounded ? prev : rounded);
|
|
130
|
+
};
|
|
131
|
+
apply(node.getBoundingClientRect().width);
|
|
132
|
+
const observer = new ResizeObserver((entries) => apply(entries[0]?.contentRect.width ?? 0));
|
|
133
|
+
observer.observe(node);
|
|
134
|
+
return () => observer.disconnect();
|
|
135
|
+
}, [ref]);
|
|
136
|
+
return measured;
|
|
137
|
+
}
|
|
110
138
|
var LineChart = React.forwardRef(function LineChart2({
|
|
111
139
|
series,
|
|
112
140
|
labels,
|
|
113
141
|
ariaLabel,
|
|
114
142
|
height = DEFAULT_LINE_CHART_HEIGHT,
|
|
115
|
-
width = DEFAULT_LINE_CHART_WIDTH,
|
|
143
|
+
width: fallbackWidth = DEFAULT_LINE_CHART_WIDTH,
|
|
116
144
|
formatValue = defaultFormat,
|
|
117
145
|
formatTick,
|
|
118
146
|
area,
|
|
119
147
|
showLegend = true,
|
|
120
148
|
className,
|
|
121
149
|
...rest
|
|
122
|
-
},
|
|
150
|
+
}, forwardedRef) {
|
|
151
|
+
const rootRef = React.useRef(null);
|
|
152
|
+
const ref = React.useCallback(
|
|
153
|
+
(node) => {
|
|
154
|
+
rootRef.current = node;
|
|
155
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
156
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
157
|
+
},
|
|
158
|
+
[forwardedRef]
|
|
159
|
+
);
|
|
160
|
+
const width = useMeasuredWidth(rootRef) ?? fallbackWidth;
|
|
123
161
|
const [active, setActive] = React.useState(null);
|
|
124
162
|
const gradientBase = React.useId().replace(/:/g, "");
|
|
125
163
|
const geo = React.useMemo(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../line-chart/src/line-chart.ts", "../../line-chart/src/line-chart.styles.ts", "../../react-line-chart/src/line-chart.tsx"],
|
|
4
|
-
"sourcesContent": ["export interface LineChartSeries {\n /** Stable key for the series. */\n id: string\n /** Legend / tooltip name. */\n name: string\n /**\n * Any CSS colour (a token `hsl(var(--…))` or a data colour). Defaults to the\n * theme's chart palette (`--chart-1` … `--chart-5`) by series position.\n */\n color?: string\n /** One value per label, in label order. */\n data: number[]\n}\n\nexport interface LineChartPadding {\n top: number\n right: number\n bottom: number\n left: number\n}\n\nexport interface LineChartOptions {\n series: LineChartSeries[]\n labels: string[]\n /** viewBox width — the SVG scales to its container's width. */\n width: number\n /** viewBox height. */\n height: number\n padding?: Partial<LineChartPadding>\n /** Number of gridline intervals on the y-axis. */\n tickCount?: number\n /** Headroom multiplier above the largest value. */\n headroom?: number\n /** Show every n-th x label (the last label is always shown). */\n labelEvery?: number\n}\n\nexport interface LineChartTick {\n value: number\n y: number\n}\n\nexport interface LineChartXLabel {\n index: number\n label: string\n x: number\n}\n\nexport interface LineChartPath {\n id: string\n /** Resolved stroke colour. */\n color: string\n /** The stroke path. */\n line: string\n /** The line closed down to the zero baseline, for an area fill. */\n area: string\n}\n\nexport interface LineChartColumn {\n index: number\n x: number\n width: number\n}\n\nexport interface LineChartGeometry {\n width: number\n height: number\n padding: LineChartPadding\n /** Top of the shared y-scale. */\n max: number\n ticks: LineChartTick[]\n xLabels: LineChartXLabel[]\n paths: LineChartPath[]\n /** One hover/focus column per category. */\n columns: LineChartColumn[]\n x: (index: number) => number\n y: (value: number) => number\n /** Top and bottom of the plot area, for a crosshair. */\n plotTop: number\n plotBottom: number\n}\n\nexport const DEFAULT_LINE_CHART_PADDING: LineChartPadding = {\n top: 14,\n right: 14,\n bottom: 24,\n left: 40,\n}\n\nexport const DEFAULT_LINE_CHART_WIDTH = 760\nexport const DEFAULT_LINE_CHART_HEIGHT = 230\nconst DEFAULT_TICK_COUNT = 4\nconst DEFAULT_HEADROOM = 1.08\nconst DEFAULT_LABEL_EVERY = 2\n/** Number of `--chart-N` tokens the theme defines. */\nconst CHART_TOKEN_COUNT = 5\n\n/** The theme chart colour for the series at `index` (wraps around). */\nexport function lineChartColor(index: number): string {\n return `hsl(var(--chart-${(index % CHART_TOKEN_COUNT) + 1}))`\n}\n\nfunction pathFrom(points: Array<[number, number]>): string {\n return points.map(([px, py], i) => (i ? 'L' : 'M') + px.toFixed(1) + ' ' + py.toFixed(1)).join(' ')\n}\n\n/**\n * Pure geometry for a responsive multi-series line chart. Every series shares\n * ONE y-scale (zero baseline to the largest value plus headroom), so series are\n * comparable. Coordinates are in viewBox units; the SVG scales to its container.\n */\nexport function computeLineChart(options: LineChartOptions): LineChartGeometry {\n const {\n series,\n labels,\n width,\n height,\n tickCount = DEFAULT_TICK_COUNT,\n headroom = DEFAULT_HEADROOM,\n labelEvery = DEFAULT_LABEL_EVERY,\n } = options\n const padding = { ...DEFAULT_LINE_CHART_PADDING, ...options.padding }\n const n = labels.length\n const values = series.flatMap((s) => s.data)\n const peak = values.length ? Math.max(...values) : 0\n const max = peak > 0 ? peak * headroom : 1\n const plotW = width - padding.left - padding.right\n const plotTop = padding.top\n const plotBottom = height - padding.bottom\n const plotH = plotBottom - plotTop\n\n const x = (index: number) => padding.left + (n > 1 ? (index / (n - 1)) * plotW : plotW / 2)\n const y = (value: number) => plotTop + (1 - value / max) * plotH\n\n const ticks: LineChartTick[] = Array.from({ length: tickCount + 1 }, (_, t) => {\n const value = (max / tickCount) * t\n return { value, y: y(value) }\n })\n\n const xLabels: LineChartXLabel[] = labels\n .map((label, index) => ({ index, label, x: x(index) }))\n .filter(({ index }) => index % labelEvery === 0 || index === n - 1)\n\n const paths: LineChartPath[] = series.map((s, si) => {\n const points = s.data.map((v, i): [number, number] => [x(i), y(v)])\n const line = pathFrom(points)\n const first = points.length ? points[0][0] : x(0)\n const last = points.length ? points[points.length - 1][0] : x(0)\n const base = y(0).toFixed(1)\n const area = `${line} L ${last.toFixed(1)} ${base} L ${first.toFixed(1)} ${base} Z`\n return { id: s.id, color: s.color ?? lineChartColor(si), line, area }\n })\n\n const colW = n > 1 ? plotW / (n - 1) : plotW\n const columns: LineChartColumn[] = labels.map((_, index) => ({\n index,\n x: x(index) - colW / 2,\n width: colW,\n }))\n\n return { width, height, padding, max, ticks, xLabels, paths, columns, x, y, plotTop, plotBottom }\n}\n\n/** Where a tooltip for `index` sits horizontally, as a percent of the chart width. */\nexport function tooltipLeftPercent(geometry: LineChartGeometry, index: number): number {\n return (geometry.x(index) / geometry.width) * 100\n}\n\n/**\n * The category index a keyboard key moves to from `current` (null = nothing\n * active yet). Returns `current` unchanged for keys the chart doesn't handle.\n */\nexport function nextLineChartIndex(current: number | null, key: string, count: number): number | null {\n if (count === 0) return null\n const last = count - 1\n switch (key) {\n case 'ArrowRight':\n return current == null ? 0 : Math.min(current + 1, last)\n case 'ArrowLeft':\n return current == null ? last : Math.max(current - 1, 0)\n case 'Home':\n return 0\n case 'End':\n return last\n default:\n return current\n }\n}\n", "/** Token-class styles for LineChart; no colour literals. */\nexport const lineChartClasses = {\n root: 'relative',\n svg: 'block w-full rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n gridline: 'stroke-border',\n axis: 'fill-muted-foreground text-[9px]',\n crosshair: 'stroke-border',\n marker: 'stroke-card',\n tooltip:\n 'pointer-events-none absolute z-10 -translate-x-1/2 whitespace-nowrap rounded-md bg-tertiary px-2.5 py-2 text-[11px] text-tertiary-foreground shadow-lg',\n tooltipLabel: 'mb-1 opacity-60',\n tooltipRow: 'flex justify-between gap-2',\n legend: 'mt-2.5 flex flex-wrap gap-3.5',\n legendItem: 'inline-flex items-center gap-1.5 text-[11px] text-muted-foreground',\n legendSwatch: 'h-[3px] w-2.5 rounded-sm',\n} as const\n", "import * as React from 'react'\nimport {\n computeLineChart,\n lineChartClasses as c,\n nextLineChartIndex,\n tooltipLeftPercent,\n DEFAULT_LINE_CHART_WIDTH,\n DEFAULT_LINE_CHART_HEIGHT,\n type LineChartSeries,\n} from '@refraction-ui/line-chart'\nimport { cn } from '@refraction-ui/shared'\n\nexport type { LineChartSeries }\n\nexport interface LineChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n /** The series to plot, all on one shared y-scale. */\n series: LineChartSeries[]\n /** One category label per data point. */\n labels: string[]\n /** Accessible name of the chart image (required). */\n ariaLabel: string\n /** Rendered height in px (also the viewBox height). Defaults to 230. */\n height?: number\n /** viewBox width; the chart always stretches to its container. Defaults to 760. */\n width?: number\n /** Formats a value in the tooltip. */\n formatValue?: (value: number) => string\n /** Formats a y-axis tick. Defaults to `formatValue`. */\n formatTick?: (value: number) => string\n /** Fill the area under each line. Defaults to on for a single series only. */\n area?: boolean\n /** Show the series legend under the chart. Defaults to true. */\n showLegend?: boolean\n}\n\nconst defaultFormat = (value: number) => String(Math.round(value))\nconst MARKER_RADIUS = 3.5\nconst STROKE_WIDTH = 2.2\nconst TOOLTIP_TOP_PX = 8\n\n/**\n * LineChart — a responsive multi-series line chart on one shared y-scale, with\n * gridlines, category x-labels, a hover/keyboard crosshair + tooltip and a\n * legend. The SVG uses a viewBox, so it stretches to its container's width.\n * Keyboard: focus the chart, then ←/→/Home/End move between categories.\n */\nexport const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(function LineChart(\n {\n series,\n labels,\n ariaLabel,\n height = DEFAULT_LINE_CHART_HEIGHT,\n width = DEFAULT_LINE_CHART_WIDTH,\n formatValue = defaultFormat,\n formatTick,\n area,\n showLegend = true,\n className,\n ...rest\n },\n ref,\n) {\n const [active, setActive] = React.useState<number | null>(null)\n const gradientBase = React.useId().replace(/:/g, '')\n const geo = React.useMemo(\n () => computeLineChart({ series, labels, width, height }),\n [series, labels, width, height],\n )\n const fillArea = area ?? series.length === 1\n const tick = formatTick ?? formatValue\n\n const handleKeyDown = (event: React.KeyboardEvent<SVGSVGElement>) => {\n const next = nextLineChartIndex(active, event.key, labels.length)\n if (next === active) return\n event.preventDefault()\n setActive(next)\n }\n\n return (\n <div ref={ref} className={cn(c.root, className)} data-slot=\"line-chart\" {...rest}>\n <svg\n className={c.svg}\n viewBox={`0 0 ${width} ${height}`}\n style={{ height }}\n role=\"img\"\n aria-label={ariaLabel}\n tabIndex={0}\n onKeyDown={handleKeyDown}\n onBlur={() => setActive(null)}\n onMouseLeave={() => setActive(null)}\n >\n {geo.ticks.map((t, i) => (\n <g key={i}>\n <line className={c.gridline} x1={geo.padding.left} y1={t.y} x2={width - geo.padding.right} y2={t.y} />\n <text className={c.axis} x={geo.padding.left - 8} y={t.y + 3} textAnchor=\"end\">\n {tick(t.value)}\n </text>\n </g>\n ))}\n {geo.xLabels.map((l) => (\n <text key={l.index} className={c.axis} x={l.x} y={height - 6} textAnchor=\"middle\">\n {l.label}\n </text>\n ))}\n {geo.paths.map((p, si) => {\n const gid = `${gradientBase}-${si}`\n const value = active != null ? series[si].data[active] : undefined\n return (\n <g key={p.id}>\n {fillArea && (\n <>\n <defs>\n <linearGradient id={gid} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor={p.color} stopOpacity=\"0.22\" />\n <stop offset=\"100%\" stopColor={p.color} stopOpacity=\"0\" />\n </linearGradient>\n </defs>\n <path d={p.area} fill={`url(#${gid})`} />\n </>\n )}\n <path\n d={p.line}\n fill=\"none\"\n stroke={p.color}\n strokeWidth={STROKE_WIDTH}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n {active != null && value != null && (\n <circle\n className={c.marker}\n cx={geo.x(active)}\n cy={geo.y(value)}\n r={MARKER_RADIUS}\n fill={p.color}\n strokeWidth=\"1.5\"\n />\n )}\n </g>\n )\n })}\n {active != null && (\n <line\n className={c.crosshair}\n x1={geo.x(active)}\n y1={geo.plotTop}\n x2={geo.x(active)}\n y2={geo.plotBottom}\n strokeDasharray=\"3 3\"\n />\n )}\n {geo.columns.map((col) => (\n <rect\n key={col.index}\n data-index={col.index}\n x={col.x}\n y={0}\n width={col.width}\n height={height}\n fill=\"transparent\"\n onMouseEnter={() => setActive(col.index)}\n />\n ))}\n </svg>\n {active != null && (\n <div\n className={c.tooltip}\n role=\"status\"\n style={{ left: `${tooltipLeftPercent(geo, active)}%`, top: TOOLTIP_TOP_PX }}\n >\n <div className={c.tooltipLabel}>{labels[active]}</div>\n {series.map((s, si) => (\n <div key={s.id} className={c.tooltipRow}>\n <span style={{ color: geo.paths[si].color }}>{s.name}</span>\n <b>{s.data[active] != null ? formatValue(s.data[active]) : '—'}</b>\n </div>\n ))}\n </div>\n )}\n {showLegend && (\n <div className={c.legend}>\n {series.map((s, si) => (\n <span key={s.id} className={c.legendItem}>\n <i className={c.legendSwatch} style={{ background: geo.paths[si].color }} aria-hidden=\"true\" />\n {s.name}\n </span>\n ))}\n </div>\n )}\n </div>\n )\n})\n"],
|
|
5
|
-
"mappings": ";;;;;;;;
|
|
4
|
+
"sourcesContent": ["export interface LineChartSeries {\n /** Stable key for the series. */\n id: string\n /** Legend / tooltip name. */\n name: string\n /**\n * Any CSS colour (a token `hsl(var(--…))` or a data colour). Defaults to the\n * theme's chart palette (`--chart-1` … `--chart-5`) by series position.\n */\n color?: string\n /** One value per label, in label order. */\n data: number[]\n}\n\nexport interface LineChartPadding {\n top: number\n right: number\n bottom: number\n left: number\n}\n\nexport interface LineChartOptions {\n series: LineChartSeries[]\n labels: string[]\n /** viewBox width — the SVG scales to its container's width. */\n width: number\n /** viewBox height. */\n height: number\n padding?: Partial<LineChartPadding>\n /** Target number of gridline intervals on the y-axis (the nice scale may use fewer). */\n tickCount?: number\n /** Headroom multiplier above the largest value. */\n headroom?: number\n /**\n * Show every n-th x label (the last label is always shown). Defaults to\n * thinning so labels are at least ~48 viewBox units apart.\n */\n labelEvery?: number\n}\n\nexport interface LineChartTick {\n value: number\n y: number\n}\n\nexport interface LineChartXLabel {\n index: number\n label: string\n x: number\n}\n\nexport interface LineChartPath {\n id: string\n /** Resolved stroke colour. */\n color: string\n /** The stroke path. */\n line: string\n /** The line closed down to the zero baseline, for an area fill. */\n area: string\n}\n\nexport interface LineChartColumn {\n index: number\n x: number\n width: number\n}\n\nexport interface LineChartGeometry {\n width: number\n height: number\n padding: LineChartPadding\n /** Top of the shared y-scale. */\n max: number\n ticks: LineChartTick[]\n xLabels: LineChartXLabel[]\n paths: LineChartPath[]\n /** One hover/focus column per category. */\n columns: LineChartColumn[]\n x: (index: number) => number\n y: (value: number) => number\n /** Top and bottom of the plot area, for a crosshair. */\n plotTop: number\n plotBottom: number\n}\n\nexport const DEFAULT_LINE_CHART_PADDING: LineChartPadding = {\n top: 14,\n right: 14,\n bottom: 24,\n left: 40,\n}\n\nexport const DEFAULT_LINE_CHART_WIDTH = 760\nexport const DEFAULT_LINE_CHART_HEIGHT = 230\nconst DEFAULT_TICK_COUNT = 4\nconst DEFAULT_HEADROOM = 1.08\n/** Minimum horizontal room per x label when thinning automatically. */\nconst MIN_LABEL_SPACING = 48\n/** Number of `--chart-N` tokens the theme defines. */\nconst CHART_TOKEN_COUNT = 5\n\n/** The theme chart colour for the series at `index` (wraps around). */\nexport function lineChartColor(index: number): string {\n return `hsl(var(--chart-${(index % CHART_TOKEN_COUNT) + 1}))`\n}\n\nconst NICE_STEPS = [1, 2, 5, 10]\n\n/**\n * A \"nice\" y-scale: a 1-2-5 × 10^k step so there are at most `tickCount`\n * intervals up to `rawMax`, and the max rounded up to a whole step. Tick\n * values are therefore round numbers by construction (0, 2000, 4000, …) —\n * never 5999.9999 — so any tick formatter prints clean labels.\n */\nexport function niceScale(rawMax: number, tickCount: number): { max: number; step: number; ticks: number[] } {\n const intervals = Math.max(1, Math.floor(tickCount))\n if (!(rawMax > 0)) return { max: 1, step: 1 / intervals, ticks: Array.from({ length: intervals + 1 }, (_, i) => i / intervals) }\n const target = rawMax / intervals\n const magnitude = 10 ** Math.floor(Math.log10(target))\n const step = NICE_STEPS.map((m) => m * magnitude).find((candidate) => candidate >= target) ?? 10 * magnitude\n const count = Math.ceil(rawMax / step - 1e-9)\n // Strip binary floating-point noise (e.g. 0.1 * 3) to the step's precision.\n const decimals = Math.max(0, -Math.floor(Math.log10(step)))\n const clean = (value: number) => Number(value.toFixed(decimals))\n const ticks = Array.from({ length: count + 1 }, (_, i) => clean(i * step))\n return { max: ticks[ticks.length - 1], step: clean(step), ticks }\n}\n\nfunction pathFrom(points: Array<[number, number]>): string {\n return points.map(([px, py], i) => (i ? 'L' : 'M') + px.toFixed(1) + ' ' + py.toFixed(1)).join(' ')\n}\n\n/**\n * Pure geometry for a responsive multi-series line chart. Every series shares\n * ONE y-scale (zero baseline to the largest value plus headroom), so series are\n * comparable. Coordinates are in viewBox units; the SVG scales to its container.\n */\nexport function computeLineChart(options: LineChartOptions): LineChartGeometry {\n const {\n series,\n labels,\n width,\n height,\n tickCount = DEFAULT_TICK_COUNT,\n headroom = DEFAULT_HEADROOM,\n } = options\n const padding = { ...DEFAULT_LINE_CHART_PADDING, ...options.padding }\n const n = labels.length\n const values = series.flatMap((s) => s.data)\n const peak = values.length ? Math.max(...values) : 0\n const scale = niceScale(peak > 0 ? peak * headroom : 0, tickCount)\n const max = scale.max\n const plotW = width - padding.left - padding.right\n const plotTop = padding.top\n const plotBottom = height - padding.bottom\n const plotH = plotBottom - plotTop\n\n const labelEvery =\n options.labelEvery ??\n Math.max(1, Math.ceil(n / Math.max(1, Math.floor(plotW / MIN_LABEL_SPACING))))\n\n const x = (index: number) => padding.left + (n > 1 ? (index / (n - 1)) * plotW : plotW / 2)\n const y = (value: number) => plotTop + (1 - value / max) * plotH\n\n const ticks: LineChartTick[] = scale.ticks.map((value) => ({ value, y: y(value) }))\n\n const xLabels: LineChartXLabel[] = labels\n .map((label, index) => ({ index, label, x: x(index) }))\n .filter(({ index }) => index % labelEvery === 0 || index === n - 1)\n\n const paths: LineChartPath[] = series.map((s, si) => {\n const points = s.data.map((v, i): [number, number] => [x(i), y(v)])\n const line = pathFrom(points)\n const first = points.length ? points[0][0] : x(0)\n const last = points.length ? points[points.length - 1][0] : x(0)\n const base = y(0).toFixed(1)\n const area = `${line} L ${last.toFixed(1)} ${base} L ${first.toFixed(1)} ${base} Z`\n return { id: s.id, color: s.color ?? lineChartColor(si), line, area }\n })\n\n const colW = n > 1 ? plotW / (n - 1) : plotW\n const columns: LineChartColumn[] = labels.map((_, index) => ({\n index,\n x: x(index) - colW / 2,\n width: colW,\n }))\n\n return { width, height, padding, max, ticks, xLabels, paths, columns, x, y, plotTop, plotBottom }\n}\n\n/** Where a tooltip for `index` sits horizontally, as a percent of the chart width. */\nexport function tooltipLeftPercent(geometry: LineChartGeometry, index: number): number {\n return (geometry.x(index) / geometry.width) * 100\n}\n\n/**\n * The category index a keyboard key moves to from `current` (null = nothing\n * active yet). Returns `current` unchanged for keys the chart doesn't handle.\n */\nexport function nextLineChartIndex(current: number | null, key: string, count: number): number | null {\n if (count === 0) return null\n const last = count - 1\n switch (key) {\n case 'ArrowRight':\n return current == null ? 0 : Math.min(current + 1, last)\n case 'ArrowLeft':\n return current == null ? last : Math.max(current - 1, 0)\n case 'Home':\n return 0\n case 'End':\n return last\n default:\n return current\n }\n}\n", "/** Token-class styles for LineChart; no colour literals. */\nexport const lineChartClasses = {\n root: 'relative',\n svg: 'block w-full rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring',\n gridline: 'stroke-border',\n axis: 'fill-muted-foreground text-[9px]',\n crosshair: 'stroke-border',\n marker: 'stroke-card',\n tooltip:\n 'pointer-events-none absolute z-10 -translate-x-1/2 whitespace-nowrap rounded-md bg-tertiary px-2.5 py-2 text-[11px] text-tertiary-foreground shadow-lg',\n tooltipLabel: 'mb-1 opacity-60',\n tooltipRow: 'flex justify-between gap-2',\n legend: 'mt-2.5 flex flex-wrap gap-3.5',\n legendItem: 'inline-flex items-center gap-1.5 text-[11px] text-muted-foreground',\n legendSwatch: 'h-[3px] w-2.5 rounded-sm',\n} as const\n", "import * as React from 'react'\nimport {\n computeLineChart,\n lineChartClasses as c,\n nextLineChartIndex,\n tooltipLeftPercent,\n DEFAULT_LINE_CHART_WIDTH,\n DEFAULT_LINE_CHART_HEIGHT,\n type LineChartSeries,\n} from '@refraction-ui/line-chart'\nimport { cn } from '@refraction-ui/shared'\n\nexport type { LineChartSeries }\n\nexport interface LineChartProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {\n /** The series to plot, all on one shared y-scale. */\n series: LineChartSeries[]\n /** One category label per data point. */\n labels: string[]\n /** Accessible name of the chart image (required). */\n ariaLabel: string\n /** Rendered height in px (also the viewBox height). Defaults to 230. */\n height?: number\n /**\n * Fallback width, used for the server render and before the container is\n * measured. On the client the chart measures its container and draws at that\n * width, so text and strokes stay at their authored size. Defaults to 760.\n */\n width?: number\n /** Formats a value in the tooltip. */\n formatValue?: (value: number) => string\n /** Formats a y-axis tick. Defaults to `formatValue`. */\n formatTick?: (value: number) => string\n /** Fill the area under each line. Defaults to on for a single series only. */\n area?: boolean\n /** Show the series legend under the chart. Defaults to true. */\n showLegend?: boolean\n}\n\nconst defaultFormat = (value: number) => String(Math.round(value))\nconst MARKER_RADIUS = 3.5\nconst STROKE_WIDTH = 2.2\nconst TOOLTIP_TOP_PX = 8\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect\n\n/**\n * Width of `ref`'s element in CSS px, tracked with a ResizeObserver; `null`\n * until measured (server render, or no ResizeObserver).\n */\nfunction useMeasuredWidth(ref: React.RefObject<HTMLElement | null>): number | null {\n const [measured, setMeasured] = React.useState<number | null>(null)\n useIsomorphicLayoutEffect(() => {\n const node = ref.current\n if (!node || typeof ResizeObserver === 'undefined') return\n const apply = (w: number) => {\n const rounded = Math.round(w)\n if (rounded > 0) setMeasured((prev) => (prev === rounded ? prev : rounded))\n }\n apply(node.getBoundingClientRect().width)\n const observer = new ResizeObserver((entries) => apply(entries[0]?.contentRect.width ?? 0))\n observer.observe(node)\n return () => observer.disconnect()\n }, [ref])\n return measured\n}\n\n/**\n * LineChart — a responsive multi-series line chart on one shared y-scale, with\n * gridlines, category x-labels, a hover/keyboard crosshair + tooltip and a\n * legend. It measures its container and draws at that width (1:1 viewBox), so\n * axis text keeps its authored size in narrow panels.\n * Keyboard: focus the chart, then ←/→/Home/End move between categories.\n */\nexport const LineChart = React.forwardRef<HTMLDivElement, LineChartProps>(function LineChart(\n {\n series,\n labels,\n ariaLabel,\n height = DEFAULT_LINE_CHART_HEIGHT,\n width: fallbackWidth = DEFAULT_LINE_CHART_WIDTH,\n formatValue = defaultFormat,\n formatTick,\n area,\n showLegend = true,\n className,\n ...rest\n },\n forwardedRef,\n) {\n const rootRef = React.useRef<HTMLDivElement | null>(null)\n const ref = React.useCallback(\n (node: HTMLDivElement | null) => {\n rootRef.current = node\n if (typeof forwardedRef === 'function') forwardedRef(node)\n else if (forwardedRef) forwardedRef.current = node\n },\n [forwardedRef],\n )\n // Draw at the container's real width: a fixed viewBox stretched to a narrow\n // panel would shrink the axis text and the chart height with it.\n const width = useMeasuredWidth(rootRef) ?? fallbackWidth\n const [active, setActive] = React.useState<number | null>(null)\n const gradientBase = React.useId().replace(/:/g, '')\n const geo = React.useMemo(\n () => computeLineChart({ series, labels, width, height }),\n [series, labels, width, height],\n )\n const fillArea = area ?? series.length === 1\n const tick = formatTick ?? formatValue\n\n const handleKeyDown = (event: React.KeyboardEvent<SVGSVGElement>) => {\n const next = nextLineChartIndex(active, event.key, labels.length)\n if (next === active) return\n event.preventDefault()\n setActive(next)\n }\n\n return (\n <div ref={ref} className={cn(c.root, className)} data-slot=\"line-chart\" {...rest}>\n <svg\n className={c.svg}\n viewBox={`0 0 ${width} ${height}`}\n style={{ height }}\n role=\"img\"\n aria-label={ariaLabel}\n tabIndex={0}\n onKeyDown={handleKeyDown}\n onBlur={() => setActive(null)}\n onMouseLeave={() => setActive(null)}\n >\n {geo.ticks.map((t, i) => (\n <g key={i}>\n <line className={c.gridline} x1={geo.padding.left} y1={t.y} x2={width - geo.padding.right} y2={t.y} />\n <text className={c.axis} x={geo.padding.left - 8} y={t.y + 3} textAnchor=\"end\">\n {tick(t.value)}\n </text>\n </g>\n ))}\n {geo.xLabels.map((l) => (\n <text key={l.index} className={c.axis} x={l.x} y={height - 6} textAnchor=\"middle\">\n {l.label}\n </text>\n ))}\n {geo.paths.map((p, si) => {\n const gid = `${gradientBase}-${si}`\n const value = active != null ? series[si].data[active] : undefined\n return (\n <g key={p.id}>\n {fillArea && (\n <>\n <defs>\n <linearGradient id={gid} x1=\"0\" y1=\"0\" x2=\"0\" y2=\"1\">\n <stop offset=\"0%\" stopColor={p.color} stopOpacity=\"0.22\" />\n <stop offset=\"100%\" stopColor={p.color} stopOpacity=\"0\" />\n </linearGradient>\n </defs>\n <path d={p.area} fill={`url(#${gid})`} />\n </>\n )}\n <path\n d={p.line}\n fill=\"none\"\n stroke={p.color}\n strokeWidth={STROKE_WIDTH}\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n {active != null && value != null && (\n <circle\n className={c.marker}\n cx={geo.x(active)}\n cy={geo.y(value)}\n r={MARKER_RADIUS}\n fill={p.color}\n strokeWidth=\"1.5\"\n />\n )}\n </g>\n )\n })}\n {active != null && (\n <line\n className={c.crosshair}\n x1={geo.x(active)}\n y1={geo.plotTop}\n x2={geo.x(active)}\n y2={geo.plotBottom}\n strokeDasharray=\"3 3\"\n />\n )}\n {geo.columns.map((col) => (\n <rect\n key={col.index}\n data-index={col.index}\n x={col.x}\n y={0}\n width={col.width}\n height={height}\n fill=\"transparent\"\n onMouseEnter={() => setActive(col.index)}\n />\n ))}\n </svg>\n {active != null && (\n <div\n className={c.tooltip}\n role=\"status\"\n style={{ left: `${tooltipLeftPercent(geo, active)}%`, top: TOOLTIP_TOP_PX }}\n >\n <div className={c.tooltipLabel}>{labels[active]}</div>\n {series.map((s, si) => (\n <div key={s.id} className={c.tooltipRow}>\n <span style={{ color: geo.paths[si].color }}>{s.name}</span>\n <b>{s.data[active] != null ? formatValue(s.data[active]) : '—'}</b>\n </div>\n ))}\n </div>\n )}\n {showLegend && (\n <div className={c.legend}>\n {series.map((s, si) => (\n <span key={s.id} className={c.legendItem}>\n <i className={c.legendSwatch} style={{ background: geo.paths[si].color }} aria-hidden=\"true\" />\n {s.name}\n </span>\n ))}\n </div>\n )}\n </div>\n )\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAqFO,IAAM,6BAA+C;EAC1D,KAAK;EACL,OAAO;EACP,QAAQ;EACR,MAAM;AACR;AAEO,IAAM,2BAA2B;AACjC,IAAM,4BAA4B;AACzC,IAAM,qBAAqB;AAC3B,IAAM,mBAAmB;AAEzB,IAAM,oBAAoB;AAE1B,IAAM,oBAAoB;AAGnB,SAAS,eAAe,OAAuB;AACpD,SAAO,mBAAoB,QAAQ,oBAAqB,CAAC;AAC3D;AAEA,IAAM,aAAa,CAAC,GAAG,GAAG,GAAG,EAAE;AAQxB,SAAS,UAAU,QAAgB,WAAmE;AAC3G,QAAM,YAAY,KAAK,IAAI,GAAG,KAAK,MAAM,SAAS,CAAC;AACnD,MAAI,EAAE,SAAS,GAAI,QAAO,EAAE,KAAK,GAAG,MAAM,IAAI,WAAW,OAAO,MAAM,KAAK,EAAE,QAAQ,YAAY,EAAA,GAAK,CAAC,GAAG,MAAM,IAAI,SAAS,EAAA;AAC7H,QAAM,SAAS,SAAS;AACxB,QAAM,YAAY,MAAM,KAAK,MAAM,KAAK,MAAM,MAAM,CAAC;AACrD,QAAM,OAAO,WAAW,IAAI,CAAC,MAAM,IAAI,SAAS,EAAE,KAAK,CAAC,cAAc,aAAa,MAAM,KAAK,KAAK;AACnG,QAAM,QAAQ,KAAK,KAAK,SAAS,OAAO,IAAI;AAE5C,QAAM,WAAW,KAAK,IAAI,GAAG,CAAC,KAAK,MAAM,KAAK,MAAM,IAAI,CAAC,CAAC;AAC1D,QAAM,QAAQ,CAAC,UAAkB,OAAO,MAAM,QAAQ,QAAQ,CAAC;AAC/D,QAAM,QAAQ,MAAM,KAAK,EAAE,QAAQ,QAAQ,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,MAAA,GAAS,eAAY,OAAA,CAAO;MAC5F,EAAE;IAAA,EAAA,GAFM,EAAE,EAGb,CACD,EAAA,CACH;EAAA,EAAA,CAEJ;AAEJ,CAAC;",
|
|
6
6
|
"names": ["LineChart", "c"]
|
|
7
7
|
}
|
package/dist/react-link-card.js
CHANGED
package/dist/react-logger.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createFaroSink
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-V727VZOE.js";
|
|
4
4
|
import {
|
|
5
5
|
devWarn
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-75BKRTPO.js";
|
|
7
7
|
|
|
8
8
|
// ../react-logger/dist/index.js
|
|
9
9
|
import * as React from "react";
|
|
@@ -159,7 +159,7 @@ function createTelemetry(config) {
|
|
|
159
159
|
addSinkInternal(createConsoleSink({ pretty: preset.pretty }));
|
|
160
160
|
if (config.endpoint) {
|
|
161
161
|
const endpoint = config.endpoint;
|
|
162
|
-
void import("./chunk-
|
|
162
|
+
void import("./chunk-7P7EJ56S.js").then(({ createFaroSink: createFaroSink2 }) => createFaroSink2({ app: config.app, endpoint })).then((faro) => {
|
|
163
163
|
if (faro) addSinkInternal(faro);
|
|
164
164
|
}).catch(() => {
|
|
165
165
|
});
|
package/dist/react-mascot.js
CHANGED
package/dist/react-mini-map.js
CHANGED
package/dist/react-mobile-nav.js
CHANGED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {
|
|
2
|
+
cn,
|
|
3
|
+
cva
|
|
4
|
+
} from "./chunk-75BKRTPO.js";
|
|
5
|
+
|
|
6
|
+
// ../react-native-select/dist/index.js
|
|
7
|
+
import * as React from "react";
|
|
8
|
+
|
|
9
|
+
// ../native-select/dist/index.js
|
|
10
|
+
var nativeSelectChevronPath = "m6 9 6 6 6-6";
|
|
11
|
+
var nativeSelectWrapperClass = "relative inline-flex min-w-0 items-center";
|
|
12
|
+
var nativeSelectVariants = cva({
|
|
13
|
+
base: "w-full cursor-pointer appearance-none rounded-md border border-input bg-background text-foreground shadow-sm ring-offset-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
|
|
14
|
+
variants: {
|
|
15
|
+
size: {
|
|
16
|
+
sm: "h-8 pl-2.5 pr-8 text-xs",
|
|
17
|
+
default: "h-9 pl-3 pr-9 text-sm",
|
|
18
|
+
lg: "h-10 pl-3 pr-10 text-base"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
defaultVariants: {
|
|
22
|
+
size: "default"
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
var nativeSelectIconClass = "pointer-events-none absolute right-2.5 h-4 w-4 shrink-0 text-muted-foreground";
|
|
26
|
+
|
|
27
|
+
// ../react-native-select/dist/index.js
|
|
28
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
29
|
+
var NativeSelect = React.forwardRef(function NativeSelect2({ size = "default", className, containerClassName, children, ...props }, ref) {
|
|
30
|
+
return /* @__PURE__ */ jsxs("span", { className: cn(nativeSelectWrapperClass, containerClassName), "data-slot": "native-select", children: [
|
|
31
|
+
/* @__PURE__ */ jsx("select", { ref, className: cn(nativeSelectVariants({ size }), className), ...props, children }),
|
|
32
|
+
/* @__PURE__ */ jsx(
|
|
33
|
+
"svg",
|
|
34
|
+
{
|
|
35
|
+
className: nativeSelectIconClass,
|
|
36
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
37
|
+
viewBox: "0 0 24 24",
|
|
38
|
+
fill: "none",
|
|
39
|
+
stroke: "currentColor",
|
|
40
|
+
strokeWidth: "2",
|
|
41
|
+
strokeLinecap: "round",
|
|
42
|
+
strokeLinejoin: "round",
|
|
43
|
+
"aria-hidden": "true",
|
|
44
|
+
children: /* @__PURE__ */ jsx("path", { d: nativeSelectChevronPath })
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
] });
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
NativeSelect
|
|
51
|
+
};
|
|
52
|
+
//# sourceMappingURL=react-native-select.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../native-select/src/native-select.ts", "../../native-select/src/native-select.styles.ts", "../../react-native-select/src/native-select.tsx"],
|
|
4
|
+
"sourcesContent": ["/** Visual size of a NativeSelect. */\nexport type NativeSelectSize = 'sm' | 'default' | 'lg'\n\n/** The chevron's path (a down chevron), so adapters ship no icon dependency. */\nexport const nativeSelectChevronPath = 'm6 9 6 6 6-6'\n", "import { cva } from '@refraction-ui/shared'\n\n/** Wrapper that positions the chevron over the select. */\nexport const nativeSelectWrapperClass = 'relative inline-flex min-w-0 items-center'\n\n/**\n * The `<select>`: the platform's own listbox (mobile pickers, type-to-select,\n * form submission, `change` events) with the input look. Size-owned utilities\n * live only in the size variants so `size` always wins.\n */\nexport const nativeSelectVariants = cva({\n base:\n 'w-full cursor-pointer appearance-none rounded-md border border-input bg-background text-foreground shadow-sm ' +\n 'ring-offset-background focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring ' +\n 'disabled:cursor-not-allowed disabled:opacity-50',\n variants: {\n size: {\n sm: 'h-8 pl-2.5 pr-8 text-xs',\n default: 'h-9 pl-3 pr-9 text-sm',\n lg: 'h-10 pl-3 pr-10 text-base',\n },\n },\n defaultVariants: {\n size: 'default',\n },\n})\n\n/** The chevron: decorative, and never eats the click meant for the select. */\nexport const nativeSelectIconClass =\n 'pointer-events-none absolute right-2.5 h-4 w-4 shrink-0 text-muted-foreground'\n", "import * as React from 'react'\nimport {\n nativeSelectChevronPath,\n nativeSelectIconClass,\n nativeSelectVariants,\n nativeSelectWrapperClass,\n type NativeSelectSize,\n} from '@refraction-ui/native-select'\nimport { cn } from '@refraction-ui/shared'\n\nexport type { NativeSelectSize }\n\nexport interface NativeSelectProps extends Omit<React.SelectHTMLAttributes<HTMLSelectElement>, 'size'> {\n /** Visual size; shadows the native `size` (visible rows), which a dropdown never wants. */\n size?: NativeSelectSize\n /** Classes for the positioning wrapper (width, margins); `className` styles the select. */\n containerClassName?: string\n}\n\n/**\n * NativeSelect — a native `<select>` with the input look and a chevron.\n * Children are ordinary `<option>`/`<optgroup>` elements; every native\n * attribute and event passes through, and the ref is the select itself. Use it\n * for forms and filter bars; use `Select` for a custom listbox.\n */\nexport const NativeSelect = React.forwardRef<HTMLSelectElement, NativeSelectProps>(function NativeSelect(\n { size = 'default', className, containerClassName, children, ...props },\n ref,\n) {\n return (\n <span className={cn(nativeSelectWrapperClass, containerClassName)} data-slot=\"native-select\">\n <select ref={ref} className={cn(nativeSelectVariants({ size }), className)} {...props}>\n {children}\n </select>\n <svg\n className={nativeSelectIconClass}\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"2\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n aria-hidden=\"true\"\n >\n <path d={nativeSelectChevronPath} />\n </svg>\n </span>\n )\n})\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIO,IAAM,0BAA0B;ACDhC,IAAM,2BAA2B;AAOjC,IAAM,uBAAuB,IAAI;EACtC,MACE;EAGF,UAAU;IACR,MAAM;MACJ,IAAI;MACJ,SAAS;MACT,IAAI;IAAA;EACN;EAEF,iBAAiB;IACf,MAAM;EAAA;AAEV,CAAC;AAGM,IAAM,wBACX;;;;ACJK,IAAM,eAAqB,iBAAiD,SAASA,cAC1F,EAAE,OAAO,WAAW,WAAW,oBAAoB,UAAU,GAAG,MAAA,GAChE,KACA;AACA,SACE,qBAAC,QAAA,EAAK,WAAW,GAAG,0BAA0B,kBAAkB,GAAG,aAAU,iBAC3E,UAAA;IAAA,oBAAC,UAAA,EAAO,KAAU,WAAW,GAAG,qBAAqB,EAAE,KAAA,CAAM,GAAG,SAAS,GAAI,GAAG,OAC7E,SAAA,CACH;IACA;MAAC;MAAA;QACC,WAAW;QACX,OAAM;QACN,SAAQ;QACR,MAAK;QACL,QAAO;QACP,aAAY;QACZ,eAAc;QACd,gBAAe;QACf,eAAY;QAEZ,UAAA,oBAAC,QAAA,EAAK,GAAG,wBAAA,CAAyB;MAAA;IAAA;EACpC,EAAA,CACF;AAEJ,CAAC;",
|
|
6
|
+
"names": ["NativeSelect"]
|
|
7
|
+
}
|
package/dist/react-navbar.js
CHANGED
package/dist/react-otp-input.js
CHANGED
package/dist/react-pagination.js
CHANGED
package/dist/react-payment.js
CHANGED
package/dist/react-popover.js
CHANGED
package/dist/react-radio.js
CHANGED
package/dist/react-search-bar.js
CHANGED