@filipgutica/ui-react 0.0.0-stage → 0.1.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Filip Gutica
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,95 @@
1
- # Temporary Holding Version
1
+ # @filipgutica/ui-react
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ React components on [Base UI](https://base-ui.com), drawn with [`@filipgutica/design-system`](https://github.com/filipgutica/design-system) tokens. The components follow shadcn/ui's model: Base UI parts composed in this repository, then shipped as one versioned package. Charts wrap [Recharts](https://recharts.github.io).
4
+
5
+ The package ships compiled CSS, so an app needs no Tailwind. Every colour is a design-system token, so dark mode and themes follow the tokens. Nothing renders an inline `<style>` element. Base UI and Recharts set some styles through React's `style` prop, which a client-rendered page applies through the CSSOM, so client-rendered pages run under `style-src 'self'; style-src-attr 'none'`. Server rendering would turn those into `style` attributes, which that policy blocks.
6
+
7
+ ## Install
8
+
9
+ ```sh
10
+ pnpm add @filipgutica/ui-react @filipgutica/design-system react react-dom
11
+ ```
12
+
13
+ Import the design system's stylesheets once, then this package's, then each component from its own entry point:
14
+
15
+ ```tsx
16
+ import '@filipgutica/design-system/fonts.css';
17
+ import '@filipgutica/design-system/tokens.css';
18
+ import '@filipgutica/ui-react/styles.css';
19
+
20
+ import { AppShell } from '@filipgutica/ui-react/components/app-shell';
21
+ import { StatusLine } from '@filipgutica/ui-react/components/status-line';
22
+ ```
23
+
24
+ `@filipgutica/design-system` is a peer dependency, not a dependency: the page loads `tokens.css` once, and every library on the page must read the same tokens. A copy nested inside this package would let two token versions disagree.
25
+
26
+ ## Components
27
+
28
+ | Entry point | Exports | Use for |
29
+ | --- | --- | --- |
30
+ | `components/app-shell` | `AppShell` | The page frame: skip link, brand, a strip of 6 or fewer pages with the current one marked, and `main` |
31
+ | `components/section-header` | `SectionHeader` | A page (`level={1}`) or section title, with an optional status, one muted meta line, and controls on the title row |
32
+ | `components/status-line` | `StatusLine` | A view's status in one sentence, led by a named status icon |
33
+ | `components/badge` | `Badge` | A one- or two-word status or category on the exceptions |
34
+ | `components/segmented-control` | `SegmentedControl` | Two to five short options that apply at once, such as a filter |
35
+ | `components/select` | `Select`, `SelectLabel`, `SelectTrigger`, `SelectContent`, `SelectItem` | One choice from a longer list, such as a week |
36
+ | `components/dropdown-menu` | `DropdownMenu`, `DropdownMenuTrigger`, `DropdownMenuContent`, `DropdownMenuItem`, `DropdownMenuSeparator` | Two or more secondary actions behind a "…" trigger |
37
+ | `components/table` | `Table`, `TableHeader`, `TableBody`, `TableRow`, `TableHead`, `TableCell`, `TableCaption` | One-line data rows; at phone width text cells wrap and column gaps narrow so the table fits, and a table still too wide scrolls in its own keyboard-reachable region |
38
+ | `components/line-chart` | `LineChart` | A trend over a few periods, up to 3 series |
39
+ | `components/stacked-bar-chart` | `StackedBarChart` | Parts of a whole per period (`orientation="vertical"`) or per item with totals (`"horizontal"`), up to 3 series |
40
+
41
+ ### Charts
42
+
43
+ `LineChart` and `StackedBarChart` are the chart API. There is no generic `Chart` entry point; each chart type gets its own entry when one is needed.
44
+
45
+ ```tsx
46
+ <LineChart
47
+ title="Review rounds per run"
48
+ categoryLabel="Week"
49
+ data={[
50
+ { label: 'W48', desktop: 3.1, laptop: 2.7 },
51
+ { label: 'W49', desktop: null, laptop: 2.5 },
52
+ ]}
53
+ series={[
54
+ { key: 'desktop', label: 'desktop' },
55
+ { key: 'laptop', label: 'laptop' },
56
+ ]}
57
+ />
58
+ ```
59
+
60
+ - A series' slot sets its colour and line: 1 is the accent, solid; 2 is success, dashed; 3 is warning, dotted. The slot defaults to the series' position. Set `slot` when a filter can hide other series, so each keeps its look.
61
+ - `null` or a missing value is a gap; `0` is a value.
62
+ - With no series, such as after a filter, or no rows, the chart keeps its title and says "No data to show." More than 3 series throws.
63
+ - The key line under the chart shows each series' latest value, and its period when that is not the last one.
64
+ - Each chart is a named figure. Its plot takes Tab focus, and the arrow keys move between periods; the tooltip is a live region, so a screen reader hears each period's values. "View data" opens every value as a table.
65
+ - Nothing animates.
66
+
67
+ ## Develop
68
+
69
+ Development needs Node 24 (`.nvmrc`); jsdom 30 and semantic-release need Node 22.22 or later, above the package's own `>=22.12` floor for consumers.
70
+
71
+ ```sh
72
+ corepack enable
73
+ pnpm bootstrap # install dependencies and Chromium for the browser tests; CI runs `pnpm bootstrap --with-deps`
74
+ pnpm dev # docs at http://127.0.0.1:5173
75
+ pnpm check # build, typecheck, lint, unit and browser tests, docs CSP and axe checks, pack, publint
76
+ ```
77
+
78
+ `docs/` is a private workspace package that consumes the built package through its exports, as an app would. Its Hub preview (`#/hub/overview`) composes four application pages from illustrative fixture data.
79
+
80
+ `pnpm test:docs` serves the built docs with `vite preview` under the hub's Content-Security-Policy and fails on any CSP violation, axe violation, or sideways scroll of the page or any table at 390px. It also uses the skip link, every chart's plot and View data from the keyboard, and the Overview filters that leave no series. `pnpm screenshots` also saves every docs page at 1200px light and 390px dark to `screenshots/`.
81
+
82
+ ## Release
83
+
84
+ semantic-release publishes from `main` with npm provenance. `feat` releases a minor version, `fix` a patch, and a breaking change a major. Commits follow Conventional Commits, and CI checks them with commitlint (`pnpm lint:commits <before> <after>`; on the push that creates `main` it checks the whole history).
85
+
86
+ The first release is 0.1.0. The root commit, `chore: initialize repository`, carries the annotated tag `v0.0.0`, so semantic-release counts from 0.0.0 and the first `feat` makes 0.1.0. That tag is the one tag made by hand. Push it before `main`: the Release workflow runs on the push to `main`, and without the tag it would publish 1.0.0.
87
+
88
+ ```sh
89
+ git push origin v0.0.0
90
+ git push -u origin main
91
+ ```
92
+
93
+ ## License
94
+
95
+ MIT
@@ -0,0 +1,22 @@
1
+ import { type ReactNode } from 'react';
2
+ export type AppShellLink = {
3
+ href: string;
4
+ label: string;
5
+ /** Marks the link to the page on screen with aria-current="page". */
6
+ current?: boolean;
7
+ };
8
+ export type AppShellProps = {
9
+ /** The product name, at the start of the header. */
10
+ brand: ReactNode;
11
+ brandHref?: string;
12
+ /** The primary pages, 6 or fewer. */
13
+ links: AppShellLink[];
14
+ /** Names the primary navigation landmark; screen readers add "navigation". */
15
+ navLabel?: string;
16
+ children: ReactNode;
17
+ };
18
+ /**
19
+ * The page frame: a skip link, a header with the brand and a strip of primary pages, and `main`.
20
+ * Links are plain anchors, so each page has its own URL.
21
+ */
22
+ export declare const AppShell: ({ brand, brandHref, links, navLabel, children }: AppShellProps) => import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useRef } from 'react';
3
+ /**
4
+ * The page frame: a skip link, a header with the brand and a strip of primary pages, and `main`.
5
+ * Links are plain anchors, so each page has its own URL.
6
+ */
7
+ export const AppShell = ({ brand, brandHref = '/', links, navLabel = 'Primary', children }) => {
8
+ const mainRef = useRef(null);
9
+ return (_jsxs(_Fragment, { children: [_jsx("a", { className: "ui-skip", href: "#main", onClick: (event) => {
10
+ event.preventDefault();
11
+ mainRef.current?.focus();
12
+ }, children: "Skip to content" }), _jsx("header", { className: "ui-shell-header", children: _jsxs("div", { className: "ui-shell-bar", children: [_jsx("a", { className: "ui-shell-brand", href: brandHref, children: brand }), _jsx("nav", { className: "ui-nav", "aria-label": navLabel, children: links.map((link) => (_jsx("a", { href: link.href, "data-label": link.label, "aria-current": link.current ? 'page' : undefined, children: link.label }, link.href))) })] }) }), _jsx("main", { ref: mainRef, id: "main", tabIndex: -1, className: "ui-shell-main", children: children })] }));
13
+ };
@@ -0,0 +1,8 @@
1
+ import type { ComponentProps } from 'react';
2
+ export type BadgeTone = 'neutral' | 'success' | 'warning' | 'danger' | 'info';
3
+ export type BadgeProps = ComponentProps<'span'> & {
4
+ /** A status tone adds a dot and a tint. Use one only when the badge is a status. */
5
+ tone?: BadgeTone;
6
+ };
7
+ /** A one- or two-word status or category. Badge the exceptions, not every row. */
8
+ export declare const Badge: ({ tone, className, ...props }: BadgeProps) => import("react").JSX.Element;
@@ -0,0 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { cn } from '../lib/cn.js';
3
+ /** A one- or two-word status or category. Badge the exceptions, not every row. */
4
+ export const Badge = ({ tone = 'neutral', className, ...props }) => (_jsx("span", { "data-slot": "badge", "data-tone": tone, className: cn('ui-badge', className), ...props }));
@@ -0,0 +1,17 @@
1
+ import { Menu as MenuPrimitive } from '@base-ui/react/menu';
2
+ /** An overflow menu: two or more secondary actions behind a "…" trigger. Base UI's Menu. */
3
+ export declare const DropdownMenu: (props: MenuPrimitive.Root.Props) => import("react").JSX.Element;
4
+ export type DropdownMenuTriggerProps = Omit<MenuPrimitive.Trigger.Props, 'aria-label'> & {
5
+ /** Names the item the menu acts on, such as "More actions for W49". */
6
+ 'aria-label': string;
7
+ };
8
+ /** An icon-only quiet action holding the "more" icon. */
9
+ export declare const DropdownMenuTrigger: ({ className, ...props }: DropdownMenuTriggerProps) => import("react").JSX.Element;
10
+ /** The menu, aligned to the trigger's end edge, 4px below it. */
11
+ export declare const DropdownMenuContent: ({ className, ...props }: MenuPrimitive.Popup.Props) => import("react").JSX.Element;
12
+ export type DropdownMenuItemProps = MenuPrimitive.Item.Props & {
13
+ /** A destructive action: last, after a separator, in the danger colour. */
14
+ variant?: 'default' | 'danger';
15
+ };
16
+ export declare const DropdownMenuItem: ({ className, variant, ...props }: DropdownMenuItemProps) => import("react").JSX.Element;
17
+ export declare const DropdownMenuSeparator: ({ className, ...props }: MenuPrimitive.Separator.Props) => import("react").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CSPProvider } from '@base-ui/react/csp-provider';
3
+ import { Menu as MenuPrimitive } from '@base-ui/react/menu';
4
+ import { withClass } from '../lib/cn.js';
5
+ import { MoreIcon } from '../lib/icons.js';
6
+ /** An overflow menu: two or more secondary actions behind a "…" trigger. Base UI's Menu. */
7
+ export const DropdownMenu = (props) => (_jsx(CSPProvider, { disableStyleElements: true, children: _jsx(MenuPrimitive.Root, { ...props }) }));
8
+ /** An icon-only quiet action holding the "more" icon. */
9
+ export const DropdownMenuTrigger = ({ className, ...props }) => (_jsx(MenuPrimitive.Trigger, { "data-slot": "dropdown-menu-trigger", className: withClass('ui-quiet', className), ...props, children: _jsx(MoreIcon, {}) }));
10
+ /** The menu, aligned to the trigger's end edge, 4px below it. */
11
+ export const DropdownMenuContent = ({ className, ...props }) => (_jsx(MenuPrimitive.Portal, { children: _jsx(MenuPrimitive.Positioner, { className: "ui-positioner", sideOffset: 4, align: "end", children: _jsx(MenuPrimitive.Popup, { "data-slot": "dropdown-menu-content", className: withClass('ui-popup', className), ...props }) }) }));
12
+ export const DropdownMenuItem = ({ className, variant = 'default', ...props }) => (_jsx(MenuPrimitive.Item, { "data-slot": "dropdown-menu-item", "data-variant": variant, className: withClass('ui-item', className), ...props }));
13
+ export const DropdownMenuSeparator = ({ className, ...props }) => (_jsx(MenuPrimitive.Separator, { "data-slot": "dropdown-menu-separator", className: withClass('ui-separator', className), ...props }));
@@ -0,0 +1,11 @@
1
+ import { type ChartBaseProps } from '../lib/chart.js';
2
+ export type { ChartRow, ChartSeries } from '../lib/chart.js';
3
+ export type LineChartProps<K extends string> = ChartBaseProps<K> & {
4
+ /** Names the category column in the data table. */
5
+ categoryLabel?: string;
6
+ };
7
+ /**
8
+ * A trend over a few periods, one line per series. Colours and dashes come from the series' position; the
9
+ * legend shows each series' latest value; "View data" holds every value as a table. No animation.
10
+ */
11
+ export declare const LineChart: <K extends string>({ title, headingLevel, data, series, formatValue, unit, note, categoryLabel, }: LineChartProps<K>) => import("react").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from 'react';
3
+ import { CartesianGrid, Line, LineChart as RechartsLineChart, Tooltip, XAxis, YAxis } from 'recharts';
4
+ import { ChartDataTable, ChartLegend, ChartTitle, checkSeries, EmptyChart, isEmptyChart, defaultFormat, niceMax, TICK, seriesClass, useChartTooltip, } from '../lib/chart.js';
5
+ /**
6
+ * A trend over a few periods, one line per series. Colours and dashes come from the series' position; the
7
+ * legend shows each series' latest value; "View data" holds every value as a table. No animation.
8
+ */
9
+ export const LineChart = ({ title, headingLevel, data, series, formatValue = defaultFormat, unit, note, categoryLabel = 'Period', }) => {
10
+ checkSeries(series, 'LineChart');
11
+ const titleId = useId();
12
+ const tooltip = useChartTooltip(formatValue);
13
+ if (isEmptyChart(data, series))
14
+ return _jsx(EmptyChart, { slot: "line-chart", titleId: titleId, title: title, headingLevel: headingLevel });
15
+ const values = data.flatMap((row) => series.map((item) => row[item.key]).filter((value) => typeof value === 'number'));
16
+ const top = niceMax(Math.max(0, ...values));
17
+ const first = data[0]?.label;
18
+ const last = data.at(-1)?.label;
19
+ return (_jsxs("figure", { "data-slot": "line-chart", className: "ui-chart", "aria-labelledby": titleId, children: [_jsx(ChartTitle, { id: titleId, level: headingLevel, children: title }), _jsx("div", { className: "ui-chart-plot", children: _jsxs(RechartsLineChart, { responsive: true, style: { width: '100%', height: '100%' }, data: [...data], title: title, desc: `Line chart, ${series.map((item) => item.label).join(', ')}, ${first ?? ''} to ${last ?? ''}. Use the arrow keys to move between ${categoryLabel.toLowerCase()}s, or open View data.`, margin: { top: 8, right: 12, bottom: 0, left: 0 }, children: [_jsx(CartesianGrid, { horizontal: false, vertical: false }), _jsx(XAxis, { dataKey: "label", tick: TICK, ticks: first && last ? [first, last] : [], interval: 0, tickLine: false, tickMargin: 8, padding: { left: 12, right: 12 } }), _jsx(YAxis, { domain: [0, top], tick: TICK, ticks: [0, top], tickFormatter: formatValue, tickLine: false, axisLine: false, width: "auto" }), _jsx(Tooltip, { isAnimationActive: false, cursor: { strokeWidth: 1 }, content: tooltip.content }), series.map((item, index) => (_jsx(Line, { className: `ui-line ${seriesClass(item, index)}`, dataKey: item.key, name: item.label, type: "linear", connectNulls: false, isAnimationActive: false, dot: { r: 3, className: `ui-dot ${seriesClass(item, index)}` }, activeDot: { r: 4, className: `ui-dot ${seriesClass(item, index)}` } }, item.key)))] }) }), tooltip.region, _jsx(ChartLegend, { data: data, series: series, format: formatValue, withValues: true, shape: "line" }), note ? _jsx("p", { className: "ui-chart-note", children: note }) : null, _jsx(ChartDataTable, { title: title, data: data, series: series, format: formatValue, unit: unit, categoryLabel: categoryLabel, withTotal: false })] }));
20
+ };
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ export type SectionHeaderProps = {
3
+ title: ReactNode;
4
+ /** 1 for the page title, 2 for a section in it. */
5
+ level?: 1 | 2;
6
+ id?: string;
7
+ /** Controls that act on the section, such as filters, at the end of the title row. */
8
+ actions?: ReactNode;
9
+ /** Shown between the title and the meta line, such as a StatusLine. */
10
+ children?: ReactNode;
11
+ /** One muted line of context, parts joined with " · ". */
12
+ meta?: ReactNode;
13
+ className?: string;
14
+ };
15
+ /** A page or section title with an optional status, one meta line, and controls on the title row. */
16
+ export declare const SectionHeader: ({ title, level, id, actions, children, meta, className }: SectionHeaderProps) => import("react").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../lib/cn.js';
3
+ /** A page or section title with an optional status, one meta line, and controls on the title row. */
4
+ export const SectionHeader = ({ title, level = 2, id, actions, children, meta, className }) => {
5
+ const Heading = level === 1 ? 'h1' : 'h2';
6
+ return (_jsxs("div", { "data-slot": "section-header", className: cn('ui-heading', className), children: [_jsxs("div", { className: "ui-heading-row", children: [_jsx(Heading, { id: id, children: title }), actions ? _jsx("div", { className: "ui-toolbar", children: actions }) : null] }), children, meta ? _jsx("p", { className: "ui-meta", children: meta }) : null] }));
7
+ };
@@ -0,0 +1,19 @@
1
+ import { type ReactNode } from 'react';
2
+ export type SegmentedOption<V extends string> = {
3
+ value: V;
4
+ label: ReactNode;
5
+ disabled?: boolean;
6
+ };
7
+ export type SegmentedControlProps<V extends string> = {
8
+ /** Visible label before the track, such as "Machine". It also names the group. */
9
+ label: string;
10
+ options: ReadonlyArray<SegmentedOption<V>>;
11
+ value: V;
12
+ onValueChange: (value: V) => void;
13
+ className?: string;
14
+ };
15
+ /**
16
+ * Two to five short options that apply at once, such as a filter. A group of Base UI toggles: each option is
17
+ * a `<button aria-pressed>` and its own Tab stop. Pressing the current option keeps it, so one is always on.
18
+ */
19
+ export declare const SegmentedControl: <V extends string>({ label, options, value, onValueChange, className }: SegmentedControlProps<V>) => import("react").JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Toggle } from '@base-ui/react/toggle';
3
+ import { useId } from 'react';
4
+ import { cn } from '../lib/cn.js';
5
+ /**
6
+ * Two to five short options that apply at once, such as a filter. A group of Base UI toggles: each option is
7
+ * a `<button aria-pressed>` and its own Tab stop. Pressing the current option keeps it, so one is always on.
8
+ */
9
+ export const SegmentedControl = ({ label, options, value, onValueChange, className }) => {
10
+ const labelId = useId();
11
+ return (_jsxs("div", { "data-slot": "segmented-control", className: cn('ui-segmented-field', className), children: [_jsx("span", { id: labelId, className: "ui-segmented-label", children: label }), _jsx("div", { role: "group", "aria-labelledby": labelId, className: "ui-segmented", children: options.map((option) => (_jsx(Toggle, { value: option.value, pressed: option.value === value, disabled: option.disabled, onPressedChange: (pressed) => {
12
+ if (pressed)
13
+ onValueChange(option.value);
14
+ }, children: option.label }, option.value))) })] }));
15
+ };
@@ -0,0 +1,16 @@
1
+ import { Select as SelectPrimitive } from '@base-ui/react/select';
2
+ /**
3
+ * One choice from a list, such as a week. Base UI's Select, drawn as a field with a floating picker.
4
+ * The CSPProvider stops Base UI from rendering an inline <style>; styles.css carries that rule.
5
+ */
6
+ export declare const Select: <Value>({ children, ...props }: SelectPrimitive.Root.Props<Value>) => import("react").JSX.Element;
7
+ /** The visible label. Give the trigger an aria-label instead when no label shows. */
8
+ export declare const SelectLabel: ({ className, ...props }: SelectPrimitive.Label.Props) => import("react").JSX.Element;
9
+ export type SelectTriggerProps = SelectPrimitive.Trigger.Props & {
10
+ /** Shown while nothing is selected. */
11
+ placeholder?: string;
12
+ };
13
+ export declare const SelectTrigger: ({ className, placeholder, ...props }: SelectTriggerProps) => import("react").JSX.Element;
14
+ /** The picker. It opens below the trigger rather than over it, as the design system's picker does. */
15
+ export declare const SelectContent: ({ className, children, ...props }: SelectPrimitive.Popup.Props) => import("react").JSX.Element;
16
+ export declare const SelectItem: ({ className, children, ...props }: SelectPrimitive.Item.Props) => import("react").JSX.Element;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CSPProvider } from '@base-ui/react/csp-provider';
3
+ import { Select as SelectPrimitive } from '@base-ui/react/select';
4
+ import { withClass } from '../lib/cn.js';
5
+ import { CheckIcon, ChevronDownIcon } from '../lib/icons.js';
6
+ /**
7
+ * One choice from a list, such as a week. Base UI's Select, drawn as a field with a floating picker.
8
+ * The CSPProvider stops Base UI from rendering an inline <style>; styles.css carries that rule.
9
+ */
10
+ export const Select = ({ children, ...props }) => (_jsx(CSPProvider, { disableStyleElements: true, children: _jsx(SelectPrimitive.Root, { ...props, children: _jsx("div", { "data-slot": "select", className: "ui-select-field", children: children }) }) }));
11
+ /** The visible label. Give the trigger an aria-label instead when no label shows. */
12
+ export const SelectLabel = ({ className, ...props }) => (_jsx(SelectPrimitive.Label, { "data-slot": "select-label", className: withClass('ui-select-label', className), ...props }));
13
+ export const SelectTrigger = ({ className, placeholder, ...props }) => (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", className: withClass('ui-select-trigger', className), ...props, children: [_jsx(SelectPrimitive.Value, { "data-slot": "select-value", placeholder: placeholder }), _jsx(SelectPrimitive.Icon, { render: _jsx(ChevronDownIcon, { className: "ui-select-chevron" }) })] }));
14
+ /** The picker. It opens below the trigger rather than over it, as the design system's picker does. */
15
+ export const SelectContent = ({ className, children, ...props }) => (_jsx(SelectPrimitive.Portal, { children: _jsx(SelectPrimitive.Positioner, { className: "ui-positioner", sideOffset: 4, align: "start", alignItemWithTrigger: false, children: _jsx(SelectPrimitive.Popup, { "data-slot": "select-content", className: withClass('ui-popup ui-select-popup', className), ...props, children: _jsx(SelectPrimitive.List, { children: children }) }) }) }));
16
+ export const SelectItem = ({ className, children, ...props }) => (_jsxs(SelectPrimitive.Item, { "data-slot": "select-item", className: withClass('ui-item', className), ...props, children: [_jsx(SelectPrimitive.ItemText, { children: children }), _jsx(SelectPrimitive.ItemIndicator, { render: _jsx(CheckIcon, { className: "ui-item-check" }) })] }));
@@ -0,0 +1,13 @@
1
+ import { type ChartBaseProps } from '../lib/chart.js';
2
+ export type { ChartRow, ChartSeries } from '../lib/chart.js';
3
+ export type StackedBarChartProps<K extends string> = ChartBaseProps<K> & {
4
+ /** "vertical": a column per category, such as weeks. "horizontal": a row per category, with its total at the end. */
5
+ orientation?: 'vertical' | 'horizontal';
6
+ /** Names the category column in the data table. */
7
+ categoryLabel?: string;
8
+ };
9
+ /**
10
+ * Parts of a whole per category, stacked in series order. Colours come from the series' position; the
11
+ * legend names the series; "View data" holds every value and the totals as a table. No animation.
12
+ */
13
+ export declare const StackedBarChart: <K extends string>({ title, headingLevel, data, series, formatValue, unit, note, orientation, categoryLabel, }: StackedBarChartProps<K>) => import("react").JSX.Element;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useId } from 'react';
3
+ import { Bar, BarChart, Tooltip, XAxis, YAxis } from 'recharts';
4
+ import { ChartDataTable, ChartLegend, ChartTitle, checkSeries, EmptyChart, isEmptyChart, defaultFormat, niceMax, TICK, rowTotal, seriesClass, useChartTooltip, } from '../lib/chart.js';
5
+ const ROW_HEIGHT = 30;
6
+ const STACK = 'stack';
7
+ /**
8
+ * Parts of a whole per category, stacked in series order. Colours come from the series' position; the
9
+ * legend names the series; "View data" holds every value and the totals as a table. No animation.
10
+ */
11
+ export const StackedBarChart = ({ title, headingLevel, data, series, formatValue = defaultFormat, unit, note, orientation = 'vertical', categoryLabel = orientation === 'vertical' ? 'Period' : 'Item', }) => {
12
+ checkSeries(series, 'StackedBarChart');
13
+ const titleId = useId();
14
+ const tooltipParts = useChartTooltip(formatValue);
15
+ if (isEmptyChart(data, series))
16
+ return _jsx(EmptyChart, { slot: "stacked-bar-chart", titleId: titleId, title: title, headingLevel: headingLevel });
17
+ const top = niceMax(Math.max(0, ...data.map((row) => rowTotal(row, series))));
18
+ const horizontal = orientation === 'horizontal';
19
+ const first = data[0]?.label;
20
+ const last = data.at(-1)?.label;
21
+ const desc = `Stacked bar chart, ${series.map((item) => item.label).join(' and ')}, ${data.length} ${categoryLabel.toLowerCase()}s. Use the arrow keys to move between them, or open View data.`;
22
+ const bars = series.map((item, index) => (_jsx(Bar, { ...(horizontal ? { yAxisId: 'label' } : {}), className: `ui-bar ${seriesClass(item, index)}`, dataKey: item.key, name: item.label, stackId: STACK, isAnimationActive: false, maxBarSize: horizontal ? 10 : 36 }, item.key)));
23
+ // Horizontal bars carry two category axes (labels and totals); the tooltip reads the label axis.
24
+ const tooltip = _jsx(Tooltip, { isAnimationActive: false, content: tooltipParts.content, ...(horizontal ? { axisId: 'label' } : {}) });
25
+ return (_jsxs("figure", { "data-slot": "stacked-bar-chart", "data-orientation": orientation, className: "ui-chart", "aria-labelledby": titleId, children: [_jsx(ChartTitle, { id: titleId, level: headingLevel, children: title }), _jsx("div", { className: "ui-chart-plot", "data-layout": orientation, children: horizontal ? (_jsxs(BarChart, { responsive: true, layout: "vertical", style: { width: '100%', height: data.length * ROW_HEIGHT + 8 }, data: [...data], title: title, desc: desc, barCategoryGap: 8, margin: { top: 0, right: 0, bottom: 0, left: 0 }, children: [_jsx(XAxis, { type: "number", domain: [0, 'dataMax'], hide: true }), _jsx(YAxis, { yAxisId: "label", type: "category", dataKey: "label", axisLine: false, tickLine: false, width: "auto", tick: TICK, className: "ui-axis-text" }), _jsx(YAxis, { yAxisId: "total", type: "category", dataKey: (row) => formatValue(rowTotal(row, series)), orientation: "right", axisLine: false, tickLine: false, width: "auto", tick: TICK, className: "ui-axis-text" }), tooltip, bars] })) : (_jsxs(BarChart, { responsive: true, style: { width: '100%', height: '100%' }, data: [...data], title: title, desc: desc, margin: { top: 8, right: 12, bottom: 0, left: 0 }, children: [_jsx(XAxis, { dataKey: "label", tick: TICK, ticks: first && last ? [first, last] : [], interval: 0, tickLine: false, tickMargin: 8 }), _jsx(YAxis, { domain: [0, top], tick: TICK, ticks: [0, top], tickFormatter: formatValue, tickLine: false, axisLine: false, width: "auto" }), tooltip, bars] })) }), tooltipParts.region, _jsx(ChartLegend, { data: data, series: series, format: formatValue, withValues: false, shape: "block" }), note ? _jsx("p", { className: "ui-chart-note", children: note }) : null, _jsx(ChartDataTable, { title: title, data: data, series: series, format: formatValue, unit: unit, categoryLabel: categoryLabel, withTotal: true })] }));
26
+ };
@@ -0,0 +1,10 @@
1
+ import type { ReactNode } from 'react';
2
+ export type StatusTone = 'success' | 'warning' | 'danger' | 'info';
3
+ export type StatusLineProps = {
4
+ tone: StatusTone;
5
+ /** One sentence that carries the status and the numbers behind it. */
6
+ children: ReactNode;
7
+ className?: string;
8
+ };
9
+ /** A view's status in one sentence, led by a status icon whose shape and name repeat the tone. */
10
+ export declare const StatusLine: ({ tone, children, className }: StatusLineProps) => import("react").JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from '../lib/cn.js';
3
+ import { CheckCircleIcon, ErrorIcon, InfoIcon, WarningIcon } from '../lib/icons.js';
4
+ const toneIcon = { success: CheckCircleIcon, warning: WarningIcon, danger: ErrorIcon, info: InfoIcon };
5
+ const toneName = { success: 'OK', warning: 'Warning', danger: 'Error', info: 'Note' };
6
+ /** A view's status in one sentence, led by a status icon whose shape and name repeat the tone. */
7
+ export const StatusLine = ({ tone, children, className }) => {
8
+ const Icon = toneIcon[tone];
9
+ return (_jsxs("p", { "data-slot": "status-line", "data-tone": tone, className: cn('ui-status', className), children: [_jsx(Icon, { role: "img", "aria-hidden": false, "aria-label": toneName[tone] }), _jsx("span", { children: children })] }));
10
+ };
@@ -0,0 +1,28 @@
1
+ import { type ComponentProps } from 'react';
2
+ export type TableProps = ComponentProps<'table'> & {
3
+ /** Names the scroll region, such as the section heading's text. */
4
+ label: string;
5
+ };
6
+ /**
7
+ * A data table of one-line rows. At phone width, text cells and headers wrap so the table fits; numbers
8
+ * stay on one line. A table still wider than its column scrolls inside its own region, which then takes a
9
+ * Tab stop so a keyboard can scroll it.
10
+ */
11
+ export declare const Table: ({ label, className, ...props }: TableProps) => import("react").JSX.Element;
12
+ export declare const TableCaption: (props: ComponentProps<"caption">) => import("react").JSX.Element;
13
+ export declare const TableHeader: (props: ComponentProps<"thead">) => import("react").JSX.Element;
14
+ export declare const TableBody: (props: ComponentProps<"tbody">) => import("react").JSX.Element;
15
+ export declare const TableRow: (props: ComponentProps<"tr">) => import("react").JSX.Element;
16
+ type Numeric = {
17
+ /** A number column: aligned to the end so digits line up. */
18
+ numeric?: boolean;
19
+ };
20
+ export declare const TableHead: ({ numeric, scope, ...props }: ComponentProps<"th"> & Numeric) => import("react").JSX.Element;
21
+ export type TableCellProps = ComponentProps<'td'> & Numeric & {
22
+ /** Long text: cut with an ellipsis at 32rem on wide screens; it wraps in full at phone width. */
23
+ wrap?: boolean;
24
+ /** Secondary text, in the muted colour. */
25
+ muted?: boolean;
26
+ };
27
+ export declare const TableCell: ({ numeric, wrap, muted, ...props }: TableCellProps) => import("react").JSX.Element;
28
+ export {};
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useEffect, useRef, useState } from 'react';
3
+ import { cn } from '../lib/cn.js';
4
+ /**
5
+ * A data table of one-line rows. At phone width, text cells and headers wrap so the table fits; numbers
6
+ * stay on one line. A table still wider than its column scrolls inside its own region, which then takes a
7
+ * Tab stop so a keyboard can scroll it.
8
+ */
9
+ export const Table = ({ label, className, ...props }) => {
10
+ const scrollRef = useRef(null);
11
+ const overflows = useOverflow(scrollRef);
12
+ return (_jsx("div", { ref: scrollRef, "data-slot": "table-container", className: "ui-table-scroll", role: "region", "aria-label": label, tabIndex: overflows ? 0 : undefined, children: _jsx("table", { "data-slot": "table", className: cn('ui-table', className), ...props }) }));
13
+ };
14
+ /** True while the element is wider inside than out. */
15
+ const useOverflow = (ref) => {
16
+ const [overflows, setOverflows] = useState(false);
17
+ useEffect(() => {
18
+ const element = ref.current;
19
+ if (!element)
20
+ return;
21
+ const measure = () => setOverflows(element.scrollWidth > element.clientWidth);
22
+ measure();
23
+ const observer = new ResizeObserver(measure);
24
+ observer.observe(element);
25
+ if (element.firstElementChild)
26
+ observer.observe(element.firstElementChild);
27
+ return () => observer.disconnect();
28
+ }, [ref]);
29
+ return overflows;
30
+ };
31
+ export const TableCaption = (props) => _jsx("caption", { "data-slot": "table-caption", ...props });
32
+ export const TableHeader = (props) => _jsx("thead", { "data-slot": "table-header", ...props });
33
+ export const TableBody = (props) => _jsx("tbody", { "data-slot": "table-body", ...props });
34
+ export const TableRow = (props) => _jsx("tr", { "data-slot": "table-row", ...props });
35
+ export const TableHead = ({ numeric, scope = 'col', ...props }) => (_jsx("th", { "data-slot": "table-head", "data-numeric": numeric || undefined, scope: scope, ...props }));
36
+ export const TableCell = ({ numeric, wrap, muted, ...props }) => (_jsx("td", { "data-slot": "table-cell", "data-numeric": numeric || undefined, "data-wrap": wrap || undefined, "data-muted": muted || undefined, ...props }));
@@ -0,0 +1,108 @@
1
+ import { type ReactNode } from 'react';
2
+ import type { TooltipContentProps, TooltipContentType } from 'recharts';
3
+ /**
4
+ * One plotted series. Its slot sets its colour and line style: 1 accent solid, 2 success dashed, 3 warning
5
+ * dotted. The slot defaults to the series' position; fix it when a filter can hide other series, so each
6
+ * series keeps its look.
7
+ */
8
+ export type ChartSeries<K extends string> = {
9
+ key: K;
10
+ label: string;
11
+ slot?: 1 | 2 | 3;
12
+ };
13
+ /** One point on the category axis, such as a week, with a value per series. `null` or a missing key is a gap; 0 is a value. */
14
+ export type ChartRow<K extends string> = {
15
+ label: string;
16
+ } & {
17
+ [P in K]?: number | null;
18
+ };
19
+ export type ChartBaseProps<K extends string> = {
20
+ title: string;
21
+ /** Heading level of the title. */
22
+ headingLevel?: 2 | 3;
23
+ data: ReadonlyArray<ChartRow<K>>;
24
+ /** Up to three series. With none, or with no rows, the chart shows its title and "No data to show." */
25
+ series: ReadonlyArray<ChartSeries<K>>;
26
+ /** Formats values on the axis, legend, tooltip, and data table. */
27
+ formatValue?: (value: number) => string;
28
+ /** The unit, for the data table's caption, such as "Tokens". */
29
+ unit?: string;
30
+ /** One short sentence under the legend. */
31
+ note?: ReactNode;
32
+ };
33
+ export declare const MAX_SERIES = 3;
34
+ /** Recharts sets a tick's fill as an inline style; currentColor hands the colour to styles.css. */
35
+ export declare const TICK: {
36
+ readonly fill: "currentColor";
37
+ };
38
+ export declare const defaultFormat: (value: number) => string;
39
+ /** Validates the series count once, at the component boundary. None is allowed: a filter can leave none. */
40
+ export declare const checkSeries: (series: ReadonlyArray<unknown>, component: string) => void;
41
+ /** True when there is nothing to plot: no series, such as after a filter, or no rows. */
42
+ export declare const isEmptyChart: (data: ReadonlyArray<unknown>, series: ReadonlyArray<unknown>) => boolean;
43
+ /** The series' slot: its own, else its 1-based position. */
44
+ export declare const slotOf: (item: {
45
+ slot?: 1 | 2 | 3 | undefined;
46
+ }, index: number) => number;
47
+ /** The class that colours a series' marks, by slot. */
48
+ export declare const seriesClass: (item: {
49
+ slot?: 1 | 2 | 3 | undefined;
50
+ }, index: number) => string;
51
+ /** The last row with a value for `key`, so a legend shows the latest available value and where it came from. */
52
+ export declare const latestValue: <K extends string>(data: ReadonlyArray<ChartRow<K>>, key: K) => {
53
+ value: number;
54
+ label: string;
55
+ } | null;
56
+ /** A round top for the value axis, such as 37 for 36.84 or 100M for 92M: the first of 1, 2, 2.5, 5, or 10 times a power of ten at or above max. */
57
+ export declare const niceMax: (max: number) => number;
58
+ export declare const ChartTitle: ({ id, level, children }: {
59
+ id: string;
60
+ level?: 2 | 3 | undefined;
61
+ children: ReactNode;
62
+ }) => import("react").JSX.Element;
63
+ /** The figure for a chart with nothing to plot: its title and one muted sentence, so a page around it keeps its layout. */
64
+ export declare const EmptyChart: ({ slot, titleId, title, headingLevel }: {
65
+ slot: string;
66
+ titleId: string;
67
+ title: string;
68
+ headingLevel?: 2 | 3 | undefined;
69
+ }) => import("react").JSX.Element;
70
+ type LegendProps<K extends string> = {
71
+ data: ReadonlyArray<ChartRow<K>>;
72
+ series: ReadonlyArray<ChartSeries<K>>;
73
+ format: (value: number) => string;
74
+ /** Show each series' latest value after its label. */
75
+ withValues: boolean;
76
+ shape: 'line' | 'block';
77
+ };
78
+ /** One key line: a swatch drawn like the series' marks, its label, and its latest value. */
79
+ export declare const ChartLegend: <K extends string>({ data, series, format, withValues, shape }: LegendProps<K>) => import("react").JSX.Element;
80
+ type DataTableProps<K extends string> = {
81
+ title: string;
82
+ data: ReadonlyArray<ChartRow<K>>;
83
+ series: ReadonlyArray<ChartSeries<K>>;
84
+ format: (value: number) => string;
85
+ unit?: string | undefined;
86
+ categoryLabel: string;
87
+ withTotal: boolean;
88
+ };
89
+ /** A native disclosure holding every value as a table, for keyboard and screen-reader users. */
90
+ export declare const ChartDataTable: <K extends string>({ title, data, series, format, unit, categoryLabel, withTotal }: DataTableProps<K>) => import("react").JSX.Element;
91
+ export declare const rowTotal: <K extends string>(row: ChartRow<K>, series: ReadonlyArray<ChartSeries<K>>) => number;
92
+ /**
93
+ * Tooltip content drawn as the design system's floating layer. Recharts hides its wrapper while inactive, so the
94
+ * layer is hidden from screen readers and reports its values to `onAnnounce` for a live region outside it.
95
+ */
96
+ export declare const ChartTooltip: ({ active, payload, label, format, onAnnounce, }: Pick<TooltipContentProps<number, string>, "active" | "payload" | "label"> & {
97
+ format: (value: number) => string;
98
+ onAnnounce: (text: string) => void;
99
+ }) => import("react").JSX.Element;
100
+ /**
101
+ * The tooltip content for a chart and the always-present live region that announces the values it shows. The region
102
+ * empties when Escape dismisses the tooltip, which Recharts does without changing the tooltip's `active` prop.
103
+ */
104
+ export declare const useChartTooltip: (format: (value: number) => string) => {
105
+ content: TooltipContentType;
106
+ region: import("react").JSX.Element;
107
+ };
108
+ export {};
@@ -0,0 +1,99 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useId, useMemo, useState } from 'react';
3
+ import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from '../components/table.js';
4
+ export const MAX_SERIES = 3;
5
+ /** Recharts sets a tick's fill as an inline style; currentColor hands the colour to styles.css. */
6
+ export const TICK = { fill: 'currentColor' };
7
+ export const defaultFormat = (value) => value.toLocaleString('en-US', { maximumFractionDigits: 2 });
8
+ /** Validates the series count once, at the component boundary. None is allowed: a filter can leave none. */
9
+ export const checkSeries = (series, component) => {
10
+ if (series.length > MAX_SERIES) {
11
+ throw new RangeError(`${component} takes up to ${MAX_SERIES} series; got ${series.length}.`);
12
+ }
13
+ };
14
+ /** True when there is nothing to plot: no series, such as after a filter, or no rows. */
15
+ export const isEmptyChart = (data, series) => data.length === 0 || series.length === 0;
16
+ /** The series' slot: its own, else its 1-based position. */
17
+ export const slotOf = (item, index) => item.slot ?? index + 1;
18
+ /** The class that colours a series' marks, by slot. */
19
+ export const seriesClass = (item, index) => `ui-series-${slotOf(item, index)}`;
20
+ const valueOf = (row, key) => {
21
+ const value = row[key];
22
+ return typeof value === 'number' && Number.isFinite(value) ? value : null;
23
+ };
24
+ /** The last row with a value for `key`, so a legend shows the latest available value and where it came from. */
25
+ export const latestValue = (data, key) => {
26
+ for (let index = data.length - 1; index >= 0; index -= 1) {
27
+ const row = data[index];
28
+ if (!row)
29
+ continue;
30
+ const value = valueOf(row, key);
31
+ if (value !== null)
32
+ return { value, label: row.label };
33
+ }
34
+ return null;
35
+ };
36
+ /** A round top for the value axis, such as 37 for 36.84 or 100M for 92M: the first of 1, 2, 2.5, 5, or 10 times a power of ten at or above max. */
37
+ export const niceMax = (max) => {
38
+ if (max <= 0)
39
+ return 1;
40
+ const power = 10 ** Math.floor(Math.log10(max));
41
+ if (max < 100)
42
+ return Math.ceil(max);
43
+ const step = [1, 2, 2.5, 5, 10].find((multiple) => multiple * power >= max) ?? 10;
44
+ return step * power;
45
+ };
46
+ export const ChartTitle = ({ id, level = 2, children }) => {
47
+ const Heading = level === 3 ? 'h3' : 'h2';
48
+ return (_jsx(Heading, { id: id, className: "ui-chart-title", children: children }));
49
+ };
50
+ /** The figure for a chart with nothing to plot: its title and one muted sentence, so a page around it keeps its layout. */
51
+ export const EmptyChart = ({ slot, titleId, title, headingLevel }) => (_jsxs("figure", { "data-slot": slot, "data-empty": "", className: "ui-chart", "aria-labelledby": titleId, children: [_jsx(ChartTitle, { id: titleId, level: headingLevel, children: title }), _jsx("p", { className: "ui-chart-empty", children: "No data to show." })] }));
52
+ /** One key line: a swatch drawn like the series' marks, its label, and its latest value. */
53
+ export const ChartLegend = ({ data, series, format, withValues, shape }) => {
54
+ const last = data.at(-1)?.label;
55
+ return (_jsx("ul", { className: "ui-legend", "aria-label": "Key", children: series.map((item, index) => {
56
+ const latest = withValues ? latestValue(data, item.key) : null;
57
+ return (_jsxs("li", { children: [_jsx("span", { className: "ui-swatch", "data-series": slotOf(item, index), "data-shape": shape === 'block' ? 'block' : undefined, "aria-hidden": "true" }), _jsx("span", { children: item.label }), withValues && latest ? (_jsxs(_Fragment, { children: [_jsx("b", { children: format(latest.value) }), latest.label !== last ? _jsx("span", { className: "ui-meta", children: latest.label }) : null] })) : null, withValues && !latest ? _jsx("span", { className: "ui-meta", children: "no data" }) : null] }, item.key));
58
+ }) }));
59
+ };
60
+ /** A native disclosure holding every value as a table, for keyboard and screen-reader users. */
61
+ export const ChartDataTable = ({ title, data, series, format, unit, categoryLabel, withTotal }) => {
62
+ const captionId = useId();
63
+ return (_jsxs("details", { className: "ui-chart-data", children: [_jsx("summary", { children: "View data" }), _jsxs(Table, { label: `${title}, data`, "aria-describedby": captionId, children: [_jsx(TableCaption, { id: captionId, children: unit ? `${title} (${unit})` : title }), _jsx(TableHeader, { children: _jsxs(TableRow, { children: [_jsx(TableHead, { children: categoryLabel }), series.map((item) => (_jsx(TableHead, { numeric: true, children: item.label }, item.key))), withTotal ? _jsx(TableHead, { numeric: true, children: "Total" }) : null] }) }), _jsx(TableBody, { children: data.map((row) => (_jsxs(TableRow, { children: [_jsx(TableHead, { scope: "row", children: row.label }), series.map((item) => {
64
+ const value = valueOf(row, item.key);
65
+ return (_jsx(TableCell, { numeric: true, children: value === null ? _jsx("span", { "aria-label": "no data", children: "\u2013" }) : format(value) }, item.key));
66
+ }), withTotal ? _jsx(TableCell, { numeric: true, children: format(rowTotal(row, series)) }) : null] }, row.label))) })] })] }));
67
+ };
68
+ export const rowTotal = (row, series) => series.reduce((sum, item) => sum + (valueOf(row, item.key) ?? 0), 0);
69
+ /**
70
+ * Tooltip content drawn as the design system's floating layer. Recharts hides its wrapper while inactive, so the
71
+ * layer is hidden from screen readers and reports its values to `onAnnounce` for a live region outside it.
72
+ */
73
+ export const ChartTooltip = ({ active, payload, label, format, onAnnounce, }) => {
74
+ const shown = active && payload?.length ? payload : null;
75
+ const valueText = (value) => (typeof value === 'number' ? format(value) : '–');
76
+ const announcement = shown ? `${String(label)}: ${shown.map((entry) => `${entry.name} ${valueText(entry.value)}`).join(', ')}` : '';
77
+ useEffect(() => onAnnounce(announcement), [announcement, onAnnounce]);
78
+ return (_jsx("div", { className: "ui-popup ui-chart-tooltip", "aria-hidden": "true", children: shown ? (_jsxs(_Fragment, { children: [_jsx("span", { className: "ui-meta", children: label }), shown.map((entry) => (_jsxs("span", { children: [entry.name, " ", _jsx("b", { children: valueText(entry.value) })] }, String(entry.dataKey))))] })) : null }));
79
+ };
80
+ /**
81
+ * The tooltip content for a chart and the always-present live region that announces the values it shows. The region
82
+ * empties when Escape dismisses the tooltip, which Recharts does without changing the tooltip's `active` prop.
83
+ */
84
+ export const useChartTooltip = (format) => {
85
+ const [announcement, setAnnouncement] = useState('');
86
+ // A stable content function keeps Recharts from remounting the tooltip, which would announce a dismissed value again.
87
+ const content = useMemo(() => (props) => _jsx(ChartTooltip, { ...props, format: format, onAnnounce: setAnnouncement }), [format]);
88
+ const region = (_jsx("p", { className: "ui-sr-only", role: "status", children: announcement }));
89
+ // Recharts dismisses a tooltip on Escape anywhere in the document, focus in the plot or not.
90
+ useEffect(() => {
91
+ const onKeyDown = (event) => {
92
+ if (event.key === 'Escape')
93
+ setAnnouncement('');
94
+ };
95
+ document.addEventListener('keydown', onKeyDown);
96
+ return () => document.removeEventListener('keydown', onKeyDown);
97
+ }, []);
98
+ return { content, region };
99
+ };
@@ -0,0 +1,7 @@
1
+ /** Joins class names, skipping falsy values. */
2
+ export declare const cn: (...classes: Array<string | false | null | undefined>) => string;
3
+ /** Base UI's className: a string, or a function of the part's state. */
4
+ type StateClassName<State> = string | ((state: State) => string | undefined) | undefined;
5
+ /** Prepends the library's class to a Base UI className, keeping the function form when one is passed. */
6
+ export declare const withClass: <State>(base: string, className: StateClassName<State>) => string | ((state: State) => string);
7
+ export {};
package/dist/lib/cn.js ADDED
@@ -0,0 +1,4 @@
1
+ /** Joins class names, skipping falsy values. */
2
+ export const cn = (...classes) => classes.filter(Boolean).join(' ');
3
+ /** Prepends the library's class to a Base UI className, keeping the function form when one is passed. */
4
+ export const withClass = (base, className) => typeof className === 'function' ? (state) => cn(base, className(state)) : cn(base, className);
@@ -0,0 +1,10 @@
1
+ import type { SVGProps } from 'react';
2
+ type IconProps = SVGProps<SVGSVGElement>;
3
+ export declare const CheckCircleIcon: (props: IconProps) => import("react").JSX.Element;
4
+ export declare const WarningIcon: (props: IconProps) => import("react").JSX.Element;
5
+ export declare const ErrorIcon: (props: IconProps) => import("react").JSX.Element;
6
+ export declare const InfoIcon: (props: IconProps) => import("react").JSX.Element;
7
+ export declare const MoreIcon: (props: IconProps) => import("react").JSX.Element;
8
+ export declare const ChevronDownIcon: (props: IconProps) => import("react").JSX.Element;
9
+ export declare const CheckIcon: (props: IconProps) => import("react").JSX.Element;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from './cn.js';
3
+ /** A 16px line icon in currentColor. Decorative unless given a role and label. */
4
+ const Icon = ({ className, children, ...props }) => (_jsx("svg", { viewBox: "0 0 16 16", "aria-hidden": "true", focusable: "false", className: cn('ui-icon', className), ...props, children: children }));
5
+ export const CheckCircleIcon = (props) => (_jsxs(Icon, { ...props, children: [_jsx("circle", { cx: "8", cy: "8", r: "6.25" }), _jsx("path", { d: "m5.5 8.25 1.75 1.75 3.25-3.5" })] }));
6
+ export const WarningIcon = (props) => (_jsxs(Icon, { ...props, children: [_jsx("path", { d: "M8 2.25 1.75 13.25h12.5L8 2.25Z" }), _jsx("path", { d: "M8 6.5v3M8 11.5v.01" })] }));
7
+ export const ErrorIcon = (props) => (_jsxs(Icon, { ...props, children: [_jsx("circle", { cx: "8", cy: "8", r: "6.25" }), _jsx("path", { d: "m5.75 5.75 4.5 4.5m0-4.5-4.5 4.5" })] }));
8
+ export const InfoIcon = (props) => (_jsxs(Icon, { ...props, children: [_jsx("circle", { cx: "8", cy: "8", r: "6.25" }), _jsx("path", { d: "M8 7.25v3.5M8 5.25v.01" })] }));
9
+ export const MoreIcon = (props) => (_jsx(Icon, { ...props, children: _jsx("path", { d: "M3.5 8h.01M8 8h.01M12.5 8h.01" }) }));
10
+ export const ChevronDownIcon = (props) => (_jsx(Icon, { ...props, children: _jsx("path", { d: "m4 6 4 4 4-4" }) }));
11
+ export const CheckIcon = (props) => (_jsx(Icon, { ...props, children: _jsx("path", { d: "m3.5 8.5 3 3 6-7" }) }));
@@ -0,0 +1 @@
1
+ @layer base;@layer components{.base-ui-disable-scrollbar{scrollbar-width:none}.base-ui-disable-scrollbar::-webkit-scrollbar{display:none}.ui-icon{stroke:currentColor;fill:none;stroke-width:1.5px;stroke-linecap:round;stroke-linejoin:round;flex:none;width:16px;height:16px}.ui-sr-only{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.ui-skip{left:var(--space-4);z-index:10;padding:var(--space-2) var(--space-3);border-radius:var(--radius-field);background:var(--color-surface-raised);box-shadow:var(--shadow-dialog);color:var(--color-text);border:1px solid #0000;position:absolute;top:-100px}.ui-skip:focus-visible{top:var(--space-2)}.ui-shell-header{border-bottom:1px solid var(--color-border-subtle)}.ui-shell-bar,.ui-shell-main{max-width:var(--page-wide);padding-inline:var(--space-6);margin:0 auto}.ui-shell-bar{align-items:center;gap:var(--space-6);min-height:3.5rem;display:flex}.ui-shell-brand{font-weight:var(--weight-semibold);white-space:nowrap;color:var(--color-text);text-decoration:none}.ui-shell-main{gap:var(--space-12);padding-block:var(--space-8) var(--space-16);display:grid}.ui-shell-main>*{min-width:0}.ui-shell-main:focus{outline:none}.ui-nav{scrollbar-width:none;gap:.125rem;max-width:100%;padding:.125rem;scroll-padding-inline:24px;display:flex;overflow-x:auto}.ui-nav a{min-height:var(--row);padding-inline:var(--space-3);border-radius:var(--radius-inline);color:var(--color-muted);font-size:var(--text-sm);white-space:nowrap;transition:background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);flex:none;align-items:center;text-decoration:none;display:flex;position:relative}@media (hover:hover){.ui-nav a:hover{background:var(--color-row-hover);color:var(--color-text);text-decoration:none}}.ui-nav a[aria-current=page]{background:var(--color-nav-current);box-shadow:var(--shadow-nav-current);color:var(--color-nav-current-text);font-weight:var(--weight-medium)}.ui-nav a:focus-visible{outline:var(--focus-width) solid var(--color-focus);outline-offset:calc(var(--focus-width) * -1)}@supports (margin-top:-1lh){.ui-nav a[data-label]{flex-direction:column;justify-content:center;align-items:stretch}.ui-nav a[data-label]:after{content:attr(data-label) / "";font-weight:var(--weight-medium);visibility:hidden;margin-top:-1lh;display:block}}.ui-heading{gap:var(--space-2);display:grid}.ui-heading-row{justify-content:space-between;align-items:center;gap:var(--space-3);flex-wrap:wrap;display:flex}.ui-heading h1,.ui-heading h2{font-weight:var(--weight-semibold);margin:0}.ui-heading h1{font-size:var(--text-2xl)}.ui-heading h2{font-size:var(--text-lg)}.ui-meta{color:var(--color-muted);font-size:var(--text-sm);margin:0}.ui-toolbar{align-items:center;gap:var(--space-3) var(--space-6);flex-wrap:wrap;display:flex}.ui-status{align-items:flex-start;gap:var(--space-2);max-width:var(--measure);margin:0;display:flex}.ui-status .ui-icon{margin-top:.2rem}.ui-status[data-tone=success] .ui-icon{color:var(--color-success)}.ui-status[data-tone=warning] .ui-icon{color:var(--color-warning)}.ui-status[data-tone=danger] .ui-icon{color:var(--color-error)}.ui-status[data-tone=info] .ui-icon{color:var(--color-info)}.ui-badge{align-items:center;gap:var(--space-1);border-radius:var(--radius-pill);background:var(--color-surface-muted);width:fit-content;color:var(--color-muted);font:var(--weight-medium) var(--text-xs) / 1.25 var(--font-ui);white-space:nowrap;vertical-align:middle;border:1px solid #0000;padding:.125rem .375rem;display:inline-flex}.ui-badge:is([data-tone=success],[data-tone=warning],[data-tone=danger],[data-tone=info]){background:color-mix(in srgb, var(--tone) 22%, var(--color-surface-raised));color:light-dark(color-mix(in srgb, var(--tone) 75%, var(--color-status-ink)),color-mix(in srgb, var(--tone) 85%, var(--color-status-ink)))}.ui-badge:is([data-tone=success],[data-tone=warning],[data-tone=danger],[data-tone=info]):before{content:"";background:currentColor;border-radius:50%;flex:none;width:6px;height:6px}.ui-badge[data-tone=success]{--tone:var(--color-success)}.ui-badge[data-tone=warning]{--tone:var(--color-warning)}.ui-badge[data-tone=danger]{--tone:var(--color-error)}.ui-badge[data-tone=info]{--tone:var(--color-info)}.ui-segmented-field{align-items:center;gap:var(--space-2);min-width:0;display:flex}.ui-segmented-label{color:var(--color-muted);font-size:var(--text-sm)}.ui-segmented{--item:var(--control-sm);--inset:2px;gap:var(--inset);max-width:100%;padding:calc(var(--inset) - 1px);border-radius:var(--radius-control);background:var(--color-well);box-shadow:var(--shadow-sink);font-size:var(--text-sm);isolation:isolate;border:1px solid #0000;flex:none;display:inline-flex}.ui-segmented button{justify-content:center;align-items:center;gap:var(--space-2);min-height:calc(var(--item) - 2 * var(--inset));padding:0 var(--space-2);border-radius:calc(var(--radius-control) - var(--inset));color:var(--color-muted);font:inherit;cursor:pointer;white-space:nowrap;transition:color var(--duration-fast) var(--ease-out);background:0 0;border:1px solid #0000;line-height:1;display:inline-flex;position:relative}.ui-segmented button:before{content:"";z-index:-2;border-radius:inherit;pointer-events:none;position:absolute;inset:-1px}@media (hover:hover){.ui-segmented button:hover:not(:disabled,[aria-pressed=true]){color:var(--color-text)}.ui-segmented button:hover:not(:disabled,[aria-pressed=true]):before{background:color-mix(in srgb, var(--color-control-thumb) 45%, transparent)}}.ui-segmented button[aria-pressed=true]{color:var(--color-segmented-current-text)}.ui-segmented button[aria-pressed=true]:before{z-index:-1;background:var(--color-control-thumb);box-shadow:var(--shadow-raise)}.ui-segmented button:focus-visible{outline-offset:calc(var(--focus-width) * -1)}.ui-segmented button:disabled{opacity:.58;cursor:not-allowed}@media (forced-colors:active){.ui-segmented button[aria-pressed=true]{forced-color-adjust:none;color:highlighttext;background:highlight}.ui-segmented button[aria-pressed=true]:focus-visible{outline-color:highlighttext}}.ui-select-field{align-items:center;gap:var(--space-2);min-width:0;display:flex}.ui-select-label{color:var(--color-muted);font-size:var(--text-sm)}.ui-select-trigger{justify-content:space-between;align-items:center;gap:var(--space-2);min-width:0;height:var(--control-sm);padding:0 var(--space-2) 0 .5625rem;border:1px solid var(--color-field-edge);border-radius:var(--radius-field);background:var(--color-field-bg);box-shadow:var(--shadow-field);color:var(--color-text);font:var(--text-sm) / 1.35 var(--font-ui);text-align:start;cursor:pointer;display:inline-flex}.ui-select-trigger:focus-visible{border-color:var(--color-accent);box-shadow:var(--shadow-field-focus);outline:none}.ui-select-trigger:disabled{opacity:.58;cursor:not-allowed;background:var(--color-well);box-shadow:none}.ui-select-trigger [data-slot=select-value]{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.ui-select-chevron{width:12px;height:12px;color:var(--color-muted);flex:none}@media (forced-colors:active){.ui-select-trigger:focus-visible{outline:var(--focus-width) solid Highlight;outline-offset:-1px}}.ui-positioner{z-index:50;outline:0}.ui-popup{min-width:max(180px, var(--anchor-width,0px));max-height:min(20rem, 50dvh, var(--available-height,20rem));padding:var(--space-1);border-radius:var(--radius-panel);background:var(--color-surface-raised);box-shadow:var(--shadow-dialog);color:var(--color-text);font-size:var(--text-sm);border:1px solid #0000;outline:0;display:grid;overflow-y:auto}.ui-select-popup{min-width:var(--anchor-width,0px)}.ui-item{align-items:center;gap:var(--space-2);min-height:var(--row);padding:0 var(--space-3);border-radius:calc(var(--radius-panel) - var(--space-1));color:var(--color-text);cursor:pointer;-webkit-user-select:none;user-select:none;border:1px solid #0000;outline:none;display:flex}.ui-item[data-highlighted]{background:var(--color-row-hover)}.ui-item:focus-visible{outline:var(--focus-width) solid var(--color-focus);outline-offset:calc(var(--focus-width) * -1)}.ui-item[data-disabled]{opacity:.58;cursor:not-allowed}.ui-item[data-variant=danger]{color:var(--color-error)}.ui-item-check{width:16px;height:16px;color:var(--color-accent);margin-inline-start:auto}.ui-separator{height:1px;margin:var(--space-1) 0;background:var(--color-border-subtle)}@media (forced-colors:active){.ui-item[data-highlighted]{forced-color-adjust:none;color:highlighttext;background:highlight}.ui-separator{background:canvastext}}.ui-quiet{width:var(--control-sm);height:var(--control-sm);border-radius:var(--radius-control);color:var(--color-muted);font:inherit;cursor:pointer;transition:background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);background:0 0;border:1px solid #0000;justify-content:center;align-items:center;padding:0;display:inline-flex}@media (hover:hover){.ui-quiet:hover:not(:disabled){color:var(--color-text);background:color-mix(in srgb, currentColor 6%, transparent)}}.ui-quiet:active:not(:disabled){background:color-mix(in srgb, currentColor 12%, transparent)}.ui-quiet[data-popup-open]{background:color-mix(in srgb, currentColor 6%, transparent)}.ui-quiet:disabled{opacity:.58;cursor:not-allowed}.ui-quiet .ui-icon{stroke-width:3px}.ui-table-scroll{min-width:0;overflow-x:auto}.ui-table-scroll:focus-visible{outline-offset:2px}.ui-table{border-collapse:collapse;width:100%;font-size:var(--text-sm)}.ui-table caption{padding-bottom:var(--space-2);text-align:left;color:var(--color-muted);font-size:var(--text-sm)}.ui-table th{padding:var(--space-2) var(--space-4) var(--space-2) 0;border-bottom:1px solid var(--color-border-subtle);color:var(--color-muted);font-size:var(--text-xs);font-weight:var(--weight-medium);text-align:left;white-space:nowrap}.ui-table td{height:var(--row);padding:0 var(--space-4) 0 0;border-bottom:1px solid var(--color-border-subtle);white-space:nowrap}.ui-table :is(td,th):last-child{padding-right:0}.ui-table :is(td,th)[data-numeric]{text-align:right}.ui-table td[data-wrap]{text-overflow:ellipsis;max-width:32rem;overflow:hidden}.ui-table td[data-muted]{color:var(--color-muted)}.ui-table td .ui-badge{margin-inline-start:var(--space-1)}.ui-chart{gap:var(--space-3);align-content:start;min-width:0;margin:0;display:grid}.ui-chart-title{font-size:var(--text-lg);font-weight:var(--weight-semibold);margin:0}.ui-chart-plot{width:100%;min-width:0;height:12rem;position:relative}.ui-chart-plot[data-layout=horizontal]{height:auto}.ui-chart-plot .recharts-wrapper,.ui-chart-plot .recharts-surface{overflow:visible}.ui-chart-plot .recharts-surface:focus{outline:none}.ui-chart-plot .recharts-surface:focus-visible{outline:var(--focus-width) solid var(--color-focus);outline-offset:var(--focus-offset);border-radius:var(--radius-mark)}.ui-chart-plot .recharts-cartesian-axis-line,.ui-chart-plot .recharts-cartesian-axis-tick-line{stroke:var(--color-border-subtle)}.ui-chart-plot .recharts-cartesian-axis-tick-value{color:var(--color-muted);font-size:var(--text-xs)}.ui-chart-plot .ui-axis-text .recharts-cartesian-axis-tick-value{color:var(--color-text);font-size:var(--text-sm)}.ui-chart-plot .recharts-tooltip-cursor{stroke:var(--color-border);fill:color-mix(in srgb, var(--color-text) 6%, transparent)}.ui-chart :is(.ui-series-1,.ui-swatch[data-series="1"]){--series:var(--color-accent)}.ui-chart :is(.ui-series-2,.ui-swatch[data-series="2"]){--series:var(--color-success)}.ui-chart :is(.ui-series-3,.ui-swatch[data-series="3"]){--series:var(--color-warning)}.ui-chart .ui-line .recharts-line-curve{fill:none;stroke:var(--series);stroke-width:2px}.ui-chart .ui-line.ui-series-2 .recharts-line-curve{stroke-dasharray:6 3}.ui-chart .ui-line.ui-series-3 .recharts-line-curve{stroke-dasharray:1.5 3;stroke-linecap:round;stroke-width:2.5px}.ui-chart .ui-dot{fill:var(--series);stroke:var(--color-bg);stroke-width:1px}.ui-chart .ui-bar .recharts-rectangle{fill:var(--series)}.ui-legend{gap:var(--space-1) var(--space-4);font-size:var(--text-sm);flex-wrap:wrap;margin:0;padding:0;list-style:none;display:flex}.ui-legend li{align-items:center;gap:.375rem;display:inline-flex}.ui-legend b{font-weight:var(--weight-semibold)}.ui-swatch{border-top:2px solid var(--series);flex:none;width:1.25rem;display:inline-block}.ui-swatch[data-series="2"]{border-top-style:dashed}.ui-swatch[data-series="3"]{border-top-style:dotted;border-top-width:3px}.ui-swatch[data-shape=block]{background:var(--series);border:0;border-radius:2px;width:.75rem;height:.75rem}.ui-chart-tooltip{min-width:0;padding:var(--space-2) var(--space-3);white-space:nowrap;gap:.125rem;display:grid}.ui-chart-note,.ui-chart-empty{color:var(--color-muted);font-size:var(--text-sm);margin:0}.ui-chart-data summary{border-radius:var(--radius-mark);width:fit-content;color:var(--color-muted);font-size:var(--text-sm);cursor:pointer}@media (hover:hover){.ui-chart-data summary:hover{color:var(--color-text)}}.ui-chart-data[open] summary{margin-bottom:var(--space-2)}@media (forced-colors:active){.ui-chart .ui-line .recharts-line-curve{stroke:canvastext}.ui-swatch{forced-color-adjust:none;border-color:canvastext}}@media (max-width:800px){.ui-nav a,.ui-item{min-height:var(--control-touch)}.ui-chart-data summary{min-height:var(--control-touch);align-content:center}}@media (max-width:640px){.ui-shell-bar,.ui-shell-main{padding-inline:var(--space-4)}.ui-shell-bar{gap:0 var(--space-4);padding-block:var(--space-2);flex-wrap:wrap}.ui-shell-bar .ui-nav{margin-inline:-.125rem}.ui-shell-main{gap:var(--space-8);padding-block:var(--space-6) var(--space-12)}.ui-segmented-field{flex-wrap:wrap;max-width:100%}.ui-segmented{scrollbar-width:none;overflow-x:auto}.ui-table th,.ui-table td:not([data-numeric]){white-space:normal}.ui-table th{vertical-align:bottom}.ui-table :is(td,th){padding-right:var(--space-3)}.ui-table :is(td,th):last-child{padding-right:0}.ui-table td{padding-block:var(--space-2)}.ui-table td[data-wrap]{min-width:6rem;max-width:none;overflow:visible}}}
package/package.json CHANGED
@@ -1,6 +1,98 @@
1
1
  {
2
2
  "name": "@filipgutica/ui-react",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "React components on Base UI and Filip's design system, with compiled CSS and token-coloured charts",
5
+ "type": "module",
6
+ "sideEffects": [
7
+ "**/*.css"
8
+ ],
9
+ "files": [
10
+ "dist",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "exports": {
15
+ "./components/*": {
16
+ "types": "./dist/components/*.d.ts",
17
+ "default": "./dist/components/*.js"
18
+ },
19
+ "./styles.css": "./dist/styles.css",
20
+ "./package.json": "./package.json"
21
+ },
22
+ "scripts": {
23
+ "bootstrap": "pnpm install --frozen-lockfile && pnpm exec playwright install chromium",
24
+ "dev": "pnpm build && pnpm --dir docs dev",
25
+ "build": "node scripts/build.mjs",
26
+ "typecheck": "tsc -p tsconfig.json --noEmit && tsc -p docs/tsconfig.json --noEmit",
27
+ "lint": "eslint . --max-warnings=0 && node scripts/lint-css.mjs",
28
+ "lint:commits": "bash scripts/lint-commits.sh",
29
+ "test": "vitest run",
30
+ "test:docs": "pnpm --dir docs build && node scripts/docs-check.mjs",
31
+ "check": "pnpm build && pnpm typecheck && pnpm lint && pnpm test && pnpm test:docs && pnpm pack --dry-run && publint",
32
+ "screenshots": "pnpm build && pnpm --dir docs build && node scripts/docs-check.mjs --screenshots",
33
+ "release": "semantic-release",
34
+ "release:dry-run": "semantic-release --dry-run --no-ci"
35
+ },
36
+ "engines": {
37
+ "node": ">=22.12"
38
+ },
39
+ "packageManager": "pnpm@10.34.7",
40
+ "publishConfig": {
41
+ "access": "public",
42
+ "provenance": true
43
+ },
44
+ "license": "MIT",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/filipgutica/ui-react.git"
48
+ },
49
+ "bugs": {
50
+ "url": "https://github.com/filipgutica/ui-react/issues"
51
+ },
52
+ "homepage": "https://github.com/filipgutica/ui-react#readme",
53
+ "peerDependencies": {
54
+ "@filipgutica/design-system": "^1.0.49",
55
+ "react": "^19.2.0",
56
+ "react-dom": "^19.2.0"
57
+ },
58
+ "dependencies": {
59
+ "@base-ui/react": "1.9.0",
60
+ "react-is": "19.3.1",
61
+ "recharts": "3.11.3"
62
+ },
63
+ "devDependencies": {
64
+ "@axe-core/playwright": "4.14.1",
65
+ "@commitlint/cli": "21.2.4",
66
+ "@commitlint/config-conventional": "21.2.4",
67
+ "@eslint/js": "10.0.1",
68
+ "@filipgutica/design-system": "1.0.49",
69
+ "@semantic-release/commit-analyzer": "13.0.1",
70
+ "@semantic-release/github": "12.0.11",
71
+ "@semantic-release/npm": "13.2.0",
72
+ "@semantic-release/release-notes-generator": "14.1.1",
73
+ "@tailwindcss/cli": "4.3.5",
74
+ "@testing-library/dom": "10.4.2",
75
+ "@testing-library/jest-dom": "6.9.1",
76
+ "@testing-library/react": "16.3.3",
77
+ "@testing-library/user-event": "14.6.14",
78
+ "@types/node": "24.19.4",
79
+ "@types/react": "19.3.0",
80
+ "@types/react-dom": "19.3.0",
81
+ "@vitejs/plugin-react": "6.2.1",
82
+ "@vitest/browser-playwright": "5.0.5",
83
+ "conventional-changelog-conventionalcommits": "9.3.1",
84
+ "eslint": "10.16.0",
85
+ "eslint-plugin-react-hooks": "7.1.1",
86
+ "jsdom": "30.1.3",
87
+ "playwright": "1.65.1",
88
+ "publint": "0.3.25",
89
+ "react": "19.3.1",
90
+ "react-dom": "19.3.1",
91
+ "semantic-release": "25.0.9",
92
+ "tailwindcss": "4.3.5",
93
+ "typescript": "5.9.3",
94
+ "typescript-eslint": "8.74.0",
95
+ "vite": "8.4.1",
96
+ "vitest": "5.0.5"
97
+ }
98
+ }