@squadbase/vantage 0.6.2-dev1.b332e5a → 0.6.2-dev1.d7c0911
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/add-4GHF2TX2.js +6 -0
- package/dist/add-4GHF2TX2.js.map +1 -0
- package/dist/{build-TVKFIVFQ.js → build-X5NVCQKT.js} +7 -7
- package/dist/{build-TVKFIVFQ.js.map → build-X5NVCQKT.js.map} +1 -1
- package/dist/{check-3KHZXZMQ.js → check-ZBIH422T.js} +5 -5
- package/dist/{check-3KHZXZMQ.js.map → check-ZBIH422T.js.map} +1 -1
- package/dist/chunk-2ICNHUG6.js +1820 -0
- package/dist/chunk-2ICNHUG6.js.map +1 -0
- package/dist/{chunk-5ZOP4SQR.js → chunk-2N72FKLB.js} +12 -7
- package/dist/chunk-2N72FKLB.js.map +1 -0
- package/dist/{chunk-P7W4LR3Z.js → chunk-7DZGJQ3P.js} +3 -3
- package/dist/{chunk-P7W4LR3Z.js.map → chunk-7DZGJQ3P.js.map} +1 -1
- package/dist/{chunk-U2M6HGKQ.js → chunk-AABMKHEU.js} +4 -4
- package/dist/{chunk-U2M6HGKQ.js.map → chunk-AABMKHEU.js.map} +1 -1
- package/dist/{chunk-QI3XQKHS.js → chunk-GNXCX4WE.js} +10 -3
- package/dist/chunk-GNXCX4WE.js.map +1 -0
- package/dist/{chunk-PXRX5PEC.js → chunk-PDOBHMUQ.js} +3 -3
- package/dist/chunk-PDOBHMUQ.js.map +1 -0
- package/dist/{chunk-ZVANIULZ.js → chunk-RNTDBX6S.js} +4 -4
- package/dist/{chunk-ZVANIULZ.js.map → chunk-RNTDBX6S.js.map} +1 -1
- package/dist/{chunk-A2UUGASH.js → chunk-U736PVHY.js} +2 -2
- package/dist/chunk-U736PVHY.js.map +1 -0
- package/dist/{chunk-PVTHHV7X.js → chunk-V3LF7BE7.js} +27 -5
- package/dist/chunk-V3LF7BE7.js.map +1 -0
- package/dist/{chunk-LMUACBMA.js → chunk-WAMZWZJB.js} +53 -8
- package/dist/chunk-WAMZWZJB.js.map +1 -0
- package/dist/chunk-WRSX2MDK.js +7866 -0
- package/dist/chunk-WRSX2MDK.js.map +1 -0
- package/dist/{chunk-RPZAALCX.js → chunk-XPQSTZUU.js} +254 -164
- package/dist/chunk-XPQSTZUU.js.map +1 -0
- package/dist/{chunk-DTDVSFRY.js → chunk-XQUSGIDG.js} +17 -3
- package/dist/chunk-XQUSGIDG.js.map +1 -0
- package/dist/cli.js +12 -11
- package/dist/cli.js.map +1 -1
- package/dist/client/index.d.ts +32 -3
- package/dist/client/index.js +205 -12
- package/dist/client/index.js.map +1 -1
- package/dist/components/index.d.ts +1975 -28
- package/dist/components/index.js +4 -4
- package/dist/{dev-GDKATCC7.js → dev-4XEDTELV.js} +8 -8
- package/dist/dev-4XEDTELV.js.map +1 -0
- package/dist/doc/index.js +2 -2
- package/dist/doc/index.js.map +1 -1
- package/dist/{docs-EJJ3BECT.js → docs-JVP4RPKT.js} +3 -3
- package/dist/{docs-EJJ3BECT.js.map → docs-JVP4RPKT.js.map} +1 -1
- package/dist/{doctor-WQXPXP6K.js → doctor-5E2VEZPK.js} +5 -5
- package/dist/{doctor-WQXPXP6K.js.map → doctor-5E2VEZPK.js.map} +1 -1
- package/dist/markdown/index.js +1 -1
- package/dist/markdown/index.js.map +1 -1
- package/dist/{preview-OGMCNQUO.js → preview-T6CLSQVX.js} +3 -3
- package/dist/{preview-OGMCNQUO.js.map → preview-T6CLSQVX.js.map} +1 -1
- package/dist/query/index.d.ts +0 -11
- package/dist/query/index.js +2 -2
- package/dist/{routes-MWBWWOJ2.js → routes-3SGAFDMC.js} +4 -4
- package/dist/{routes-MWBWWOJ2.js.map → routes-3SGAFDMC.js.map} +1 -1
- package/dist/{search-6Y422SV6.js → search-5LC4XPB5.js} +3 -3
- package/dist/{search-6Y422SV6.js.map → search-5LC4XPB5.js.map} +1 -1
- package/dist/table/index.js +10 -9
- package/dist/table/index.js.map +1 -1
- package/dist/ui/index.d.ts +144 -11
- package/dist/ui/index.js +1339 -87
- package/dist/ui/index.js.map +1 -1
- package/dist/{upgrade-HCANX4GQ.js → upgrade-JHXZBGQS.js} +6 -6
- package/dist/{upgrade-HCANX4GQ.js.map → upgrade-JHXZBGQS.js.map} +1 -1
- package/dist/vite/index.d.ts +10 -0
- package/dist/vite/index.js +3 -3
- package/docs/en/components.md +29 -15
- package/docs/en/parts/data-table.md +22 -0
- package/docs/en/parts/delta.md +50 -0
- package/docs/en/parts/format.md +43 -0
- package/docs/en/parts/kpi-card.md +57 -0
- package/docs/en/parts/metric-value.md +3 -2
- package/docs/en/parts/sparkline.md +1 -1
- package/docs/en/parts/trend-indicator.md +17 -1
- package/docs/en/ui-and-theming.md +1 -1
- package/docs/index.json +366 -76
- package/docs/ja/changelog.md +31 -0
- package/docs/ja/components.md +57 -101
- package/docs/ja/page-types/csv.md +83 -0
- package/docs/ja/page-types/doc.md +83 -0
- package/docs/ja/page-types/excel.md +82 -0
- package/docs/ja/page-types/slide.md +132 -0
- package/docs/ja/page-types.md +47 -0
- package/docs/ja/parts/area-chart.md +61 -0
- package/docs/ja/parts/bar-chart.md +69 -0
- package/docs/ja/parts/bar-list.md +35 -0
- package/docs/ja/parts/category-bar.md +36 -0
- package/docs/ja/parts/data-table.md +22 -0
- package/docs/ja/parts/delta.md +50 -0
- package/docs/ja/parts/donut-chart.md +47 -0
- package/docs/ja/parts/echart.md +3 -0
- package/docs/ja/parts/format.md +44 -0
- package/docs/ja/parts/kpi-card.md +55 -0
- package/docs/ja/parts/line-chart.md +58 -0
- package/docs/ja/parts/metric-value.md +3 -2
- package/docs/ja/parts/progress-circle.md +34 -0
- package/docs/ja/parts/sparkline.md +2 -2
- package/docs/ja/parts/tracker.md +32 -0
- package/docs/ja/parts/trend-indicator.md +17 -1
- package/docs/ja/routing.md +8 -86
- package/docs/ja/ui/alert-dialog.md +41 -0
- package/docs/ja/ui/avatar.md +31 -0
- package/docs/ja/ui/combobox.md +74 -0
- package/docs/ja/ui/drawer.md +41 -0
- package/docs/ja/ui/field.md +42 -0
- package/docs/ja/ui/hover-card.md +21 -0
- package/docs/ja/ui/kbd.md +16 -0
- package/docs/ja/ui/pagination.md +36 -0
- package/docs/ja/ui/radio-group.md +21 -0
- package/docs/ja/ui/toast.md +46 -0
- package/docs/ja/ui-and-theming.md +14 -7
- package/package.json +13 -4
- package/registry/ui/accordion.tsx +76 -0
- package/registry/ui/alert-dialog.tsx +189 -0
- package/registry/ui/alert.tsx +80 -0
- package/registry/ui/app-shell.tsx +287 -0
- package/registry/ui/area-chart.tsx +3639 -0
- package/registry/ui/avatar.tsx +110 -0
- package/registry/ui/badge.tsx +56 -0
- package/registry/ui/bar-chart.tsx +3636 -0
- package/registry/ui/bar-list.tsx +3680 -0
- package/registry/ui/breadcrumb.tsx +128 -0
- package/registry/ui/button.tsx +62 -0
- package/registry/ui/calendar.tsx +223 -0
- package/registry/ui/card.tsx +107 -0
- package/registry/ui/category-bar.tsx +1255 -0
- package/registry/ui/chart-frame.tsx +1358 -0
- package/registry/ui/checkbox.tsx +30 -0
- package/registry/ui/collapsible.tsx +23 -0
- package/registry/ui/combobox.tsx +310 -0
- package/registry/ui/command.tsx +198 -0
- package/registry/ui/dashboard-card.tsx +217 -0
- package/registry/ui/data-table.tsx +693 -146
- package/registry/ui/date-range-picker.tsx +390 -0
- package/registry/ui/delta.tsx +188 -0
- package/registry/ui/dialog.tsx +161 -0
- package/registry/ui/donut-chart.tsx +3688 -0
- package/registry/ui/drawer.tsx +229 -0
- package/registry/ui/dropdown-menu.tsx +274 -0
- package/registry/ui/echart.tsx +890 -0
- package/registry/ui/field.tsx +240 -0
- package/registry/ui/filter-bar.tsx +392 -0
- package/registry/ui/funnel-steps.tsx +3541 -0
- package/registry/ui/heatmap.tsx +1752 -0
- package/registry/ui/hover-card.tsx +52 -0
- package/registry/ui/input-group.tsx +160 -0
- package/registry/ui/input.tsx +24 -0
- package/registry/ui/kbd.tsx +30 -0
- package/registry/ui/kpi-card.tsx +677 -0
- package/registry/ui/label.tsx +22 -0
- package/registry/ui/legend.tsx +3500 -0
- package/registry/ui/line-chart.tsx +3637 -0
- package/registry/ui/metric-value.tsx +62 -0
- package/registry/ui/multi-select.tsx +232 -0
- package/registry/ui/page-shell.tsx +282 -0
- package/registry/ui/pagination.tsx +140 -0
- package/registry/ui/placeholder.tsx +36 -0
- package/registry/ui/popover.tsx +92 -0
- package/registry/ui/progress-circle.tsx +867 -0
- package/registry/ui/progress.tsx +85 -0
- package/registry/ui/radio-group.tsx +39 -0
- package/registry/ui/sample-data.tsx +86 -0
- package/registry/ui/scatter-chart.tsx +4150 -0
- package/registry/ui/scroll-area.tsx +56 -0
- package/registry/ui/searchable-select.tsx +214 -0
- package/registry/ui/section-header.tsx +43 -0
- package/registry/ui/segmented-control.tsx +76 -0
- package/registry/ui/select.tsx +255 -0
- package/registry/ui/separator.tsx +27 -0
- package/registry/ui/sheet.tsx +139 -0
- package/registry/ui/sidebar.tsx +725 -0
- package/registry/ui/skeleton.tsx +17 -0
- package/registry/ui/slider.tsx +56 -0
- package/registry/ui/sparkline.tsx +230 -0
- package/registry/ui/spinner.tsx +14 -0
- package/registry/ui/states.tsx +90 -0
- package/registry/ui/status-badge.tsx +121 -0
- package/registry/ui/switch.tsx +34 -0
- package/registry/ui/table.tsx +118 -0
- package/registry/ui/tabs.tsx +84 -0
- package/registry/ui/textarea.tsx +22 -0
- package/registry/ui/toast.tsx +250 -0
- package/registry/ui/toggle-group.tsx +91 -0
- package/registry/ui/toggle.tsx +47 -0
- package/registry/ui/tooltip.tsx +68 -0
- package/registry/ui/tracker.tsx +843 -0
- package/registry/ui/trend-indicator.tsx +74 -0
- package/registry/ui/updated-at.tsx +122 -0
- package/registry/ui/waterfall-chart.tsx +4186 -0
- package/skills/vantage-add-feature/SKILL.md +9 -7
- package/skills/vantage-pitfalls/SKILL.md +5 -1
- package/templates/AGENTS.md +22 -1
- package/templates/agents/csv.md +2 -1
- package/templates/agents/doc.md +4 -3
- package/templates/agents/page.md +20 -6
- package/templates/agents/xlsx.md +2 -1
- package/theme.css +237 -136
- package/dist/add-DY4AXANK.js +0 -6
- package/dist/add-DY4AXANK.js.map +0 -1
- package/dist/chunk-5ZOP4SQR.js.map +0 -1
- package/dist/chunk-A2UUGASH.js.map +0 -1
- package/dist/chunk-DTDVSFRY.js.map +0 -1
- package/dist/chunk-LMUACBMA.js.map +0 -1
- package/dist/chunk-NKFBFDRZ.js +0 -2241
- package/dist/chunk-NKFBFDRZ.js.map +0 -1
- package/dist/chunk-PVTHHV7X.js.map +0 -1
- package/dist/chunk-PXRX5PEC.js.map +0 -1
- package/dist/chunk-QI3XQKHS.js.map +0 -1
- package/dist/chunk-RPZAALCX.js.map +0 -1
- package/dist/chunk-VA776YE5.js +0 -316
- package/dist/chunk-VA776YE5.js.map +0 -1
- package/dist/dev-GDKATCC7.js.map +0 -1
|
@@ -1,17 +1,47 @@
|
|
|
1
1
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
2
2
|
import * as React from 'react';
|
|
3
|
-
import { HTMLAttributes,
|
|
3
|
+
import { HTMLAttributes, ReactNode, ComponentType, ElementType, Ref, ReactElement, ComponentProps, SVGAttributes } from 'react';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
import { EChartsOption } from 'echarts';
|
|
6
6
|
export { EChartsOption } from 'echarts';
|
|
7
|
-
import { ColumnDef, SortingState, OnChangeFn, ColumnFiltersState, PaginationState, RowSelectionState, VisibilityState, TableMeta, Table } from '@tanstack/react-table';
|
|
7
|
+
import { RowData, ColumnDef, SortingState, OnChangeFn, ColumnFiltersState, PaginationState, RowSelectionState, VisibilityState, TableMeta, Table } from '@tanstack/react-table';
|
|
8
8
|
export { ColumnDef, ColumnFiltersState, PaginationState, RowSelectionState, SortingState, VisibilityState } from '@tanstack/react-table';
|
|
9
9
|
export { DateRange as RdpDateRange } from 'react-day-picker';
|
|
10
10
|
|
|
11
|
+
interface UpdatedAtProps {
|
|
12
|
+
/** When the data was last updated. */
|
|
13
|
+
at: Date | string | number;
|
|
14
|
+
/** `"relative"` (default): "23 分前に更新". `"absolute-first"`: "16:41 更新(23 分前)" — for pages where "now" matters. */
|
|
15
|
+
variant?: "relative" | "absolute-first";
|
|
16
|
+
/** IANA time zone (e.g. `"Asia/Tokyo"`) for the absolute time. Defaults to the runtime's zone. */
|
|
17
|
+
timeZone?: string;
|
|
18
|
+
/** Text placed before the label, e.g. `"売上データ: "`. */
|
|
19
|
+
prefix?: string;
|
|
20
|
+
/** Fixed "current time" for tests and fixtures. Disables the 60 s refresh. */
|
|
21
|
+
now?: Date | number;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const UpdatedAt: React.ForwardRefExoticComponent<UpdatedAtProps & React.RefAttributes<HTMLTimeElement>>;
|
|
25
|
+
|
|
11
26
|
interface PageShellProps extends HTMLAttributes<HTMLDivElement> {
|
|
12
27
|
}
|
|
13
28
|
declare const PageShell: React.ForwardRefExoticComponent<PageShellProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
29
|
interface PageShellHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
30
|
+
/** When the data was last updated. Drawn by `UpdatedAt` at the right end of the title row. */
|
|
31
|
+
updatedAt?: UpdatedAtProps["at"];
|
|
32
|
+
/** `"relative"` (default) or `"absolute-first"` ("16:41 更新(23 分前)") for pages where "now" matters. */
|
|
33
|
+
updatedAtVariant?: UpdatedAtProps["variant"];
|
|
34
|
+
/** IANA time zone for the absolute time of `updatedAt`. Defaults to the runtime's zone. */
|
|
35
|
+
timeZone?: string;
|
|
36
|
+
/** Where the data comes from. Shown as a chip "出典:○○" on the second row. */
|
|
37
|
+
source?: string;
|
|
38
|
+
/** The period the data covers. Shown as a chip "2026/9/23〜10/20" on the second row. */
|
|
39
|
+
period?: {
|
|
40
|
+
start: Date | string | number;
|
|
41
|
+
end: Date | string | number;
|
|
42
|
+
};
|
|
43
|
+
/** The page's overall state (an alert, a status badge). Shown on the third row; no row when absent. */
|
|
44
|
+
status?: ReactNode;
|
|
15
45
|
}
|
|
16
46
|
/**
|
|
17
47
|
* A wrapping flex row, not a two-column grid: when the heading cannot keep its
|
|
@@ -19,6 +49,11 @@ interface PageShellHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
19
49
|
* `1fr auto` grid would instead hand the heading whatever the end block leaves,
|
|
20
50
|
* and a CJK title — breakable between any two characters — collapses into a
|
|
21
51
|
* one-character column.
|
|
52
|
+
*
|
|
53
|
+
* The meta props (`updatedAt`, `source`, `period`, `status`) fix the order every
|
|
54
|
+
* page head shares: title and update time (right end) → source / period chips →
|
|
55
|
+
* overall status → summary cards. Empty rows are not drawn. Rows are placed with
|
|
56
|
+
* flex `order`, so they land before `PageShellSummary` whatever the child order.
|
|
22
57
|
*/
|
|
23
58
|
declare const PageShellHeader: React.ForwardRefExoticComponent<PageShellHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
24
59
|
interface PageShellHeadingProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -42,13 +77,8 @@ declare const PageShellActions: React.ForwardRefExoticComponent<PageShellActions
|
|
|
42
77
|
interface PageShellSummaryProps extends HTMLAttributes<HTMLDivElement> {
|
|
43
78
|
}
|
|
44
79
|
declare const PageShellSummary: React.ForwardRefExoticComponent<PageShellSummaryProps & React.RefAttributes<HTMLDivElement>>;
|
|
45
|
-
/**
|
|
46
|
-
* Accent colours are spelled out one utility set per colour rather than built
|
|
47
|
-
* from a template string — Tailwind only emits classes it can see literally in
|
|
48
|
-
* the source.
|
|
49
|
-
*/
|
|
50
80
|
declare const pageShellSummaryCardVariants: (props?: ({
|
|
51
|
-
accent?: "
|
|
81
|
+
accent?: "default" | "accent" | "amber" | "blue" | "emerald" | "red" | "violet" | "orange" | "cyan" | "slate" | "green" | "teal" | "sky" | "indigo" | "purple" | "pink" | "rose" | "yellow" | "lime" | "gray" | "zinc" | "neutral" | "stone" | "fuchsia" | null | undefined;
|
|
52
82
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
53
83
|
interface PageShellSummaryCardProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof pageShellSummaryCardVariants> {
|
|
54
84
|
}
|
|
@@ -57,6 +87,248 @@ interface PageShellContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
57
87
|
}
|
|
58
88
|
declare const PageShellContent: React.ForwardRefExoticComponent<PageShellContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
59
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Locale-aware number formatting shared by KPI cards, tables and charts. All
|
|
92
|
+
* shortening is delegated to `Intl.NumberFormat` (`notation: "compact"`); this
|
|
93
|
+
* module never hard-codes unit thresholds or unit strings.
|
|
94
|
+
*
|
|
95
|
+
* | `format` | input | ja-JP output |
|
|
96
|
+
* |--------------------------------------------|--------------|----------------|
|
|
97
|
+
* | `"compact"` (default) | `48_200_000` | `4,820万` |
|
|
98
|
+
* | `"number"` | `1234.567` | `1,234.57` |
|
|
99
|
+
* | `"currency"` (JPY, compact) | `48_200_000` | `¥4,820万` |
|
|
100
|
+
* | `{ type: "currency", notation: "standard" }` | `48_200_000` | `¥48,200,000` |
|
|
101
|
+
* | `{ type: "currency", currency: "USD" }` | `1234.5` | `$1,234.5` |
|
|
102
|
+
* | `"percent"` — pass a **ratio** | `0.124` | `12.4%` |
|
|
103
|
+
* | `{ type: "percent", digits: 0 }` | `0.124` | `12%` |
|
|
104
|
+
* | `"multiple"` | `1.5` | `1.5×` |
|
|
105
|
+
* | `{ type: "number", unit: "件" }` | `48_210` | `48,210件` |
|
|
106
|
+
* | `{ type: "compact", unit: "人" }` | `12_345` | `1.2万人` |
|
|
107
|
+
* | `"duration"` — pass **seconds** | `12_000` | `3時間20分` |
|
|
108
|
+
* | `{ type: "duration", durationUnit: "minute" }` | `2160` | `1.5日` |
|
|
109
|
+
*
|
|
110
|
+
* - `percent` takes a ratio (0.124 → 12.4%). Passing 12.4 renders 1,240%. The fraction
|
|
111
|
+
* digits are **fixed**, never trimmed (`PERCENT_DIGITS` = 1: 0.14 → "14.0%", never "14%"
|
|
112
|
+
* beside "11.9%"). Pass `digits` in the format to share another count across cards.
|
|
113
|
+
* - A minus sign is always U+2212 (`MINUS_SIGN`, "−1,234" / "−5.0%"), never the hyphen-minus.
|
|
114
|
+
* - `currency` defaults to JPY and to compact notation (万・億 in ja); pass
|
|
115
|
+
* `notation: "standard"` for every digit (tables, invoices). In ja-JP the yen
|
|
116
|
+
* sign is the half-width `¥`.
|
|
117
|
+
* - `unit` is a counter appended right after the number, with no space
|
|
118
|
+
* ("48,210件", "1.2万人"), for `number` / `compact` / `currency`. It is
|
|
119
|
+
* ignored for `percent` and `duration`, and for `multiple` it replaces the
|
|
120
|
+
* default `×` ("2.7倍"). Do not write it into a `valueFormatter` by hand.
|
|
121
|
+
* - Charts take the same `format` a KpiCard takes (`format="currency"`).
|
|
122
|
+
* `toValueFormatter(format)` turns it into a function for places that need
|
|
123
|
+
* one (a `valueFormatter`, table cells).
|
|
124
|
+
* - Missing values (null / undefined / NaN) render as `—` (`EMPTY_VALUE`).
|
|
125
|
+
* - Dates go through `formatDate` (`Intl.DateTimeFormat`): `"date"` → `2026/10/20`,
|
|
126
|
+
* `"datetime"` → `2026/10/20 14:30`, `"year-month"` → `2026年10月`, `"month"` → `10月`,
|
|
127
|
+
* `"year"` → `2026年`.
|
|
128
|
+
* - A period goes through `formatDateRange`: `2026/9/23〜10/20` (same year drops the end year),
|
|
129
|
+
* `2025/12/20〜2026/1/18` across years; month and day are not zero-padded.
|
|
130
|
+
*/
|
|
131
|
+
/**
|
|
132
|
+
* The kind of number a value is. Pick by what the number means, not by how
|
|
133
|
+
* long it is: `currency` for money, `percent` for a ratio, `multiple` for a
|
|
134
|
+
* factor ("1.5×"), `duration` for a length of time ("3時間20分"), `number` for
|
|
135
|
+
* exact counts in tables, `compact` (default) for large headline counts (万・億).
|
|
136
|
+
*/
|
|
137
|
+
type FormatKind = "number" | "compact" | "currency" | "percent" | "multiple" | "duration";
|
|
138
|
+
/** The unit a `duration` value is measured in. */
|
|
139
|
+
type DurationUnit = "second" | "minute" | "hour" | "day";
|
|
140
|
+
/**
|
|
141
|
+
* How to display a number: a `FormatKind` alone, or an object for digits,
|
|
142
|
+
* currency, notation and a counter. The same value is accepted by KpiCard,
|
|
143
|
+
* Delta, the charts (`format`) and `formatValue`.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* "currency" // ¥4,820万
|
|
147
|
+
* { type: "currency", notation: "standard" } // ¥48,200,000
|
|
148
|
+
* { type: "percent", digits: 1 } // 2.0%
|
|
149
|
+
* { type: "number", unit: "件" } // 48,210件
|
|
150
|
+
*/
|
|
151
|
+
type ValueFormat = FormatKind | {
|
|
152
|
+
type: FormatKind;
|
|
153
|
+
/** Fixed number of fraction digits. */
|
|
154
|
+
digits?: number;
|
|
155
|
+
/** ISO 4217 code for `currency`. Default `"JPY"`. */
|
|
156
|
+
currency?: string;
|
|
157
|
+
/** `currency` only: `"compact"` (default, 万・億) or `"standard"` (every digit). */
|
|
158
|
+
notation?: "compact" | "standard";
|
|
159
|
+
/** Counter appended after the number, e.g. `"件"`, `"人"`. Ignored for `percent` and `duration`. For `multiple` it replaces the default `×` (`"倍"` → `2.7倍`). */
|
|
160
|
+
unit?: string;
|
|
161
|
+
/** 値をこの数で割ってから整形する。例: `divisor: 100`(セント → ドル)。0 と非有限は無視。 */
|
|
162
|
+
divisor?: number;
|
|
163
|
+
/** `duration` only: the unit the value is in. Default `"second"`. Reads as "45秒" / "12分" / "3時間20分" / "1.5日" (`digits` sets the fraction digits of days). */
|
|
164
|
+
durationUnit?: DurationUnit;
|
|
165
|
+
};
|
|
166
|
+
/** Locale used when none is passed. Every function here takes a `locale` to override it. */
|
|
167
|
+
declare const DEFAULT_LOCALE = "ja-JP";
|
|
168
|
+
/** Shown in place of a missing value (null / undefined / NaN). */
|
|
169
|
+
declare const EMPTY_VALUE = "\u2014";
|
|
170
|
+
/** The minus sign every formatter writes (U+2212), so a negative never mixes with a hyphen-minus. */
|
|
171
|
+
declare const MINUS_SIGN = "\u2212";
|
|
172
|
+
/** Extra options for `formatValue`. */
|
|
173
|
+
interface FormatValueOptions {
|
|
174
|
+
/** `"auto"` (default) signs negatives only; `"exceptZero"` also writes `+` on positives (for differences). */
|
|
175
|
+
signDisplay?: "auto" | "exceptZero";
|
|
176
|
+
/** Round to this many significant digits (e.g. 3 for an estimate: 79,653,985 → 7,970万). */
|
|
177
|
+
significantDigits?: number;
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* The kind of a format, whether it was given as a string or an object. Use it
|
|
181
|
+
* to branch on the meaning of a metric (e.g. a `percent` metric compares in
|
|
182
|
+
* points) without unpacking `ValueFormat` yourself.
|
|
183
|
+
*
|
|
184
|
+
* @param format - The format as a KpiCard / chart takes it. `undefined` means the default.
|
|
185
|
+
* @returns The `FormatKind`; `"compact"` when `format` is omitted.
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* formatKind("percent") // "percent"
|
|
189
|
+
* formatKind({ type: "currency", notation: "standard" }) // "currency"
|
|
190
|
+
* formatKind(undefined) // "compact"
|
|
191
|
+
*/
|
|
192
|
+
declare function formatKind(format: ValueFormat | undefined): FormatKind;
|
|
193
|
+
/**
|
|
194
|
+
* Format a number for display — KPI values, table cells, chart labels and
|
|
195
|
+
* sentences built from data (titles, summaries). See the table at the top of
|
|
196
|
+
* this module.
|
|
197
|
+
*
|
|
198
|
+
* @param value - The number. `null` / `undefined` / `NaN` render as `—`.
|
|
199
|
+
* For `percent`, a ratio (0.124 means 12.4%).
|
|
200
|
+
* @param format - How to display it. Default `"compact"`.
|
|
201
|
+
* @param locale - BCP 47 locale. Default `"ja-JP"`.
|
|
202
|
+
* @param options - `signDisplay` and `significantDigits` (rounding for estimates).
|
|
203
|
+
* @returns The display string. In ja-JP the yen sign is the half-width `¥`.
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* formatValue(48_200_000, "currency") // "¥4,820万"
|
|
207
|
+
* formatValue(48_200_000, { type: "currency", notation: "standard" }) // "¥48,200,000"
|
|
208
|
+
* formatValue(0.021, "percent") // "2.1%"
|
|
209
|
+
* formatValue(0.124, "percent", "ja-JP", { signDisplay: "exceptZero" }) // "+12.4%"
|
|
210
|
+
* formatValue(79_653_985, "currency", "ja-JP", { significantDigits: 3 }) // "¥7,970万"
|
|
211
|
+
* formatValue(48_210, { type: "number", unit: "件" }) // "48,210件"
|
|
212
|
+
* formatValue(1.5, "multiple") // "1.5×"
|
|
213
|
+
* formatValue(null) // "—"
|
|
214
|
+
*/
|
|
215
|
+
declare function formatValue(value: number | null | undefined, format?: ValueFormat, locale?: string, options?: FormatValueOptions): string;
|
|
216
|
+
/**
|
|
217
|
+
* Like `formatValue`, but always signed (except zero) — for a difference
|
|
218
|
+
* between two values ("+¥530万", "−120件"). Use `formatPoints` instead for a
|
|
219
|
+
* difference between two rates.
|
|
220
|
+
*
|
|
221
|
+
* @param value - The difference (current − previous). Missing values render as `—`.
|
|
222
|
+
* @param format - Format of the metric itself. Default `"compact"`.
|
|
223
|
+
* @param locale - BCP 47 locale. Default `"ja-JP"`.
|
|
224
|
+
* @returns The signed display string; zero has no sign.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* formatDelta(5_300_000, "currency") // "+¥530万"
|
|
228
|
+
* formatDelta(-120, { type: "number", unit: "件" }) // "−120件"
|
|
229
|
+
* formatDelta(0.031, "percent") // "+3.1%"
|
|
230
|
+
* formatDelta(0, "currency") // "¥0"
|
|
231
|
+
*/
|
|
232
|
+
declare function formatDelta(value: number | null | undefined, format?: ValueFormat, locale?: string): string;
|
|
233
|
+
/**
|
|
234
|
+
* A difference between two rates in percentage points, always signed:
|
|
235
|
+
* `formatPoints(0.021 - 0.026)` → `"−0.5pt"`. Use it instead of a relative
|
|
236
|
+
* change for rate metrics (churn, conversion), where "−19.2%" reads as a drop
|
|
237
|
+
* of nineteen points. `signDisplay: "never"` drops the sign ("あと 0.5pt").
|
|
238
|
+
*
|
|
239
|
+
* @param difference - The difference of two **ratios** (0.021 − 0.026). Missing values render as `—`.
|
|
240
|
+
* @param locale - BCP 47 locale. Default `"ja-JP"`.
|
|
241
|
+
* @param options - `digits`: fixed fraction digits (default `PERCENT_DIGITS` = 1, so "0.0pt" / "+0.5pt"); `signDisplay`:
|
|
242
|
+
* `"exceptZero"` (default) or `"never"` when the sentence already says the direction.
|
|
243
|
+
* @returns The difference in points with the `pt` suffix.
|
|
244
|
+
*
|
|
245
|
+
* @example
|
|
246
|
+
* formatPoints(0.021 - 0.026) // "−0.5pt"
|
|
247
|
+
* formatPoints(0.031 - 0.026) // "+0.5pt"
|
|
248
|
+
* formatPoints(0.02 - 0.015, "ja-JP", { signDisplay: "never" }) // "0.5pt"(「目標まであと 0.5pt」)
|
|
249
|
+
*/
|
|
250
|
+
declare function formatPoints(difference: number | null | undefined, locale?: string, options?: {
|
|
251
|
+
digits?: number;
|
|
252
|
+
signDisplay?: "exceptZero" | "never";
|
|
253
|
+
}): string;
|
|
254
|
+
/**
|
|
255
|
+
* Binds a format and locale into a single-argument formatter, for a chart
|
|
256
|
+
* `valueFormatter` or a table cell: `valueFormatter={toValueFormatter("currency")}`.
|
|
257
|
+
* Prefer passing `format` to the chart directly; this is for APIs that only
|
|
258
|
+
* take a function.
|
|
259
|
+
*
|
|
260
|
+
* @param format - How to display each value. Default `"compact"`.
|
|
261
|
+
* @param locale - BCP 47 locale. Default `"ja-JP"`.
|
|
262
|
+
* @returns `(value) => string`, rendering missing values as `—`.
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* const yen = toValueFormatter("currency")
|
|
266
|
+
* yen(48_200_000) // "¥4,820万"
|
|
267
|
+
* yen(null) // "—"
|
|
268
|
+
* const count = toValueFormatter({ type: "number", unit: "件" })
|
|
269
|
+
* count(48_210) // "48,210件"(表のセル)
|
|
270
|
+
*/
|
|
271
|
+
declare function toValueFormatter(format?: ValueFormat, locale?: string): (value: number | null | undefined) => string;
|
|
272
|
+
/**
|
|
273
|
+
* 日付の書式。何を表す日付かで選ぶ: 日単位は `"date"`、時刻まで要るなら `"datetime"`、
|
|
274
|
+
* 月次の集計は `"year-month"`(年をまたぐ軸)か `"month"`(同じ年の中の軸)、年次は `"year"`。
|
|
275
|
+
*/
|
|
276
|
+
type DateStyle = "date" | "datetime" | "month" | "year-month" | "year";
|
|
277
|
+
/** `formatDate` の追加オプション。 */
|
|
278
|
+
interface FormatDateOptions {
|
|
279
|
+
/**
|
|
280
|
+
* IANA のタイムゾーン名(例: `"Asia/Tokyo"`)。既定は実行環境のタイムゾーン。
|
|
281
|
+
* サーバーとブラウザで描画が食い違う(SSR)なら固定する。日付だけの文字列(`"2026-10-20"`)には効かず、常にその暦日のまま出す。
|
|
282
|
+
*/
|
|
283
|
+
timeZone?: string;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* 日付を表示用の文字列にする。表のセル・タイトル・文に埋める日付に使い、`toLocaleString` や手組みの
|
|
287
|
+
* `getMonth() + 1` は使わない。
|
|
288
|
+
*
|
|
289
|
+
* @param value - `Date`、エポックミリ秒、または日付文字列(`"2026-10-20"`、ISO 8601)。`null` / `undefined` / 解釈できない値は `—`。
|
|
290
|
+
* @param style - 何を表す日付か。既定 `"date"`。
|
|
291
|
+
* @param locale - BCP 47 ロケール。既定 `"ja-JP"`。
|
|
292
|
+
* @param options - `timeZone`。
|
|
293
|
+
* @returns 表示文字列。
|
|
294
|
+
*
|
|
295
|
+
* @example
|
|
296
|
+
* formatDate("2026-10-20") // "2026/10/20"
|
|
297
|
+
* formatDate(new Date("2026-10-20T05:30:00Z"), "datetime", "ja-JP", { timeZone: "Asia/Tokyo" }) // "2026/10/20 14:30"
|
|
298
|
+
* formatDate("2026-10-01", "year-month") // "2026年10月"
|
|
299
|
+
* formatDate("2026-10-01", "month") // "10月"
|
|
300
|
+
* formatDate(null) // "—"
|
|
301
|
+
*/
|
|
302
|
+
declare function formatDate(value: Date | string | number | null | undefined, style?: DateStyle, locale?: string, options?: FormatDateOptions): string;
|
|
303
|
+
/** `formatDateRange` のオプション。 */
|
|
304
|
+
interface FormatDateRangeOptions extends FormatDateOptions {
|
|
305
|
+
/** BCP 47 ロケール。既定 `"ja-JP"`。 */
|
|
306
|
+
locale?: string;
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* 期間を「2026/9/23〜10/20」の形にする。同じ年なら終了側の年を省き、年をまたぐときは両方に付ける。
|
|
310
|
+
* 月日はゼロ詰めしない。区切りは日本語で「〜」、それ以外のロケールでは「 – 」。始まりと終わりが同じ日なら 1 日だけ出す。
|
|
311
|
+
*
|
|
312
|
+
* @param start - 期間の最初の日(`Date`、エポックミリ秒、日付文字列)。`"2026-09-23"` のような日付だけの文字列はその暦日のまま出す。
|
|
313
|
+
* @param end - 期間の最後の日。
|
|
314
|
+
* @param options - `locale` と `timeZone`。
|
|
315
|
+
* @returns 表示文字列。どちらかが解釈できなければ `—`。
|
|
316
|
+
*
|
|
317
|
+
* @example
|
|
318
|
+
* formatDateRange("2026-09-23", "2026-10-20") // "2026/9/23〜10/20"
|
|
319
|
+
* formatDateRange("2025-12-20", "2026-01-18") // "2025/12/20〜2026/1/18"
|
|
320
|
+
*/
|
|
321
|
+
declare function formatDateRange(start: Date | string | number | null | undefined, end: Date | string | number | null | undefined, options?: FormatDateRangeOptions): string;
|
|
322
|
+
/**
|
|
323
|
+
* 文中の ISO の年月・日付(`2023-04`、`2026-10-20`)を `formatDate` の書式に置き換える。期間や出典の注記のように、
|
|
324
|
+
* 利用者が文字列で渡す文に日付が混ざるときの表示用(`"2023-04 以降"` → `"2023年4月 以降"`)。日付でない数字は触らない。
|
|
325
|
+
*
|
|
326
|
+
* @param text - 日付を含みうる文。
|
|
327
|
+
* @param locale - BCP 47 ロケール。既定 `"ja-JP"`。
|
|
328
|
+
* @returns ISO の年月は `"year-month"`、年月日は `"date"` で整形した文。
|
|
329
|
+
*/
|
|
330
|
+
declare function formatDatesInText(text: string, locale?: string): string;
|
|
331
|
+
|
|
60
332
|
/**
|
|
61
333
|
* Shared data shapes for the composite dashboard components. Kept in one place
|
|
62
334
|
* so filters, metrics and date pickers agree on the same vocabulary.
|
|
@@ -80,6 +352,8 @@ interface FilterConfig {
|
|
|
80
352
|
options?: FilterOption[];
|
|
81
353
|
/** Placeholder text */
|
|
82
354
|
placeholder?: string;
|
|
355
|
+
/** `select` のみ。渡すと先頭に「絞り込まない」項目をこの文言で足す(例: `"すべて"`)。 */
|
|
356
|
+
allLabel?: string;
|
|
83
357
|
/** Default value */
|
|
84
358
|
defaultValue?: string | string[];
|
|
85
359
|
}
|
|
@@ -162,6 +436,187 @@ interface SelectOptionGroup {
|
|
|
162
436
|
type SelectOptions = SelectOption[] | SelectOptionGroup[];
|
|
163
437
|
declare function isGroupedOptions(options: SelectOptions): options is SelectOptionGroup[];
|
|
164
438
|
declare function flattenOptions(options: SelectOptions): SelectOption[];
|
|
439
|
+
/**
|
|
440
|
+
* A chart colour: one of the theme's series tokens (`"chart-1"`〜`"chart-5"`,
|
|
441
|
+
* which follow light/dark) or any CSS colour (`"#16a34a"`, `"var(--destructive)"`).
|
|
442
|
+
* Not a Tailwind class — the ECharts-based charts paint on a canvas.
|
|
443
|
+
*/
|
|
444
|
+
type ChartColor = "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5" | (string & {});
|
|
445
|
+
/** Formats a value for tooltips, axes and labels (e.g. `(v) => \`¥${v.toLocaleString()}\``). */
|
|
446
|
+
type ValueFormatter = (value: number) => string;
|
|
447
|
+
/** What a typed chart reports through `onValueChange`; `null` when the selection is cleared. */
|
|
448
|
+
type ChartEventPayload = {
|
|
449
|
+
/** What was clicked: a bar, a line/area point, or a donut slice. */
|
|
450
|
+
eventType: "bar" | "dot" | "slice";
|
|
451
|
+
/** The series (`categories` entry) or slice name that was clicked. */
|
|
452
|
+
categoryClicked: string;
|
|
453
|
+
/** The clicked row of `data`, spread in. */
|
|
454
|
+
[key: string]: unknown;
|
|
455
|
+
} | null;
|
|
456
|
+
/** The theme's series tokens — the only colours a typed chart's `colors` accepts. Fixed order. */
|
|
457
|
+
type ChartColorToken = "chart-1" | "chart-2" | "chart-3" | "chart-4" | "chart-5";
|
|
458
|
+
/**
|
|
459
|
+
* 意味色。`"positive"`(良い)・`"warning"`(注意)・`"negative"`(悪い)・`"neutral"`(中立)。
|
|
460
|
+
* テーマの `--positive` / `--warning` / `--negative` / `--neutral` に解決され、light/dark に追従する。
|
|
461
|
+
*/
|
|
462
|
+
type ChartTone = "positive" | "warning" | "negative" | "neutral";
|
|
463
|
+
/** A typed chart's series colour: a series token or a meaning colour (`ChartTone`). */
|
|
464
|
+
type ChartSeriesColor = ChartColorToken | ChartTone;
|
|
465
|
+
/**
|
|
466
|
+
* Series colours for a typed chart: tokens / meaning colours by series position
|
|
467
|
+
* (cycled), or a record from category to colour (unlisted categories keep their
|
|
468
|
+
* positional token).
|
|
469
|
+
*/
|
|
470
|
+
type ChartColors<T extends Record<string, unknown> = Record<string, unknown>> = ChartSeriesColor[] | Partial<Record<keyof T & string, ChartSeriesColor>>;
|
|
471
|
+
/**
|
|
472
|
+
* 値の範囲で棒・セルの色(意味色)を決める 1 つの規則。`lt`(未満)・`lte`(以下)・`gt`(より大きい)・`gte`(以上)を
|
|
473
|
+
* 1 つ以上書く。複数書いたら全部を満たす値だけが当たる(`gte: 40, lt: 70` なら `40 <= 値 < 70`)。
|
|
474
|
+
* 規則は配列の上から順に見て、**最初に当たった規則**の意味色になる(どれにも当たらない値は通常色)。
|
|
475
|
+
* そのため厳しい規則(`gt: 10`)を先に、ゆるい規則(`gt: 7`)を後に書く。条件が 1 つも無い規則は当たらない。
|
|
476
|
+
* 例 `[{ gt: 10, tone: "negative" }, { gt: 7, tone: "warning" }]`(10 超は赤、7 超は黄)
|
|
477
|
+
*/
|
|
478
|
+
interface ChartThreshold {
|
|
479
|
+
/** この値未満に当たる。 */
|
|
480
|
+
lt?: number;
|
|
481
|
+
/** この値以下に当たる。 */
|
|
482
|
+
lte?: number;
|
|
483
|
+
/** この値より大きいときに当たる(「10% 超で赤」)。 */
|
|
484
|
+
gt?: number;
|
|
485
|
+
/** この値以上に当たる。 */
|
|
486
|
+
gte?: number;
|
|
487
|
+
tone: ChartTone;
|
|
488
|
+
}
|
|
489
|
+
/** What an empty chart says instead of a blank plot. The frame keeps its height. */
|
|
490
|
+
interface ChartEmptyState {
|
|
491
|
+
/** 既定「表示できるデータがありません」。 */
|
|
492
|
+
title?: string;
|
|
493
|
+
description?: string;
|
|
494
|
+
/** 1 つだけ置ける操作(「期間を広げる」ボタンなど)。 */
|
|
495
|
+
action?: ReactNode;
|
|
496
|
+
}
|
|
497
|
+
/** `"auto"`: label the max and latest point of the first series (≤ 2 series only). */
|
|
498
|
+
type ChartHighlight = "auto" | "none";
|
|
499
|
+
/** A forecast row: the same `index` key as `data`, plus the predicted value and an optional range. */
|
|
500
|
+
type ChartForecastRow = Record<string, unknown> & {
|
|
501
|
+
value: number | null;
|
|
502
|
+
lower?: number;
|
|
503
|
+
upper?: number;
|
|
504
|
+
};
|
|
505
|
+
/**
|
|
506
|
+
* Forecast continuing one series (Line / Area). Always drawn as a 2px dashed, lighter
|
|
507
|
+
* line starting at the last actual point, with a boundary line labelled 「予測 →」
|
|
508
|
+
* (the same word as the legend) — there is no way to draw it solid.
|
|
509
|
+
*/
|
|
510
|
+
interface ChartForecast<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
511
|
+
/** 予測の行。`index` の列は実績と同じキーで持つ。 */
|
|
512
|
+
data: ChartForecastRow[];
|
|
513
|
+
/** 予測が続ける系列。既定 `categories[0]`(比較系列は除く)。 */
|
|
514
|
+
category?: keyof T & string;
|
|
515
|
+
/** 凡例・ツールチップ・境目の縦線の上端に出す名前。既定「予測」(境目では「予測 →」と矢印が付く)。 */
|
|
516
|
+
label?: string;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* The series a Line / Area chart compares the others against (last year, the plan…): `category`
|
|
520
|
+
* is one of `categories`, `vs` says what it is (the same enum as `KpiCard`'s `comparison.vs`).
|
|
521
|
+
* It is drawn as a thin muted line with no markers and no `--chart-*` colour, and the tooltip adds
|
|
522
|
+
* the main series' difference from it ("↑ +12.4% 前年同月比"). Colour, width and wording are not props.
|
|
523
|
+
* With `vs: "custom"` the `label` names the baseline ("昨日比"); for the other `vs` it is optional.
|
|
524
|
+
*/
|
|
525
|
+
type ChartComparison<K extends string = string> = {
|
|
526
|
+
category: K;
|
|
527
|
+
} & ({
|
|
528
|
+
vs: "prior-period" | "prior-year" | "target";
|
|
529
|
+
label?: string;
|
|
530
|
+
} | {
|
|
531
|
+
vs: "custom";
|
|
532
|
+
label: string;
|
|
533
|
+
});
|
|
534
|
+
/**
|
|
535
|
+
* 任意の位置への注記(折れ線・面・縦の棒)。`at` は `index` の値(例 `"2026-04"`)。`to` を足すと
|
|
536
|
+
* `at`〜`to` の区間(薄い帯)、無ければ `at` の位置の縦線。色は中立(意味色は使わない)で、
|
|
537
|
+
* `index` に無い値の注記は描かない。例 `{ at: "2026-04", label: "料金改定" }`、
|
|
538
|
+
* `{ at: "2026-08", to: "2026-09", label: "キャンペーン" }`
|
|
539
|
+
*/
|
|
540
|
+
interface ChartAnnotation {
|
|
541
|
+
/** 注記の位置(区間なら始点)。`index` 列の値と同じ形で渡す。 */
|
|
542
|
+
at: string | number;
|
|
543
|
+
/** 注記の文言(短く。事実の記述だけ)。 */
|
|
544
|
+
label: string;
|
|
545
|
+
/** 区間の終点(`index` の値)。省略すると `at` の縦線。 */
|
|
546
|
+
to?: string | number;
|
|
547
|
+
}
|
|
548
|
+
/**
|
|
549
|
+
* `actions` に渡せる PNG 操作の設定。`actions={true}` は `{}` と同じ。
|
|
550
|
+
*/
|
|
551
|
+
interface ChartActionsOptions {
|
|
552
|
+
/**
|
|
553
|
+
* 保存・コピーする PNG に、グラフの見出し(`title`)と要約(`summary`)を画像の上に含める。
|
|
554
|
+
* 見出しが無いグラフでは何も変わらない。既定 `true`(画像だけ切り出されても何のグラフか分かるように)。
|
|
555
|
+
* 図だけが欲しいときは `false`。
|
|
556
|
+
*/
|
|
557
|
+
includeTitle?: boolean;
|
|
558
|
+
}
|
|
559
|
+
/**
|
|
560
|
+
* 型付きグラフのルート要素(`<figure>`)へ渡る属性。`data-*` と `aria-*` も渡る(型は不要)。
|
|
561
|
+
* 最小限だけ型に出す。`className` / `ariaLabel` は別に持つ。
|
|
562
|
+
*/
|
|
563
|
+
type ChartRootAttributes = Pick<HTMLAttributes<HTMLElement>, "id" | "style" | "role" | "tabIndex" | "lang" | "hidden">;
|
|
564
|
+
/**
|
|
565
|
+
* Columns of `T` whose values are numbers (null / undefined allowed for gaps).
|
|
566
|
+
* `categories` only accepts these, so a text column like `"month"` is a type error.
|
|
567
|
+
* Untyped rows (`unknown` / `any` values, e.g. `Record<string, unknown>`) keep every key.
|
|
568
|
+
*/
|
|
569
|
+
type NumericKeys<T> = {
|
|
570
|
+
[K in keyof T]-?: unknown extends T[K] ? K : T[K] extends number | bigint | null | undefined ? K : never;
|
|
571
|
+
}[keyof T] & string;
|
|
572
|
+
/** Props every typed chart shares. Per-type differences live in `areaOptions` / `lineOptions` / `barOptions`. */
|
|
573
|
+
interface ChartCommonProps<T extends Record<string, unknown> = Record<string, unknown>> extends ChartRootAttributes {
|
|
574
|
+
/** 行の配列。1 行 = x 軸の 1 点。数値の列は number か数値文字列(SQL の DECIMAL など)。 */
|
|
575
|
+
data: T[];
|
|
576
|
+
/** x 軸(カテゴリ軸)に使う列名。 */
|
|
577
|
+
index: keyof T & string;
|
|
578
|
+
/** 系列として描く列名。並び順が凡例と配色の順になる。6 つ以上は合計の大きい 5 つ +「その他」にまとめる。 */
|
|
579
|
+
categories: NumericKeys<T>[];
|
|
580
|
+
/** 系列色(`"chart-1"`〜`"chart-5"` か意味色 `"positive"` / `"warning"` / `"negative"` / `"neutral"`)。配列は系列の順、record は系列名ごと。省略時はトークン順。 */
|
|
581
|
+
colors?: ChartColors<T>;
|
|
582
|
+
/**
|
|
583
|
+
* index の値・系列名 → 表示名(軸・凡例・ツールチップ・データ表に反映)。例 `{ jan: "1月", sales: "売上" }`。無いキーはそのまま。
|
|
584
|
+
*/
|
|
585
|
+
labels?: Record<string, string>;
|
|
586
|
+
/**
|
|
587
|
+
* 数値の書式(`"compact"` / `"number"` / `"currency"` / `"percent"` / `"multiple"` / `"duration"`、
|
|
588
|
+
* または `{ type, digits, currency, notation, unit, divisor, durationUnit }`)。例 `format={{ type: "number", unit: "件" }}`。
|
|
589
|
+
* 軸は短縮、ツールチップも同じ書式。KPI 系の `format` と同じ値を渡せる。既定 `"compact"`。
|
|
590
|
+
*/
|
|
591
|
+
format?: ValueFormat;
|
|
592
|
+
/** 書式を関数で直接渡す逃げ道。`format` より優先する(互換のために残す)。 */
|
|
593
|
+
valueFormatter?: ValueFormatter;
|
|
594
|
+
/** グラフの見出し。 */
|
|
595
|
+
title?: string;
|
|
596
|
+
/** グラフが言っていることの 1 文要約。見出しの下に出し、グラフの `aria-describedby` になる。 */
|
|
597
|
+
summary?: string;
|
|
598
|
+
/** 読み込み中。最終形と同じ形・高さのスケルトンを出す。 */
|
|
599
|
+
isLoading?: boolean;
|
|
600
|
+
/** `data` が空のときの表示。 */
|
|
601
|
+
emptyState?: ChartEmptyState;
|
|
602
|
+
/**
|
|
603
|
+
* プロット領域の高さ(px)。既定 288。
|
|
604
|
+
* 文字列(CSS の長さ)は互換のために受けるだけで非推奨 — 数値(px)で渡す。
|
|
605
|
+
*/
|
|
606
|
+
height?: number | string;
|
|
607
|
+
/** 生成した EChartsOption に最後に深くマージする逃げ道。 */
|
|
608
|
+
chartOptions?: EChartsOption;
|
|
609
|
+
/**
|
|
610
|
+
* グラフ右上に PNG 保存/コピーのボタンを出す(ホバー時。凡例とは重ならない)。既定 `false`。
|
|
611
|
+
* 見出し(`title` / `summary`)があれば PNG の上に含める。含めないなら `actions={{ includeTitle: false }}`。
|
|
612
|
+
* 例: `actions`
|
|
613
|
+
*/
|
|
614
|
+
actions?: boolean | ChartActionsOptions;
|
|
615
|
+
/** PNG 保存時のファイル名(拡張子つき)。`actions` と使う。既定 `"chart.png"`。例: `fileName="monthly-sales.png"` */
|
|
616
|
+
fileName?: string;
|
|
617
|
+
className?: string;
|
|
618
|
+
ariaLabel?: string;
|
|
619
|
+
}
|
|
165
620
|
|
|
166
621
|
interface AppShellSidebarProps {
|
|
167
622
|
variant?: "sidebar";
|
|
@@ -189,7 +644,7 @@ declare const AppShell: React.ForwardRefExoticComponent<AppShellProps & React.Re
|
|
|
189
644
|
|
|
190
645
|
declare const headingStyles: {
|
|
191
646
|
readonly h1: "text-3xl font-bold tracking-tight";
|
|
192
|
-
readonly h2: "text-
|
|
647
|
+
readonly h2: "text-xl font-semibold tracking-tight";
|
|
193
648
|
readonly h3: "text-xl font-semibold";
|
|
194
649
|
readonly h4: "text-lg font-semibold";
|
|
195
650
|
};
|
|
@@ -203,6 +658,10 @@ interface SectionHeaderProps {
|
|
|
203
658
|
declare const SectionHeader: React.ForwardRefExoticComponent<SectionHeaderProps & React.RefAttributes<HTMLDivElement>>;
|
|
204
659
|
|
|
205
660
|
interface DashboardCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
661
|
+
/** 親の grid の何行にまたがって subgrid で揃えるか(ヘッダー・本文・フッターなら 3、ヘッダー・本文なら 2)。未指定なら通常のブロック。 */
|
|
662
|
+
subgrid?: 2 | 3;
|
|
663
|
+
/** `"sm"` は一段小さい余白。Sheet の中などで 2 枚を横に並べるとき。既定 `"default"`。 */
|
|
664
|
+
size?: "default" | "sm";
|
|
206
665
|
}
|
|
207
666
|
declare const DashboardCard: React.ForwardRefExoticComponent<DashboardCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
208
667
|
interface DashboardCardHeaderProps extends HTMLAttributes<HTMLDivElement> {
|
|
@@ -227,7 +686,7 @@ interface DashboardCardSkeletonProps {
|
|
|
227
686
|
className?: string;
|
|
228
687
|
}
|
|
229
688
|
declare function DashboardCardSkeleton({ className }: DashboardCardSkeletonProps): React.JSX.Element;
|
|
230
|
-
interface DashboardCardPresetProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
689
|
+
interface DashboardCardPresetProps extends Omit<HTMLAttributes<HTMLDivElement>, "title">, Pick<DashboardCardProps, "subgrid" | "size"> {
|
|
231
690
|
title?: ReactNode;
|
|
232
691
|
description?: ReactNode;
|
|
233
692
|
actions?: ReactNode;
|
|
@@ -236,7 +695,7 @@ interface DashboardCardPresetProps extends Omit<HTMLAttributes<HTMLDivElement>,
|
|
|
236
695
|
contentClassName?: string;
|
|
237
696
|
footerClassName?: string;
|
|
238
697
|
}
|
|
239
|
-
declare function DashboardCardPreset({ title, description, actions, footer, children, headerClassName, contentClassName, footerClassName, className, ...props }: DashboardCardPresetProps): React.JSX.Element;
|
|
698
|
+
declare function DashboardCardPreset({ title, description, actions, footer, children, headerClassName, contentClassName, footerClassName, className, subgrid, ...props }: DashboardCardPresetProps): React.JSX.Element;
|
|
240
699
|
|
|
241
700
|
interface EChartProps {
|
|
242
701
|
/**
|
|
@@ -247,7 +706,7 @@ interface EChartProps {
|
|
|
247
706
|
* literal が `string` に拡張され、ビルドが失敗する。
|
|
248
707
|
*
|
|
249
708
|
* @example
|
|
250
|
-
* import type { EChartsOption } from "
|
|
709
|
+
* import type { EChartsOption } from "@/components/echart"
|
|
251
710
|
*
|
|
252
711
|
* const option: EChartsOption = {
|
|
253
712
|
* xAxis: { type: "category", data: ["A", "B"] },
|
|
@@ -278,19 +737,888 @@ interface EChartProps {
|
|
|
278
737
|
onEvents?: Record<string, (params: unknown) => void>;
|
|
279
738
|
ariaLabel?: string;
|
|
280
739
|
className?: string;
|
|
281
|
-
/**
|
|
282
|
-
|
|
740
|
+
/**
|
|
741
|
+
* true にするとチャート右上に PNG コピー / ダウンロードボタンを表示する。
|
|
742
|
+
* `exportHeader` があれば PNG の上にその見出しを含める(`{ includeTitle: false }` で含めない)。
|
|
743
|
+
*/
|
|
744
|
+
actions?: boolean | ChartActionsOptions;
|
|
283
745
|
/** ダウンロード時のファイル名(拡張子含む)。省略時は "chart.png" */
|
|
284
746
|
fileName?: string;
|
|
747
|
+
/**
|
|
748
|
+
* PNG の上に含める見出しと要約。型付きグラフは自分の `title` / `summary` を渡す。
|
|
749
|
+
* 自分で `ChartFrame` を組むときも同じものを渡すと、保存した画像だけで何のグラフか分かる。
|
|
750
|
+
*/
|
|
751
|
+
exportHeader?: ChartExportHeader;
|
|
752
|
+
}
|
|
753
|
+
/** The heading a saved PNG carries above the plot. */
|
|
754
|
+
interface ChartExportHeader {
|
|
755
|
+
title?: string;
|
|
756
|
+
summary?: string;
|
|
285
757
|
}
|
|
758
|
+
/**
|
|
759
|
+
* Canvas-safe versions of theme colours, kept current across light/dark.
|
|
760
|
+
* Takes `"chart-1"`〜`"chart-5"`, `"var(--token)"` or any CSS colour; one that
|
|
761
|
+
* can't be resolved comes back as `""` (ECharts then uses the palette).
|
|
762
|
+
* Use it whenever a colour goes into a raw `EChart` option by hand.
|
|
763
|
+
*
|
|
764
|
+
* @example
|
|
765
|
+
* const [line, band] = useResolvedChartColors(["chart-1", "var(--muted-foreground)"])
|
|
766
|
+
*/
|
|
767
|
+
declare function useResolvedChartColors(colors: readonly string[]): string[];
|
|
286
768
|
declare const EChart: React.ForwardRefExoticComponent<EChartProps & React.RefAttributes<HTMLDivElement>>;
|
|
287
769
|
|
|
770
|
+
/**
|
|
771
|
+
* Period-over-period / target comparison for KPIs. A rate is only produced when
|
|
772
|
+
* the baseline is a non-zero number; small moves inside the neutral band read
|
|
773
|
+
* as flat, and polarity decides whether up is good or bad.
|
|
774
|
+
*
|
|
775
|
+
* Labels follow Japanese business usage and come from the grain of the period:
|
|
776
|
+
* a monthly KPI compares "前月比" / "前年同月比", a quarterly one "前四半期比" /
|
|
777
|
+
* "前年同期比". Without a grain the label is the generic "前期比".
|
|
778
|
+
*
|
|
779
|
+
* A running total of a period still in progress (年初来・月初来 = YTD / MTD) sets
|
|
780
|
+
* `toDate: true`: a `prior-year` baseline is then the same stretch of the prior year,
|
|
781
|
+
* and the label is always "前年同期比" (never "前年比", which would mean a whole year
|
|
782
|
+
* against a whole year), whatever the grain.
|
|
783
|
+
*
|
|
784
|
+
* Any other baseline is `vs: "custom"` with a `label` ("昨日比"). The baseline of
|
|
785
|
+
* the previous-actual line is derived from that label ("昨日"), so the badge and
|
|
786
|
+
* the line never name different things.
|
|
787
|
+
*/
|
|
788
|
+
|
|
789
|
+
type ComparisonKind = "prior-period" | "prior-year" | "target" | "custom";
|
|
790
|
+
/**
|
|
791
|
+
* 増減の良し悪しの向き。`"neutral"` は増減どちらでも sentiment を neutral にする(例: 在庫数)。
|
|
792
|
+
* @example polarity="neutral"
|
|
793
|
+
*/
|
|
794
|
+
type Polarity = "higher-is-better" | "lower-is-better" | "neutral";
|
|
795
|
+
/** Length of the period a value covers. */
|
|
796
|
+
type PeriodGrain = "day" | "week" | "month" | "quarter" | "year";
|
|
797
|
+
interface ComparisonBase {
|
|
798
|
+
previous: number | null | undefined;
|
|
799
|
+
/** Grain of the period, which picks the label: `"month"` → "前月比" / "前年同月比". */
|
|
800
|
+
grain?: PeriodGrain;
|
|
801
|
+
/**
|
|
802
|
+
* The value is a running total of the period so far (年初来・月初来), not a closed period.
|
|
803
|
+
* With `vs: "prior-year"` the label is "前年同期比" (the same stretch of last year) whatever the `grain`.
|
|
804
|
+
* Leave it off for a closed period: a full year against the prior year is "前年比".
|
|
805
|
+
*/
|
|
806
|
+
toDate?: boolean;
|
|
807
|
+
}
|
|
808
|
+
type Comparison = (ComparisonBase & {
|
|
809
|
+
vs: Exclude<ComparisonKind, "custom">;
|
|
810
|
+
/** The badge's full name ("先週比"). Overrides the derived label; the previous-actual line takes its name from it too. */
|
|
811
|
+
label?: string;
|
|
812
|
+
}) | (ComparisonBase & {
|
|
813
|
+
/** Any other baseline ("昨日", "先週の同じ曜日"): the `label` names it. */
|
|
814
|
+
vs: "custom";
|
|
815
|
+
/** The badge's full name: `"昨日比"` / `"先週の同じ曜日比"`. The previous-actual line drops one trailing "比" ("昨日 617"). */
|
|
816
|
+
label: string;
|
|
817
|
+
});
|
|
818
|
+
/** Labels used when the grain is unknown. A `custom` comparison always brings its own `label`. */
|
|
819
|
+
declare const COMPARISON_LABELS: Record<Exclude<ComparisonKind, "custom">, string>;
|
|
820
|
+
/**
|
|
821
|
+
* What the previous value is called: "前月" / "前年同月" / "目標"; with a `label`, that label minus one trailing "比" ("昨日比" → "昨日").
|
|
822
|
+
* `toDate` (a running total such as YTD) turns a `prior-year` baseline into "前年同期" whatever the grain.
|
|
823
|
+
*/
|
|
824
|
+
declare function comparisonBaseline(vs: ComparisonKind, grain?: PeriodGrain, label?: string, toDate?: boolean): string;
|
|
825
|
+
/**
|
|
826
|
+
* The comparison label: "前月比" for `("prior-period", "month")`, "前期比" without a grain; a given `label` as is.
|
|
827
|
+
* A running total (`toDate`) against the prior year is "前年同期比", not "前年比".
|
|
828
|
+
*/
|
|
829
|
+
declare function comparisonLabel(vs: ComparisonKind, grain?: PeriodGrain, label?: string, toDate?: boolean): string;
|
|
830
|
+
type DeltaDirection = "up" | "down" | "flat" | "none";
|
|
831
|
+
type DeltaSentiment = "positive" | "negative" | "neutral";
|
|
832
|
+
interface ComparisonResult {
|
|
833
|
+
current: number | null;
|
|
834
|
+
previous: number | null;
|
|
835
|
+
/** `current − previous` in the metric's own unit (a ratio difference for a rate). `null` when either is missing. */
|
|
836
|
+
difference: number | null;
|
|
837
|
+
/** `difference / |previous|`. `null` when it cannot be computed (missing values or a zero baseline). */
|
|
838
|
+
ratio: number | null;
|
|
839
|
+
direction: DeltaDirection;
|
|
840
|
+
sentiment: DeltaSentiment;
|
|
841
|
+
label: string;
|
|
842
|
+
vs: ComparisonKind;
|
|
843
|
+
}
|
|
844
|
+
interface ComparisonOptions {
|
|
845
|
+
polarity?: Polarity;
|
|
846
|
+
/** Absolute ratio below which the change reads as flat (0.01 = 1%). Default 0.01. */
|
|
847
|
+
neutralBand?: number;
|
|
848
|
+
}
|
|
849
|
+
declare function computeComparison(current: number | null | undefined, comparison: Comparison, options?: ComparisonOptions): ComparisonResult;
|
|
850
|
+
/**
|
|
851
|
+
* How a change is expressed: `"relative"` = change rate ("+12.4%"), `"points"` =
|
|
852
|
+
* difference of two rates in percentage points ("−0.5pt"), `"difference"` =
|
|
853
|
+
* absolute difference in the metric's own format ("+¥530万"; pass `format` to `formatChange`).
|
|
854
|
+
*/
|
|
855
|
+
type ChangeDisplay = "relative" | "points" | "difference";
|
|
856
|
+
/** `"points"` for a `percent` metric (a rate), else `"relative"`. */
|
|
857
|
+
declare function defaultChangeDisplay(format: ValueFormat | undefined): ChangeDisplay;
|
|
858
|
+
/**
|
|
859
|
+
* The change as shown next to a KPI: "+12.4%" (relative) or "−0.5pt" (points).
|
|
860
|
+
* Returns `null` when the values cannot be compared.
|
|
861
|
+
*
|
|
862
|
+
* @param digits - Fixed fraction digits of the change, for `"relative"` and `"points"`
|
|
863
|
+
* (not `"difference"`, which follows `format`). Default `PERCENT_DIGITS` (1), so
|
|
864
|
+
* "+14.0%" and "+11.9%" line up. Pass the same count to every card in a group.
|
|
865
|
+
*/
|
|
866
|
+
declare function formatChange(result: ComparisonResult, display?: ChangeDisplay, locale?: string,
|
|
867
|
+
/** `"difference"` 表示で使う値の format。例: `"currency"`。 */
|
|
868
|
+
format?: ValueFormat,
|
|
869
|
+
/** `"relative"` / `"points"` 表示の小数桁数(固定)。例: `2` → "+0.14pt"。未指定は 1 桁。 */
|
|
870
|
+
digits?: number): string | null;
|
|
871
|
+
/**
|
|
872
|
+
* The size of the change with **no sign**, for a sentence or a screen-reader text that
|
|
873
|
+
* already says the direction with a verb ("0.5pt 下がりました", "前月比 12.4% 減少"): a signed
|
|
874
|
+
* "−0.5pt 下がりました" negates twice. Same arguments as `formatChange`; `null` when the
|
|
875
|
+
* values cannot be compared.
|
|
876
|
+
*/
|
|
877
|
+
declare function formatChangeAmount(result: ComparisonResult, display?: ChangeDisplay, locale?: string, format?: ValueFormat, digits?: number): string | null;
|
|
878
|
+
/**
|
|
879
|
+
* The tone of the first threshold rule `value` falls in, or `undefined` (a value
|
|
880
|
+
* no rule matches keeps the normal colour). A rule matches when every bound it
|
|
881
|
+
* carries holds: `value < lt`, `value <= lte`, `value > gt`, `value >= gte`
|
|
882
|
+
* (`gt` / `lte` are the strict-inclusive counterparts, so「10% 超」is `gt: 10`).
|
|
883
|
+
* Rules are tried in array order and the first match wins — put the strict rule
|
|
884
|
+
* first (`gt: 10` before `gt: 7`). A rule with no bound never matches. Gaps (`null`) match nothing.
|
|
885
|
+
*/
|
|
886
|
+
declare function toneForValue(value: number | null | undefined, thresholds: readonly ChartThreshold[] | undefined): ChartTone | undefined;
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* ECharts option builders behind the typed charts (AreaChart, BarChart,
|
|
890
|
+
* LineChart, DonutChart). They turn the Tremor-style props — `data` rows, an
|
|
891
|
+
* `index` key and `categories` — into an `EChartsOption` for `EChart`, which
|
|
892
|
+
* keeps owning the canvas and the token theme.
|
|
893
|
+
*
|
|
894
|
+
* Pure functions of their input: colours arrive already resolved to
|
|
895
|
+
* canvas-safe strings (`resolveChartColors` in `chart-theme.ts`), so everything
|
|
896
|
+
* here is unit-testable without a DOM. Internal; inlined into each copy.
|
|
897
|
+
*/
|
|
898
|
+
|
|
899
|
+
type CartesianStackType = "default" | "stacked" | "percent";
|
|
900
|
+
type CartesianCurveType = "linear" | "smooth" | "step";
|
|
901
|
+
type AreaFill = "gradient" | "solid" | "none";
|
|
902
|
+
type BarLayout = "horizontal" | "vertical";
|
|
903
|
+
/** AreaChart-only settings. */
|
|
904
|
+
interface AreaChartOptions {
|
|
905
|
+
/** `"stacked"` は積み上げ、`"percent"` は各点の合計を 100% にした積み上げ。既定 `"default"`。 */
|
|
906
|
+
type?: CartesianStackType;
|
|
907
|
+
/** 線の形。既定 `"linear"`。 */
|
|
908
|
+
curveType?: CartesianCurveType;
|
|
909
|
+
/** 面の塗り。既定 `"gradient"`。 */
|
|
910
|
+
fill?: AreaFill;
|
|
911
|
+
/** 値の欠けた点(`null` など)をまたいで線をつなぐ。既定 `false`。 */
|
|
912
|
+
connectNulls?: boolean;
|
|
913
|
+
}
|
|
914
|
+
/** LineChart-only settings. */
|
|
915
|
+
interface LineChartOptions {
|
|
916
|
+
/** 線の形。既定 `"linear"`。 */
|
|
917
|
+
curveType?: CartesianCurveType;
|
|
918
|
+
/** 値の欠けた点(`null` など)をまたいで線をつなぐ。既定 `false`。 */
|
|
919
|
+
connectNulls?: boolean;
|
|
920
|
+
/** 値軸を 0 からではなくデータの範囲に合わせる。既定 `false`(0 起点)。最小の目盛ラベルは先頭の x ラベルと重なるので出さない(グリッド線は残る)。 */
|
|
921
|
+
fitToData?: boolean;
|
|
922
|
+
/**
|
|
923
|
+
* 目標線(`target`)のラベルの置き場所。`"start"`(既定)は線の左端の上(最大・最新の強調と近いときは下)。
|
|
924
|
+
* `"end"` は線の右端の上。`"legend"` は凡例だけに出し、線の上には出さない(線の周りが混み合うとき)。
|
|
925
|
+
* 目標の呼び名は、どれを選んでも凡例に出る。
|
|
926
|
+
*/
|
|
927
|
+
targetLabelPosition?: LineTargetLabelPosition;
|
|
928
|
+
}
|
|
929
|
+
/** Where a line chart prints its target label: at the line's left end, its right end, or in the legend only. */
|
|
930
|
+
type LineTargetLabelPosition = "start" | "end" | "legend";
|
|
931
|
+
/** BarChart-only settings. */
|
|
932
|
+
interface BarChartOptions<T extends Record<string, unknown> = Record<string, unknown>> {
|
|
933
|
+
/** `"stacked"` は積み上げ、`"percent"` は各カテゴリの合計を 100% にした積み上げ。既定 `"default"`(横並び)。 */
|
|
934
|
+
type?: CartesianStackType;
|
|
935
|
+
/**
|
|
936
|
+
* 棒の向き。既定 `"horizontal"`(カテゴリが横に並ぶ縦棒)。`"vertical"` はカテゴリを
|
|
937
|
+
* 縦に並べた横棒で、ラベルの長いランキングに向く(先頭の行が一番上)。
|
|
938
|
+
*/
|
|
939
|
+
layout?: BarLayout;
|
|
940
|
+
/** カテゴリ間の隙間(`"20%"` や px)。省略時は ECharts の既定。 */
|
|
941
|
+
barCategoryGap?: string | number;
|
|
942
|
+
/**
|
|
943
|
+
* 値が 0 の棒に「0」の値ラベルを付ける。棒が描かれない 0 が「データなし」に見えるのを防ぐ
|
|
944
|
+
* (在庫 0・件数 0 など)。積み上げでは付けない。0 以外の棒の見た目は変わらない。既定 `true`。
|
|
945
|
+
*/
|
|
946
|
+
showZeroValues?: boolean;
|
|
947
|
+
/**
|
|
948
|
+
* 棒ごとの目標値が入った `data` の列名(行ごとの目標。店舗別の月次目標など)。各棒に短い目標マーカーを
|
|
949
|
+
* 引き、ツールチップに「目標 … (達成率 …%)」を足す。凡例に目標の呼び名(`targetLabel`、既定「目標」)が出る。
|
|
950
|
+
* 1 系列の棒と積み上げ(達成率は合計に対して)で使える。横並びの複数系列と 100% 積み上げでは描かない。
|
|
951
|
+
* 値が欠けた(null・0 以下の)行はマーカーを引かない。
|
|
952
|
+
*
|
|
953
|
+
* 優先順位: `targetKey` を渡すと 1 本の目標線 `target` は描かない(`targetLabel` はマーカーの呼び名として使う)。
|
|
954
|
+
* 値による色分け `thresholds` とは併用できる(色は棒、マーカーは目標)。値軸は最大の目標を含む。
|
|
955
|
+
* 例: `barOptions={{ targetKey: "月次目標" }}`
|
|
956
|
+
*/
|
|
957
|
+
targetKey?: NumericKeys<T>;
|
|
958
|
+
/**
|
|
959
|
+
* 横棒(`layout: "vertical"`)の 1 系列で伝えたい 1 本。`index` の値で渡す(例 `"東京店"`)。
|
|
960
|
+
* 横棒は淡い色(`--chart-1` の薄い塗り)が既定で、この 1 本だけ濃い色(系列色そのまま)になる。省略すると全部が淡い色。
|
|
961
|
+
* 縦棒・複数系列・積み上げでは効かない(色は変わらない)。意味色の `thresholds` に当たった棒はそちらの色が優先。
|
|
962
|
+
* 例: `barOptions={{ layout: "vertical", highlight: "東京店" }}`
|
|
963
|
+
*/
|
|
964
|
+
highlight?: string | number;
|
|
965
|
+
}
|
|
966
|
+
/** Props every cartesian typed chart (Area / Bar / Line) shares. */
|
|
967
|
+
interface CartesianChartBaseProps<T extends Record<string, unknown> = Record<string, unknown>> extends ChartCommonProps<T> {
|
|
968
|
+
/**
|
|
969
|
+
* 最大値と最新値に値ラベルを付ける(最初の系列だけ・系列が 2 つ以下のときだけ・最大 2 つ)。
|
|
970
|
+
* 100% 積み上げの面グラフでは、最初の系列(一番下の帯)の最初と最新の比率(「24%」「31%」)を帯の中に付ける。
|
|
971
|
+
* 既定は Line / Area が `"auto"`、Bar は `index` が日付・年月・年のときだけ `"auto"`。
|
|
972
|
+
*/
|
|
973
|
+
highlight?: ChartHighlight;
|
|
974
|
+
/**
|
|
975
|
+
* ここから先は確定前(速報)の点。index の値で渡す(例 `"2026-09"`)。薄い色・点線(棒は薄い塗りと破線の縁)で
|
|
976
|
+
* 描き、凡例・ツールチップに `provisionalLabel` を出す。線・面は確定の最終点とつなぐ。`forecast`(予測)とは別物。
|
|
977
|
+
* 例: `provisionalFrom="2026-09"`
|
|
978
|
+
*/
|
|
979
|
+
provisionalFrom?: string | number;
|
|
980
|
+
/** 速報の呼び名(凡例・ツールチップ)。既定「速報」。例: `provisionalLabel="暫定"` */
|
|
981
|
+
provisionalLabel?: string;
|
|
982
|
+
/**
|
|
983
|
+
* グラフが言っていることの 1 文要約(自由文)。`"auto"` なら data から機械的に組む
|
|
984
|
+
* (「<見出し>: 最新 <index値> は <値>、前の点より増加/減少」。向きは最新 2 点の値で決まる)。
|
|
985
|
+
* 増減の向きを文に書くなら `"auto"` を使うか data から作る — 手書きの向きは data とずれて誤る。
|
|
986
|
+
* 省略時は要約なし(既存どおり)。例: `summary="auto"`
|
|
987
|
+
*/
|
|
988
|
+
summary?: string | "auto";
|
|
989
|
+
/** 目標値。点線の水平線で示し、値軸は必ずこの値を含む。棒ごとの目標(`barOptions.targetKey`)を渡したときは描かない。 */
|
|
990
|
+
target?: number;
|
|
991
|
+
/** 目標線のラベル。既定「目標 <書式化した値>」。`barOptions.targetKey` のときはマーカーの呼び名(既定「目標」)。 */
|
|
992
|
+
targetLabel?: string;
|
|
993
|
+
/**
|
|
994
|
+
* 任意の位置への注記(縦の線、または `to` で区間の帯)。折れ線・面・縦の棒(`barOptions.layout` が既定のとき)で使え、
|
|
995
|
+
* 横棒では描かない。`at` / `to` は `index` の値。色は中立で、ツールチップにも文言が出る。例:
|
|
996
|
+
* `annotations={[{ at: "2026-04", label: "料金改定" }, { at: "2026-08", to: "2026-09", label: "キャンペーン" }]}`
|
|
997
|
+
*/
|
|
998
|
+
annotations?: ChartAnnotation[];
|
|
999
|
+
/** 凡例を出す。既定 `true`。 */
|
|
1000
|
+
showLegend?: boolean;
|
|
1001
|
+
/** ホバー時のツールチップを出す。既定 `true`。 */
|
|
1002
|
+
showTooltip?: boolean;
|
|
1003
|
+
/** 値軸の目盛り線を出す。既定 `true`。 */
|
|
1004
|
+
showGridLines?: boolean;
|
|
1005
|
+
showXAxis?: boolean;
|
|
1006
|
+
showYAxis?: boolean;
|
|
1007
|
+
/** x 軸のラベルを最初と最後だけにする。 */
|
|
1008
|
+
startEndOnly?: boolean;
|
|
1009
|
+
/** y 軸ラベルの幅(px)。並べた複数グラフのプロット領域を揃えたいときに固定する。 */
|
|
1010
|
+
yAxisWidth?: number;
|
|
1011
|
+
/**
|
|
1012
|
+
* 値軸の下限。Bar / Area は常に 0 起点なので、0 以下の値だけ有効(負の値の下に余白を取る。正の値は無視)。
|
|
1013
|
+
* Line は指定した値から始める。データが下限を下回るときは軸を広げる(切り詰めない)。
|
|
1014
|
+
* 並べて比べる複数のグラフには同じ値を渡して軸をそろえる。
|
|
1015
|
+
*/
|
|
1016
|
+
minValue?: number;
|
|
1017
|
+
/**
|
|
1018
|
+
* 値軸の上限(横棒は横軸)。データが上限を超えるときは軸を広げる(切り詰めない)。
|
|
1019
|
+
* 並べて比べる複数のグラフには同じ値を渡して軸をそろえる。
|
|
1020
|
+
*/
|
|
1021
|
+
maxValue?: number;
|
|
1022
|
+
/** @deprecated `lineOptions.fitToData` を使う。Bar / Area では無視される(常に 0 起点)。 */
|
|
1023
|
+
autoMinValue?: boolean;
|
|
1024
|
+
/** `false` で値軸の目盛りを整数に限る。 */
|
|
1025
|
+
allowDecimals?: boolean;
|
|
1026
|
+
xAxisLabel?: string;
|
|
1027
|
+
yAxisLabel?: string;
|
|
1028
|
+
/**
|
|
1029
|
+
* 点(棒)のクリックで呼ばれる。クリックした行に `eventType` / `categoryClicked` を
|
|
1030
|
+
* 足して渡し、同じ点をもう一度クリックすると `null`。渡すと選択以外が薄くなる。
|
|
1031
|
+
*/
|
|
1032
|
+
onValueChange?: (value: ChartEventPayload) => void;
|
|
1033
|
+
/** @deprecated `isLoading` を使う。 */
|
|
1034
|
+
loading?: boolean;
|
|
1035
|
+
}
|
|
1036
|
+
type DonutVariant = "donut" | "pie";
|
|
1037
|
+
/** What the donut prints in its hole (`donutOptions.centerLabel`). */
|
|
1038
|
+
type DonutCenterLabel = "none" | "total" | "top";
|
|
1039
|
+
/** DonutChart-only settings. */
|
|
1040
|
+
interface DonutChartOptions {
|
|
1041
|
+
/** `"donut"`(中央に穴とラベル)か `"pie"`。既定 `"donut"`。 */
|
|
1042
|
+
variant?: DonutVariant;
|
|
1043
|
+
/** @deprecated `centerLabel` を使う。`false` は `centerLabel: "none"` と同じ。`true` を明示すると `"total"` 扱い(以前の既定)。 */
|
|
1044
|
+
showLabel?: boolean;
|
|
1045
|
+
/**
|
|
1046
|
+
* 穴の中央に出すもの。`"none"`(既定。何も出さない。合計は KPI と重複しがち)/ `"total"`(「合計」と
|
|
1047
|
+
* 合計を書式化した値。`totalLabel` / `unit` を添える)/ `"top"`(最大の切片の名前と構成比)。
|
|
1048
|
+
* それ以外のノードを渡すとそのまま中央に置く。donut のみ。
|
|
1049
|
+
*/
|
|
1050
|
+
centerLabel?: DonutCenterLabel | ReactNode;
|
|
1051
|
+
/** 中央ラベルの見出し(何の合計か)。既定「合計」。 */
|
|
1052
|
+
totalLabel?: string;
|
|
1053
|
+
/** 中央ラベルの合計に添える単位(`"セッション"` → 「9.2万 セッション」)。 */
|
|
1054
|
+
unit?: string;
|
|
1055
|
+
/** 凡例(名前と構成比、大きい順)を出す。広いときは右、狭いときは下。既定 `true`。構成比は凡例だけが持つ(凡例を消すと、広いときだけ大きい 2 切片に外ラベルで名前と構成比が出る)。 */
|
|
1056
|
+
showLegend?: boolean;
|
|
1057
|
+
/** 個別に描く切片の数。超えた分は大きさ順の残りを「その他」1 切片にまとめる。既定 5。 */
|
|
1058
|
+
maxSlices?: number;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1061
|
+
/**
|
|
1062
|
+
* AreaChart — a typed area chart over `EChart`: pass rows, the x-axis key
|
|
1063
|
+
* (`index`) and the series keys (`categories`) instead of an ECharts option.
|
|
1064
|
+
* Colours are the `--chart-1..5` tokens in fixed order (more than 5 series fold
|
|
1065
|
+
* into「その他」) and follow light/dark. The value axis always starts at 0.
|
|
1066
|
+
* Renders inside `ChartFrame` (title, summary, loading skeleton, empty state).
|
|
1067
|
+
* Reach for `chartOptions` — or `EChart` itself — only when this API lacks something.
|
|
1068
|
+
*/
|
|
1069
|
+
|
|
1070
|
+
interface AreaChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends CartesianChartBaseProps<T> {
|
|
1071
|
+
/** 面グラフ固有の設定(積み上げ・線の形・塗り・欠損の扱い)。同名のフラットな props より優先。 */
|
|
1072
|
+
areaOptions?: AreaChartOptions;
|
|
1073
|
+
/** 予測。最初の系列(または `forecast.category`)の続きを点線と薄い帯で描く。 */
|
|
1074
|
+
forecast?: ChartForecast<T>;
|
|
1075
|
+
/**
|
|
1076
|
+
* 比較系列。`categories` のうち 1 つを「前年」「計画」などの比較の線にする(`vs` は KpiCard と同じ語彙)。
|
|
1077
|
+
* 比較系列は `--chart-*` を使わず、細い(1.5px)灰色の実線でマーカーなし・塗りなし。主系列の色は比較の有無で変わらない。
|
|
1078
|
+
* ツールチップは最初の主系列の行に「↑ +12.4% 前年同月比」を添え、比較系列の行は値のみ。
|
|
1079
|
+
* 例: `comparison={{ category: "前年", vs: "prior-year" }}`
|
|
1080
|
+
*/
|
|
1081
|
+
comparison?: ChartComparison<NumericKeys<T>>;
|
|
1082
|
+
/** @deprecated `areaOptions.type` を使う。 */
|
|
1083
|
+
type?: CartesianStackType;
|
|
1084
|
+
/** @deprecated `areaOptions.curveType` を使う。 */
|
|
1085
|
+
curveType?: CartesianCurveType;
|
|
1086
|
+
/** @deprecated `areaOptions.fill` を使う。 */
|
|
1087
|
+
fill?: AreaFill;
|
|
1088
|
+
/** @deprecated `areaOptions.connectNulls` を使う。 */
|
|
1089
|
+
connectNulls?: boolean;
|
|
1090
|
+
}
|
|
1091
|
+
/** Generic over the row type, so `index` / `categories` / `colors` keys are checked against `data`. */
|
|
1092
|
+
declare const AreaChart: (<T extends Record<string, unknown>>(props: AreaChartProps<T> & {
|
|
1093
|
+
ref?: Ref<HTMLDivElement>;
|
|
1094
|
+
}) => ReactElement) & {
|
|
1095
|
+
displayName?: string;
|
|
1096
|
+
};
|
|
1097
|
+
|
|
1098
|
+
/**
|
|
1099
|
+
* BarChart — a typed bar chart over `EChart`: pass rows, the category key
|
|
1100
|
+
* (`index`) and the series keys (`categories`) instead of an ECharts option.
|
|
1101
|
+
* Grouped, stacked or 100%-stacked; vertical or horizontal bars. Colours are the
|
|
1102
|
+
* `--chart-1..5` tokens in fixed order (more than 5 series fold into「その他」)
|
|
1103
|
+
* and follow light/dark. The value axis always starts at 0. A horizontal bar chart of one
|
|
1104
|
+
* series (`barOptions.layout: "vertical"`) is a light tint by default, like BarList; `barOptions.highlight`
|
|
1105
|
+
* names the one bar the page is about, drawn in the full colour.
|
|
1106
|
+
* Renders inside `ChartFrame` (title, summary, loading skeleton, empty state).
|
|
1107
|
+
* Reach for `chartOptions` — or `EChart` itself — only when this API lacks something.
|
|
1108
|
+
*/
|
|
1109
|
+
|
|
1110
|
+
interface BarChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends CartesianChartBaseProps<T> {
|
|
1111
|
+
/** 棒グラフ固有の設定(積み上げ・向き・カテゴリ間の隙間)。同名のフラットな props より優先。予測は持たない。 */
|
|
1112
|
+
barOptions?: BarChartOptions<T>;
|
|
1113
|
+
/**
|
|
1114
|
+
* 棒を値で色分けする(上から順に最初に当たった規則の意味色。棒の面なので文字用の `--<tone>` ではなく面用の `--<tone>-fill` で塗る。どれにも当たらない棒は通常色)。
|
|
1115
|
+
* 規則は `lt`(未満)・`lte`(以下)・`gt`(より大きい)・`gte`(以上)。複数系列(横並び)では系列ごとの棒に効き、当たった棒は意味色で塗って縁に系列色を残す(凡例と結べる)。
|
|
1116
|
+
* 積み上げでは無視(一部分の値は良し悪しを判定する量ではないため。系列色のまま)。
|
|
1117
|
+
* 例 `[{ gt: 2, tone: "negative" }, { gt: 1.5, tone: "warning" }]`(2 超は赤、1.5 超は黄)
|
|
1118
|
+
*/
|
|
1119
|
+
thresholds?: ChartThreshold[];
|
|
1120
|
+
/** @deprecated `barOptions.type` を使う。 */
|
|
1121
|
+
type?: CartesianStackType;
|
|
1122
|
+
/** @deprecated `barOptions.layout` を使う。 */
|
|
1123
|
+
layout?: BarLayout;
|
|
1124
|
+
/** @deprecated `barOptions.barCategoryGap` を使う。 */
|
|
1125
|
+
barCategoryGap?: string | number;
|
|
1126
|
+
}
|
|
1127
|
+
/** Generic over the row type, so `index` / `categories` / `colors` keys are checked against `data`. */
|
|
1128
|
+
declare const BarChart: (<T extends Record<string, unknown>>(props: BarChartProps<T> & {
|
|
1129
|
+
ref?: Ref<HTMLDivElement>;
|
|
1130
|
+
}) => ReactElement) & {
|
|
1131
|
+
displayName?: string;
|
|
1132
|
+
};
|
|
1133
|
+
|
|
1134
|
+
/**
|
|
1135
|
+
* LineChart — a typed line chart over `EChart`: pass rows, the x-axis key
|
|
1136
|
+
* (`index`) and the series keys (`categories`) instead of an ECharts option.
|
|
1137
|
+
* Colours are the `--chart-1..5` tokens in fixed order (more than 5 series fold
|
|
1138
|
+
* into「その他」) and follow light/dark. The value axis starts at 0 unless
|
|
1139
|
+
* `lineOptions.fitToData`.
|
|
1140
|
+
* Renders inside `ChartFrame` (title, summary, loading skeleton, empty state).
|
|
1141
|
+
* Reach for `chartOptions` — or `EChart` itself — only when this API lacks something.
|
|
1142
|
+
*/
|
|
1143
|
+
|
|
1144
|
+
interface LineChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends CartesianChartBaseProps<T> {
|
|
1145
|
+
/** 折れ線固有の設定(線の形・欠損の扱い・値軸をデータに合わせるか・目標ラベルの位置 `targetLabelPosition`)。同名のフラットな props より優先。 */
|
|
1146
|
+
lineOptions?: LineChartOptions;
|
|
1147
|
+
/** 予測。最初の系列(または `forecast.category`)の続きを点線と薄い帯で描く。 */
|
|
1148
|
+
forecast?: ChartForecast<T>;
|
|
1149
|
+
/**
|
|
1150
|
+
* 比較系列。`categories` のうち 1 つを「前年」「計画」などの比較の線にする(`vs` は KpiCard と同じ語彙)。
|
|
1151
|
+
* 比較系列は `--chart-*` を使わず、細い(1.5px)灰色の実線でマーカーなし。主系列の色は比較の有無で変わらない。
|
|
1152
|
+
* ツールチップは最初の主系列の行に「↑ +12.4% 前年同月比」を添え、比較系列の行は値のみ。
|
|
1153
|
+
* 例: `comparison={{ category: "前年", vs: "prior-year" }}`
|
|
1154
|
+
*/
|
|
1155
|
+
comparison?: ChartComparison<NumericKeys<T>>;
|
|
1156
|
+
/** @deprecated `lineOptions.curveType` を使う。 */
|
|
1157
|
+
curveType?: CartesianCurveType;
|
|
1158
|
+
/** @deprecated `lineOptions.connectNulls` を使う。 */
|
|
1159
|
+
connectNulls?: boolean;
|
|
1160
|
+
}
|
|
1161
|
+
/** Generic over the row type, so `index` / `categories` / `colors` keys are checked against `data`. */
|
|
1162
|
+
declare const LineChart: (<T extends Record<string, unknown>>(props: LineChartProps<T> & {
|
|
1163
|
+
ref?: Ref<HTMLDivElement>;
|
|
1164
|
+
}) => ReactElement) & {
|
|
1165
|
+
displayName?: string;
|
|
1166
|
+
};
|
|
1167
|
+
|
|
1168
|
+
/**
|
|
1169
|
+
* DonutChart — a typed donut / pie chart over `EChart`: pass rows, the label
|
|
1170
|
+
* key (`index`) and the value key (`categories: [valueKey]`). Slices are sorted
|
|
1171
|
+
* largest first and coloured with the `--chart-1..5` tokens in fixed order;
|
|
1172
|
+
* more than 5 fold into one「その他」slice. The hole is empty by default (the
|
|
1173
|
+
* total usually repeats a KPI); `donutOptions.centerLabel` picks `"total"`
|
|
1174
|
+
* (「合計」+ the formatted total, plus `unit`), `"top"` (the largest slice and its
|
|
1175
|
+
* share) or a custom node — plain HTML over the canvas, so it takes the page's
|
|
1176
|
+
* type and colours. A share is printed once: the HTML legend lists every slice
|
|
1177
|
+
* with its share, right of the ring when there is room, below it otherwise, and
|
|
1178
|
+
* with the legend there are no outside labels (without it, a plot at least
|
|
1179
|
+
* `DONUT_OUTSIDE_LABEL_MIN_WIDTH` wide labels its 2 largest slices).
|
|
1180
|
+
* Renders inside `ChartFrame` (title, summary, loading skeleton, empty state,
|
|
1181
|
+
* and a visually-hidden table of the slices).
|
|
1182
|
+
*/
|
|
1183
|
+
|
|
1184
|
+
interface DonutChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends Omit<ChartCommonProps<T>, "index" | "categories" | "colors"> {
|
|
1185
|
+
/** 切片の名前に使う列名。 */
|
|
1186
|
+
index?: keyof T & string;
|
|
1187
|
+
/** 切片の大きさに使う列名を 1 つだけ入れた配列(`["売上"]`)。2 つ以上渡しても最初の 1 つだけを使う。 */
|
|
1188
|
+
categories?: (keyof T & string)[];
|
|
1189
|
+
/** 切片の色(大きい順)。`"chart-1"`〜`"chart-5"` か意味色(`"positive"` など。面用の `--<tone>-fill` で塗る)。省略時はトークン順。「その他」は常に灰色。 */
|
|
1190
|
+
colors?: ChartSeriesColor[];
|
|
1191
|
+
/** 切片の名前(`index` の値)→ 表示名。凡例・ツールチップ・外ラベル・データ表に反映。例 `{ organic: "自然検索" }`。無いキーはそのまま。データ表の列名を直すには、`index` と値のキーも渡す(`{ source: "流入元", sessions: "セッション" }`。既定は「項目」「値」)。 */
|
|
1192
|
+
labels?: Record<string, string>;
|
|
1193
|
+
/** ドーナツ固有の設定(形・中央に出すもの `centerLabel`・凡例・切片の上限)。同名のフラットな props より優先。 */
|
|
1194
|
+
donutOptions?: DonutChartOptions;
|
|
1195
|
+
/**
|
|
1196
|
+
* グラフが言っていることの 1 文要約(自由文)。`"auto"` なら slices から「<見出し>: 最大は <名前>(<構成比>)」を組む。
|
|
1197
|
+
* 順位や構成比を文に書くなら `"auto"` を使うか data から作る。省略時は要約なし。例: `summary="auto"`
|
|
1198
|
+
*/
|
|
1199
|
+
summary?: string | "auto";
|
|
1200
|
+
showTooltip?: boolean;
|
|
1201
|
+
/** 切片のクリックで呼ばれる。同じ切片をもう一度クリックすると `null`。渡すと選択以外が薄くなる。 */
|
|
1202
|
+
onValueChange?: (value: ChartEventPayload) => void;
|
|
1203
|
+
/** @deprecated `index` を使う。 */
|
|
1204
|
+
category?: keyof T & string;
|
|
1205
|
+
/** @deprecated `categories={[value]}` を使う。 */
|
|
1206
|
+
value?: keyof T & string;
|
|
1207
|
+
/** @deprecated `donutOptions.variant` を使う。 */
|
|
1208
|
+
variant?: DonutVariant;
|
|
1209
|
+
/** @deprecated `donutOptions.centerLabel` を使う。 */
|
|
1210
|
+
label?: ReactNode;
|
|
1211
|
+
/** @deprecated `donutOptions.centerLabel`(`"none"` で消す)を使う。 */
|
|
1212
|
+
showLabel?: boolean;
|
|
1213
|
+
/** @deprecated `isLoading` を使う。 */
|
|
1214
|
+
loading?: boolean;
|
|
1215
|
+
}
|
|
1216
|
+
/** Generic over the row type, so `index` / `categories` keys are checked against `data`. */
|
|
1217
|
+
declare const DonutChart: (<T extends Record<string, unknown>>(props: DonutChartProps<T> & {
|
|
1218
|
+
ref?: Ref<HTMLDivElement>;
|
|
1219
|
+
}) => ReactElement) & {
|
|
1220
|
+
displayName?: string;
|
|
1221
|
+
};
|
|
1222
|
+
|
|
1223
|
+
/**
|
|
1224
|
+
* Chart helpers shared by the typed charts — colour tokens, number handling and
|
|
1225
|
+
* the layout maths of the Tailwind/SVG charts (BarList, CategoryBar,
|
|
1226
|
+
* ProgressCircle, Tracker). Pure and DOM-free, so it can be unit-tested; kept
|
|
1227
|
+
* internal and inlined into each `vantage add ui` copy.
|
|
1228
|
+
*/
|
|
1229
|
+
|
|
1230
|
+
type BarListSortOrder = "ascending" | "descending" | "none";
|
|
1231
|
+
/** BarList-only settings. */
|
|
1232
|
+
interface BarListOptions {
|
|
1233
|
+
/** 並べ順。既定 `"descending"`(大きい順)。`"none"` は渡した順。「その他」は常に最後。 */
|
|
1234
|
+
sortOrder?: BarListSortOrder;
|
|
1235
|
+
/** 個別に出す行の数。超えた分は合計して「その他」の 1 行にまとめる。既定 5。 */
|
|
1236
|
+
maxItems?: number;
|
|
1237
|
+
/** まとめた行のラベル。既定「その他」。 */
|
|
1238
|
+
otherLabel?: string;
|
|
1239
|
+
/** 順位に入れず、常に「その他」へ足す行の名前。例 `["(not set)", "Unassigned"]`。 */
|
|
1240
|
+
exclude?: readonly string[];
|
|
1241
|
+
/** 値の横に構成比(「その他」も含めた全行の合計に対する割合。整数 %)を添える。例「¥8,240万 · 43%」。既定 `false`。 */
|
|
1242
|
+
showShare?: boolean;
|
|
1243
|
+
}
|
|
1244
|
+
/** The visually-hidden table `ChartFrame` renders next to the plot (`dataTable`). */
|
|
1245
|
+
interface ChartDataTable {
|
|
1246
|
+
/** 表の見出し(`<caption>`)。 */
|
|
1247
|
+
caption?: string;
|
|
1248
|
+
/** 列見出し。先頭がラベル列。 */
|
|
1249
|
+
columns: string[];
|
|
1250
|
+
/** 行。セルは書式済みの文字列。 */
|
|
1251
|
+
rows: string[][];
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
/**
|
|
1255
|
+
* BarList — a ranked list of horizontal bars with the value at the end of each
|
|
1256
|
+
* row: top pages, sales by store, error counts by type. Plain HTML/CSS (no
|
|
1257
|
+
* ECharts), so it stays cheap inside cards and follows the theme natively.
|
|
1258
|
+
*
|
|
1259
|
+
* Pass rows plus the name key (`index`) and the value key (`categories: [valueKey]`),
|
|
1260
|
+
* or the legacy `{ name, value, href?, color? }` items. More than
|
|
1261
|
+
* `barListOptions.maxItems` (5) rows fold into one「その他」row; rows named in
|
|
1262
|
+
* `barListOptions.exclude` always do (outside the ranking). Every row is
|
|
1263
|
+
* painted the same light tint of the colour (rank is the bar's length; `highlight` names the one
|
|
1264
|
+
* row drawn in the full colour),「その他」
|
|
1265
|
+
* in the subdued other colour; `barListOptions.showShare` adds each row's share
|
|
1266
|
+
* of the total after its value (「¥8,240万 · 43%」). Always renders in `ChartFrame` (title, summary,
|
|
1267
|
+
* loading / empty states, a visually-hidden table); the list is as tall as its rows.
|
|
1268
|
+
*/
|
|
1269
|
+
|
|
1270
|
+
interface BarListItem {
|
|
1271
|
+
/** React の key。省略時は `name`。 */
|
|
1272
|
+
key?: string;
|
|
1273
|
+
/** 行のラベル(バーの上に出る)。 */
|
|
1274
|
+
name: string;
|
|
1275
|
+
value: number;
|
|
1276
|
+
/** 渡すとラベルがリンクになる。 */
|
|
1277
|
+
href?: string;
|
|
1278
|
+
/** @deprecated この行だけ色を変える。`colors` を使う(行ごとの色は持たない)。 */
|
|
1279
|
+
color?: ChartColor;
|
|
1280
|
+
}
|
|
1281
|
+
interface BarListProps<T extends object = BarListItem> extends Omit<ComponentProps<"div">, "children" | "title" | "color">, Pick<ChartCommonProps, "format" | "valueFormatter" | "title" | "summary" | "isLoading" | "emptyState"> {
|
|
1282
|
+
/** 行の配列。`index` / `categories` を省くと `{ name, value, href? }` の形として読む。 */
|
|
1283
|
+
data: T[];
|
|
1284
|
+
/** 行の名前に使う列名。既定 `"name"`。 */
|
|
1285
|
+
index?: keyof T & string;
|
|
1286
|
+
/** 値に使う列名を 1 つだけ入れた配列(`["売上"]`)。最初の 1 つだけを使う。既定 `["value"]`。 */
|
|
1287
|
+
categories?: (keyof T & string)[];
|
|
1288
|
+
/** バーの色(`"chart-1"`〜`"chart-5"` か意味色、最初の 1 つだけを使う)。既定 `"chart-1"`。全行を同じ淡い色で塗る(順位はバーの長さで読む)。 */
|
|
1289
|
+
colors?: ChartSeriesColor | ChartSeriesColor[];
|
|
1290
|
+
/** 行の名前(`index` の値)→ 表示名。行のラベル・データ表に反映。例 `{ tokyo: "東京店" }`。無いキーはそのまま。データ表の列名を直すには、列のキーも渡す(`{ store: "店舗", sales: "売上" }`。既定は「項目」「値」)。 */
|
|
1291
|
+
labels?: Record<string, string>;
|
|
1292
|
+
/** 行の値で意味色に塗り分ける(最初に当たった規則。どれにも当たらない行は通常色)。例 `[{ lt: 40, tone: "negative" }, { lt: 70, tone: "warning" }]` */
|
|
1293
|
+
thresholds?: ChartThreshold[];
|
|
1294
|
+
/** 伝えたい 1 行。`index` の値(行の名前。例 `"東京店"`)で渡す。行は淡い色が既定で、この 1 行だけ濃い色(`colors` の色そのまま)になる。省略すると全部が淡い色。「その他」は選べない。 */
|
|
1295
|
+
highlight?: string;
|
|
1296
|
+
/** BarList 固有の設定(並べ順・行数の上限・「その他」のラベル・順位から外す行 `exclude`・値の横の構成比 `showShare`)。同名のフラットな props より優先。 */
|
|
1297
|
+
barListOptions?: BarListOptions;
|
|
1298
|
+
/** 渡すと行がボタンになり、クリックした行を受け取る(「その他」の行は押せない)。 */
|
|
1299
|
+
onValueChange?: (item: T) => void;
|
|
1300
|
+
/**
|
|
1301
|
+
* 行の並べ順(`"descending"` / `"ascending"` / `"none"`)。既定 `"descending"`。
|
|
1302
|
+
* @deprecated `barListOptions.sortOrder` を使う(両方あれば `barListOptions` が優先)。
|
|
1303
|
+
*/
|
|
1304
|
+
sortOrder?: BarListSortOrder;
|
|
1305
|
+
/** @deprecated `colors` を使う。 */
|
|
1306
|
+
color?: ChartColor;
|
|
1307
|
+
/** @deprecated マウント時にバーを伸ばす。入場アニメーションは既定で持たない。 */
|
|
1308
|
+
showAnimation?: boolean;
|
|
1309
|
+
/** @deprecated `valueFormatter` か `format` を使う。 */
|
|
1310
|
+
formatValue?: (value: number) => string;
|
|
1311
|
+
ariaLabel?: string;
|
|
1312
|
+
}
|
|
1313
|
+
/** Generic over the row type, so `index` / `categories` keys are checked against `data`. */
|
|
1314
|
+
declare const BarList: (<T extends object = BarListItem>(props: BarListProps<T> & {
|
|
1315
|
+
ref?: Ref<HTMLDivElement>;
|
|
1316
|
+
}) => ReactElement) & {
|
|
1317
|
+
displayName?: string;
|
|
1318
|
+
};
|
|
1319
|
+
|
|
1320
|
+
interface CategoryBarMarker {
|
|
1321
|
+
/** マーカーの位置(`values` の合計と同じ尺度)。 */
|
|
1322
|
+
value: number;
|
|
1323
|
+
/** ホバーで出す説明。 */
|
|
1324
|
+
tooltip?: string;
|
|
1325
|
+
/** 位置の変化をアニメーションする。既定 `false`(`prefers-reduced-motion` では常に無効)。 */
|
|
1326
|
+
showAnimation?: boolean;
|
|
1327
|
+
}
|
|
1328
|
+
interface CategoryBarProps extends Omit<ComponentProps<"div">, "children"> {
|
|
1329
|
+
/** 各区間の幅(相対値)。合計が 100 である必要はない。負の値は 0 扱い。 */
|
|
1330
|
+
values: number[];
|
|
1331
|
+
/** 区間の色(順に対応)。`"chart-1"`〜`"chart-5"`・意味色(`"positive"` など。面用の `--<tone>-fill` で塗る)・CSS カラー。省略時はトークン順。 */
|
|
1332
|
+
colors?: ChartColor[];
|
|
1333
|
+
marker?: CategoryBarMarker;
|
|
1334
|
+
/** バーの上に区切りの累計値を出す。既定 `true`。 */
|
|
1335
|
+
showLabels?: boolean;
|
|
1336
|
+
/**
|
|
1337
|
+
* 区切りの数値の書式(`"compact"` / `"currency"` / `{ type, currency }`)。他のグラフの
|
|
1338
|
+
* 軸と同じ短縮形で出す(`"currency"` → `¥780万`)。既定 `"compact"`。
|
|
1339
|
+
*/
|
|
1340
|
+
format?: ValueFormat;
|
|
1341
|
+
/** 書式を関数で直接渡す逃げ道。`format` より優先する。 */
|
|
1342
|
+
valueFormatter?: ValueFormatter;
|
|
1343
|
+
}
|
|
1344
|
+
declare const CategoryBar: React.ForwardRefExoticComponent<Omit<CategoryBarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1345
|
+
|
|
1346
|
+
interface ProgressCircleProps extends ComponentProps<"div"> {
|
|
1347
|
+
/** 現在値。`0`〜`max` に丸める。 */
|
|
1348
|
+
value?: number;
|
|
1349
|
+
/** 満タンの値。既定 `100`。 */
|
|
1350
|
+
max?: number;
|
|
1351
|
+
/** 外側の半径(px)。既定 `32`(64px 四方)。 */
|
|
1352
|
+
radius?: number;
|
|
1353
|
+
/** 線の太さ(px)。既定 `6`。 */
|
|
1354
|
+
strokeWidth?: number;
|
|
1355
|
+
/** 色。`"chart-1"`〜`"chart-5"`・意味色(`"positive"` など。面用の `--<tone>-fill` で塗る)・CSS カラー。既定 `"chart-1"`。地のリングは同じ色を淡くしたもの。 */
|
|
1356
|
+
color?: ChartColor;
|
|
1357
|
+
/** マウント時と値の変化をアニメーションする。既定 `false`(`prefers-reduced-motion` では常に無効)。 */
|
|
1358
|
+
showAnimation?: boolean;
|
|
1359
|
+
}
|
|
1360
|
+
declare const ProgressCircle: React.ForwardRefExoticComponent<Omit<ProgressCircleProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1361
|
+
|
|
1362
|
+
interface TrackerBlock {
|
|
1363
|
+
/** React の key。省略時は位置。 */
|
|
1364
|
+
key?: string | number;
|
|
1365
|
+
/** ブロックの色。`"positive"` / `"negative"` / `"warning"` / `"info"`(面用の `--<tone>-fill`)、`"chart-1"`〜`"chart-5"`、CSS カラー。省略時は `defaultColor`。 */
|
|
1366
|
+
color?: ChartColor;
|
|
1367
|
+
/** ホバーで出す説明。日付と状態・件数を入れる(例: `"10/12 失敗 3 件"`)。ブロックの accessible name にもなる。 */
|
|
1368
|
+
tooltip?: string;
|
|
1369
|
+
}
|
|
1370
|
+
interface TrackerProps extends Omit<ComponentProps<"div">, "children"> {
|
|
1371
|
+
data: TrackerBlock[];
|
|
1372
|
+
/** `color` の無いブロックの色。既定は muted-foreground を淡くした灰色。 */
|
|
1373
|
+
defaultColor?: ChartColor;
|
|
1374
|
+
/** ホバー中のブロックを薄くする。既定 `true`。 */
|
|
1375
|
+
hoverEffect?: boolean;
|
|
1376
|
+
}
|
|
1377
|
+
declare const Tracker: React.ForwardRefExoticComponent<Omit<TrackerProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1378
|
+
|
|
1379
|
+
/**
|
|
1380
|
+
* WaterfallChart — a typed waterfall chart over `EChart`: pass the steps as rows,
|
|
1381
|
+
* the name key (`index`) and the amount key (`categories: [valueKey]`) instead of
|
|
1382
|
+
* an ECharts option. 売上 → 原価 → 粗利 の内訳、前期からの増減要因。
|
|
1383
|
+
*
|
|
1384
|
+
* Each row is a step that moves the running total by its value; rows named in
|
|
1385
|
+
* `totals` are totals — a bar from 0 to the running total (or to their own value
|
|
1386
|
+
* when they carry one). The bars are a stacked bar chart over a transparent base,
|
|
1387
|
+
* so the value axis always starts at 0. Increase / decrease bars use the
|
|
1388
|
+
* area tokens (`--positive-fill` / `--negative-fill`, swapped by `polarity`), totals are
|
|
1389
|
+
* `--chart-1`; every step also prints its signed amount (+ / -), so the colour is
|
|
1390
|
+
* never the only carrier of the direction. Missing values (null) draw no bar and read「—」.
|
|
1391
|
+
* `mode="delta"` draws only the moves: the axis is the cumulative change from 0 (the start),
|
|
1392
|
+
* totals are not bars (their numbers go in a note above the plot), so a small change against
|
|
1393
|
+
* a large total is not a hairline on a tall axis; the axis still starts at 0 and can go negative.
|
|
1394
|
+
* A closing「純増」bar (the net change, `--chart-1`, signed) is appended in `delta`. Value-axis ticks carry no "+" in
|
|
1395
|
+
* both modes; the sign is on the bar labels only.
|
|
1396
|
+
* Renders inside `ChartFrame` (title, summary, loading skeleton, empty state, and
|
|
1397
|
+
* a visually-hidden table of the steps).
|
|
1398
|
+
*/
|
|
1399
|
+
|
|
1400
|
+
/**
|
|
1401
|
+
* `"total"`: 合計の段を 0 からの棒として描く(既定)。`"delta"`: 増減の段だけを描く(開始を 0 とした累計増減の軸)。
|
|
1402
|
+
*/
|
|
1403
|
+
type WaterfallMode = "total" | "delta";
|
|
1404
|
+
interface WaterfallChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends Omit<ChartCommonProps<T>, "index" | "categories" | "colors" | "summary"> {
|
|
1405
|
+
/** 段の名前に使う列名。行の並びがそのままグラフの左から右の順。 */
|
|
1406
|
+
index: keyof T & string;
|
|
1407
|
+
/** 増減額(合計の行は合計値)の列名を 1 つだけ入れた配列(`["金額"]`)。2 つ以上渡しても最初の 1 つだけを使う。値は number か数値文字列。 */
|
|
1408
|
+
categories: NumericKeys<T>[];
|
|
1409
|
+
/**
|
|
1410
|
+
* 合計の段にする行の `index` の値(例 `["売上", "粗利"]`)。合計の段は 0 から累計まで届く棒で、色は `--chart-1`。
|
|
1411
|
+
* 合計の行の値が null なら直前までの累計になる(計算に任せるのが確実)。値があればその値が合計になり、以降の累計はそこから続く。
|
|
1412
|
+
* 最初の段が増減の行なら 0 から始まる。`mode="delta"` では棒にならず、先頭の行が「開始」、末尾の行が「終了」の注記になる。
|
|
1413
|
+
*/
|
|
1414
|
+
totals?: string[];
|
|
1415
|
+
/**
|
|
1416
|
+
* 増えるのが良いか。`"higher-is-better"`(既定)は増加が `--positive-fill`・減少が `--negative-fill`(棒用の面のトークン)。
|
|
1417
|
+
* 解約数のように増えて悪い指標は `"lower-is-better"` で色が入れ替わる。`"neutral"` は増減とも `--neutral-fill`(符号は付く)。
|
|
1418
|
+
*/
|
|
1419
|
+
polarity?: Polarity;
|
|
1420
|
+
/**
|
|
1421
|
+
* 描き方。`"total"`(既定)は合計の段を 0 からの棒で描く。
|
|
1422
|
+
* `"delta"` は開始を 0 とした累計増減の軸で増減の段だけを描き、`totals` の行は棒にせず、
|
|
1423
|
+
* 開始・終了の値は図の上の注記(と要約・データ表)に出し、末尾に「純増」棒(増減の合計。`--chart-1`、符号つき)を足す。値軸の目盛に `+` は付かない。合計に対して増減が小さい(目安: 総額の 5% 未満)ときに使う。
|
|
1424
|
+
* 軸は 0 起点のまま(累計が負になる段も 0 の下に描く)。例 `mode="delta"`
|
|
1425
|
+
*/
|
|
1426
|
+
mode?: WaterfallMode;
|
|
1427
|
+
/** 段の名前(`index` の値)→ 表示名。軸・ツールチップ・データ表に反映。例 `{ cogs: "売上原価" }`。無いキーはそのまま。データ表の先頭列名を直すには `index` のキーも渡す(既定は「項目」)。 */
|
|
1428
|
+
labels?: Record<string, string>;
|
|
1429
|
+
/**
|
|
1430
|
+
* 縦軸の下限。軸は常に 0 を含むので、0 以下の値だけ有効(累計が負になる段の下に余白を取る。正の値は無視)。
|
|
1431
|
+
* データが下限を下回るときは軸を広げる(切り詰めない)。`mode="total"` / `"delta"` の両方で効く。
|
|
1432
|
+
* 部署別などを並べて比べるときは、全部のグラフに同じ `minValue` / `maxValue` を渡して縦軸をそろえる。
|
|
1433
|
+
*/
|
|
1434
|
+
minValue?: number;
|
|
1435
|
+
/**
|
|
1436
|
+
* 縦軸の上限。データが上限を超えるときは軸を広げる(切り詰めない)。`mode="total"` / `"delta"` の両方で効く。
|
|
1437
|
+
* 並べて比べるときは、全部のグラフに同じ `minValue` / `maxValue` を渡して縦軸をそろえる。
|
|
1438
|
+
*/
|
|
1439
|
+
maxValue?: number;
|
|
1440
|
+
/** y 軸ラベルの幅(px)。並べた複数グラフのプロット領域を揃えたいときに固定する。 */
|
|
1441
|
+
yAxisWidth?: number;
|
|
1442
|
+
/** 各棒に符号つきの増減額(合計は累計)を書く。既定 `true`。 */
|
|
1443
|
+
showValues?: boolean;
|
|
1444
|
+
/** ホバー時のツールチップ(増減と累計)を出す。既定 `true`。 */
|
|
1445
|
+
showTooltip?: boolean;
|
|
1446
|
+
/**
|
|
1447
|
+
* グラフが言っていることの 1 文要約(自由文)。`"auto"` なら steps から「<見出し>: <最初> <値> → <最後> <値>。最大の増加は …、最大の減少は …」を組む(`mode="delta"` は「<開始> <値> → <終了> <値>(<増減>)」)。
|
|
1448
|
+
* 省略時は要約なし。例: `summary="auto"`
|
|
1449
|
+
*/
|
|
1450
|
+
summary?: string | "auto";
|
|
1451
|
+
/** 見出しが無いときのプロット領域の読み上げ名。省略時は「<金額の列>のウォーターフォールチャート」。 */
|
|
1452
|
+
ariaLabel?: string;
|
|
1453
|
+
}
|
|
1454
|
+
/** Generic over the row type, so `index` / `categories` keys are checked against `data`. */
|
|
1455
|
+
declare const WaterfallChart: (<T extends Record<string, unknown>>(props: WaterfallChartProps<T> & {
|
|
1456
|
+
ref?: Ref<HTMLDivElement>;
|
|
1457
|
+
}) => ReactElement) & {
|
|
1458
|
+
displayName?: string;
|
|
1459
|
+
};
|
|
1460
|
+
|
|
1461
|
+
/**
|
|
1462
|
+
* ScatterChart — a typed scatter / bubble chart over `EChart`: pass rows and the
|
|
1463
|
+
* two numeric column keys for the axes (`x` / `y`) instead of an ECharts option.
|
|
1464
|
+
* 広告費 × 売上、客単価 × 購入頻度 のように 2 つの数値の関係と外れ値を見る。
|
|
1465
|
+
*
|
|
1466
|
+
* `size` turns the dots into bubbles (area proportional to the value, from 0),
|
|
1467
|
+
* `series` splits the dots into series coloured with the `--chart-1..5` tokens in
|
|
1468
|
+
* fixed order (more than 5 fold into one grey「その他」series), `index` names each
|
|
1469
|
+
* dot in the tooltip. Both axes fit the data by default — a scatter is read by
|
|
1470
|
+
* position, not by length, so it does not start at 0 (`fitToData={false}` does).
|
|
1471
|
+
* Rows whose x or y is missing are left out. `labelKey` prints each dot's name beside it (dots whose
|
|
1472
|
+
* labels would collide are thinned, never overprinted; on a narrow plot (under 480px) only the 2 highest dots are
|
|
1473
|
+
* named, each label turned inward so it stays inside the plot, the legend moves under the plot and the y axis carries
|
|
1474
|
+
* 3 intervals), `referenceLines` draws neutral guide lines at
|
|
1475
|
+
* fixed x / y values, `highlight` brings some series forward and fades the rest. Renders inside `ChartFrame` (title,
|
|
1476
|
+
* summary, loading skeleton, empty state, and a visually-hidden table of the dots).
|
|
1477
|
+
*/
|
|
1478
|
+
|
|
1479
|
+
/** 散布図に引く基準線 1 本(`x` なら縦線、`y` なら横線)。中立色の破線で、点の色とは混ざらない。 */
|
|
1480
|
+
interface ScatterReferenceLine {
|
|
1481
|
+
/** `"x"` は横軸の値に縦線、`"y"` は縦軸の値に横線を引く。 */
|
|
1482
|
+
axis: "x" | "y";
|
|
1483
|
+
/** 線を引く位置(軸の値そのまま。`format` が percent の列でも、列と同じ単位の数値を渡す)。軸の範囲に収まらないときは軸が線まで広がる。 */
|
|
1484
|
+
value: number;
|
|
1485
|
+
/** 線の脇に書く短い名前(「目標 25%」)。省略すると線だけ。 */
|
|
1486
|
+
label?: string;
|
|
1487
|
+
}
|
|
1488
|
+
interface ScatterChartProps<T extends Record<string, unknown> = Record<string, unknown>> extends Omit<ChartCommonProps<T>, "index" | "categories" | "colors" | "summary" | "labels" | "format" | "valueFormatter"> {
|
|
1489
|
+
/** 行の配列。1 行 = 1 つの点。数値の列は number か数値文字列。x か y が数値でない行は描かない。 */
|
|
1490
|
+
data: T[];
|
|
1491
|
+
/** 横軸に使う数値の列名。例 `"adSpend"`。 */
|
|
1492
|
+
x: NumericKeys<T>;
|
|
1493
|
+
/** 縦軸に使う数値の列名。例 `"revenue"`。 */
|
|
1494
|
+
y: NumericKeys<T>;
|
|
1495
|
+
/** 点の大きさ(面積)に使う数値の列名。渡すとバブルチャートになる。0 を基準に面積が比例し、null・0 以下は最小の大きさ。ツールチップに値が出る。 */
|
|
1496
|
+
size?: NumericKeys<T>;
|
|
1497
|
+
/** 点の名前に使う列名(店舗名・キャンペーン名など)。ツールチップの見出しとデータ表の先頭列になる。 */
|
|
1498
|
+
index?: keyof T & string;
|
|
1499
|
+
/**
|
|
1500
|
+
* 点の脇に書く文字の列名(店舗名など)。重なる点のラベルは自動で間引く(ホバーのツールチップには常に出る)。
|
|
1501
|
+
* `index` が無いときはツールチップの見出しとデータ表の名前にもなる。`highlight` を使うと、強調しない系列のラベルは出さない。
|
|
1502
|
+
*/
|
|
1503
|
+
labelKey?: keyof T & string;
|
|
1504
|
+
/** 系列分けに使う列名(`"channel"` など)。値ごとに色を分け、凡例を出す。6 つ以上は点の多い 5 つ +「その他」(灰色)にまとまる。 */
|
|
1505
|
+
series?: keyof T & string;
|
|
1506
|
+
/** 凡例の見出し(「店の規模」)。`series` があって凡例が出るときだけ、凡例の左に小さく書く。 */
|
|
1507
|
+
seriesLabel?: string;
|
|
1508
|
+
/**
|
|
1509
|
+
* 前面に出す系列(`series` 列の値。`"退職"` か `["退職", "休職"]`)。指定した系列は不透明で手前に、指定外は薄く背面に描く。
|
|
1510
|
+
* 数が多い点の中に埋もれる少数の系列を見せたいときに使う。値が系列に一つも当たらないときは強調しない。
|
|
1511
|
+
*/
|
|
1512
|
+
highlight?: string | string[];
|
|
1513
|
+
/**
|
|
1514
|
+
* 基準線(目標・平均・しきい値)。`axis: "x" | "y"` と軸の値で縦線・横線を引く。例 `[{ axis: "y", value: 25, label: "粗利率 25%" }]`
|
|
1515
|
+
* 色は中立色(点の系列色とは別)。線は点の下に敷かず、軸の範囲を線まで広げる。
|
|
1516
|
+
*/
|
|
1517
|
+
referenceLines?: ScatterReferenceLine[];
|
|
1518
|
+
/** 系列色(`"chart-1"`〜`"chart-5"` か意味色)。配列は系列の出現順、record は系列名ごと。省略時はトークン順。「その他」は常に灰色。 */
|
|
1519
|
+
colors?: ChartSeriesColor[] | Partial<Record<string, ChartSeriesColor>>;
|
|
1520
|
+
/** 列名・系列の値 → 表示名(軸のタイトル・凡例・ツールチップ・データ表に反映)。例 `{ adSpend: "広告費", revenue: "売上" }`。無いキーはそのまま。データ表の列名の既定は「名前」「系列」「横軸」「縦軸」「大きさ」で、直すには各キーを渡す。 */
|
|
1521
|
+
labels?: Record<string, string>;
|
|
1522
|
+
/** 数値の書式。x・y・size の既定の書式(`"compact"` など。`{ type: "number", unit: "件" }` も可)。軸ごとに変えるなら `xFormat` / `yFormat` / `sizeFormat`。既定 `"compact"`。 */
|
|
1523
|
+
format?: ValueFormat;
|
|
1524
|
+
/** 横軸と x の値の書式。`format` より優先。 */
|
|
1525
|
+
xFormat?: ValueFormat;
|
|
1526
|
+
/** 縦軸と y の値の書式。`format` より優先。 */
|
|
1527
|
+
yFormat?: ValueFormat;
|
|
1528
|
+
/** `size` の値の書式(ツールチップ・データ表)。`format` より優先。 */
|
|
1529
|
+
sizeFormat?: ValueFormat;
|
|
1530
|
+
/** 書式を関数で直接渡す逃げ道。x・y・size すべてに使われ、`format` 系より優先する。 */
|
|
1531
|
+
valueFormatter?: ValueFormatter;
|
|
1532
|
+
/**
|
|
1533
|
+
* 縦軸(y)の下限。散布図は 0 起点にしないので、指定した値から始める。データが下限を下回るときは軸を広げる(切り詰めない)。
|
|
1534
|
+
* 並べて比べる複数の散布図には同じ `minValue` / `maxValue` と `xMinValue` / `xMaxValue` を渡して軸をそろえる。
|
|
1535
|
+
*/
|
|
1536
|
+
minValue?: number;
|
|
1537
|
+
/** 縦軸(y)の上限。データが上限を超えるときは軸を広げる(切り詰めない)。並べて比べるときは同じ値を渡す。 */
|
|
1538
|
+
maxValue?: number;
|
|
1539
|
+
/** 横軸(x)の下限。データが下限を下回るときは軸を広げる。並べて比べるときは同じ値を渡す。 */
|
|
1540
|
+
xMinValue?: number;
|
|
1541
|
+
/** 横軸(x)の上限。データが上限を超えるときは軸を広げる。並べて比べるときは同じ値を渡す。 */
|
|
1542
|
+
xMaxValue?: number;
|
|
1543
|
+
/** 両軸をデータの範囲に合わせる。既定 `true`(散布図は位置で読むので 0 起点にしない)。`false` で両軸を 0 から始める。 */
|
|
1544
|
+
fitToData?: boolean;
|
|
1545
|
+
/** 凡例(系列が 2 つ以上のときだけ)を出す。既定 `true`。 */
|
|
1546
|
+
showLegend?: boolean;
|
|
1547
|
+
/** ホバー時のツールチップを出す。既定 `true`。 */
|
|
1548
|
+
showTooltip?: boolean;
|
|
1549
|
+
/**
|
|
1550
|
+
* グラフが言っていることの 1 文要約(自由文)。`"auto"` なら「<見出し>: <点の数>点。<y の列> が最大なのは <名前>(<値>)」を組む(`index` が無いときは最大値だけ)。
|
|
1551
|
+
* 省略時は要約なし。例: `summary="auto"`
|
|
1552
|
+
*/
|
|
1553
|
+
summary?: string | "auto";
|
|
1554
|
+
/** `data` が空(または描ける点が無い)ときの表示。 */
|
|
1555
|
+
emptyState?: ChartEmptyState;
|
|
1556
|
+
/** 見出しが無いときのプロット領域の読み上げ名。省略時は「<y の列>×<x の列>の散布図」。 */
|
|
1557
|
+
ariaLabel?: string;
|
|
1558
|
+
}
|
|
1559
|
+
/** Generic over the row type, so `x` / `y` / `size` / `index` / `series` keys are checked against `data`. */
|
|
1560
|
+
declare const ScatterChart: (<T extends Record<string, unknown>>(props: ScatterChartProps<T> & {
|
|
1561
|
+
ref?: Ref<HTMLDivElement>;
|
|
1562
|
+
}) => ReactElement) & {
|
|
1563
|
+
displayName?: string;
|
|
1564
|
+
};
|
|
1565
|
+
|
|
1566
|
+
interface LegendProps {
|
|
1567
|
+
/** 凡例に並べる系列名。並び順が配色の順(グラフの `categories` と同じものを渡す)。6 つ以上はグラフ側で「その他」にまとまるので、凡例も 5 つ +「その他」で渡す。 */
|
|
1568
|
+
categories: string[];
|
|
1569
|
+
/** 系列色(`"chart-1"`〜`"chart-5"` か意味色)。配列は系列の順、record は系列名ごと。グラフに渡した `colors` と同じものを渡す。省略時はトークン順。「その他」は常に灰色。 */
|
|
1570
|
+
colors?: ChartSeriesColor[] | Partial<Record<string, ChartSeriesColor>>;
|
|
1571
|
+
/** 系列名 → 表示名。グラフの `labels` と同じものを渡す。例 `{ sales: "売上" }`。無いキーはそのまま。 */
|
|
1572
|
+
labels?: Record<string, string>;
|
|
1573
|
+
/** 並べ方。`"horizontal"`(既定。折り返す横並び)か `"vertical"`(縦並び)。 */
|
|
1574
|
+
layout?: "horizontal" | "vertical";
|
|
1575
|
+
/** 凡例の読み上げ名。省略時は「凡例」。 */
|
|
1576
|
+
ariaLabel?: string;
|
|
1577
|
+
className?: string;
|
|
1578
|
+
}
|
|
1579
|
+
/** Plain-HTML legend. Renders nothing for an empty `categories`. */
|
|
1580
|
+
declare const Legend: React.ForwardRefExoticComponent<LegendProps & React.RefAttributes<HTMLUListElement>>;
|
|
1581
|
+
|
|
1582
|
+
/** The shape the loading skeleton takes, matching the chart it stands in for. */
|
|
1583
|
+
type ChartSkeletonVariant = "line" | "area" | "bar" | "donut" | "list";
|
|
1584
|
+
interface ChartFrameProps extends Omit<HTMLAttributes<HTMLElement>, "title" | "children"> {
|
|
1585
|
+
/** グラフの見出し。プロット領域の `aria-labelledby` になる。 */
|
|
1586
|
+
title?: string;
|
|
1587
|
+
/** 1 文の要約。見出しの下に出し、プロット領域の `aria-describedby` になる。 */
|
|
1588
|
+
summary?: string;
|
|
1589
|
+
/** 読み込み中。`variant` の形のスケルトンを同じ高さで出す。 */
|
|
1590
|
+
isLoading?: boolean;
|
|
1591
|
+
/** データが無い。高さを保ったまま `emptyState` を出す。 */
|
|
1592
|
+
isEmpty?: boolean;
|
|
1593
|
+
emptyState?: ChartEmptyState;
|
|
1594
|
+
/** プロット領域の高さ。数値は px。既定 288。 */
|
|
1595
|
+
height?: number | string;
|
|
1596
|
+
/** スケルトンの形。既定 `"line"`。 */
|
|
1597
|
+
variant?: ChartSkeletonVariant;
|
|
1598
|
+
/** 見出しが無いときのプロット領域のラベル。 */
|
|
1599
|
+
ariaLabel?: string;
|
|
1600
|
+
/**
|
|
1601
|
+
* プロット領域の役割。既定 `"img"`(canvas のグラフ)。行がボタンやリンクになる
|
|
1602
|
+
* HTML のグラフ(BarList・FunnelSteps)は `"group"` にして、中身を読ませる。
|
|
1603
|
+
*/
|
|
1604
|
+
plotRole?: "img" | "group";
|
|
1605
|
+
/** 値の表。画面には出さず(`sr-only`)、スクリーンリーダー向けに図の中に置く。`chartDataTable` で作る。 */
|
|
1606
|
+
dataTable?: ChartDataTable;
|
|
1607
|
+
/** プロット(チャート本体)。読み込み中・空のときは描かない。 */
|
|
1608
|
+
children?: ReactNode;
|
|
1609
|
+
}
|
|
1610
|
+
/**
|
|
1611
|
+
* The frame. `ref` points at the plot area (the element with the fixed height),
|
|
1612
|
+
* `className` / other attributes go to the outer `<figure>`.
|
|
1613
|
+
*/
|
|
1614
|
+
declare const ChartFrame: React.ForwardRefExoticComponent<ChartFrameProps & React.RefAttributes<HTMLDivElement>>;
|
|
1615
|
+
|
|
288
1616
|
interface FunnelStep {
|
|
289
1617
|
/** ステップのラベル(例: "ページビュー") */
|
|
290
1618
|
label: string;
|
|
291
1619
|
/** このステップの数値 */
|
|
292
1620
|
value: number;
|
|
293
|
-
/** Tailwind bg カラークラス(例: "bg-chart-1")
|
|
1621
|
+
/** @deprecated Tailwind bg カラークラス(例: "bg-chart-1")。`colors` を使う。未指定時は `bg-chart-1` */
|
|
294
1622
|
color?: string;
|
|
295
1623
|
/** クリック時のハンドラ */
|
|
296
1624
|
onClick?: () => void;
|
|
@@ -299,17 +1627,141 @@ declare const funnelStepsVariants: (props?: ({
|
|
|
299
1627
|
size?: "sm" | "lg" | "md" | null | undefined;
|
|
300
1628
|
direction?: "horizontal" | "vertical" | null | undefined;
|
|
301
1629
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
302
|
-
interface FunnelStepsProps extends ComponentProps<"div">, VariantProps<typeof funnelStepsVariants> {
|
|
303
|
-
/** ファネルステップの配列(先頭が最大幅) */
|
|
304
|
-
data:
|
|
1630
|
+
interface FunnelStepsProps<T extends object = FunnelStep> extends Omit<ComponentProps<"div">, "title" | "color">, Pick<ChartCommonProps, "format" | "valueFormatter" | "title" | "summary" | "isLoading" | "emptyState">, VariantProps<typeof funnelStepsVariants> {
|
|
1631
|
+
/** ファネルステップの配列(先頭が最大幅)。`index` / `categories` を省くと `{ label, value }` の形として読む。 */
|
|
1632
|
+
data: T[];
|
|
1633
|
+
/** ステップのラベルに使う列名。既定 `"label"`。 */
|
|
1634
|
+
index?: keyof T & string;
|
|
1635
|
+
/** 値に使う列名を 1 つだけ入れた配列(`["件数"]`)。最初の 1 つだけを使う。既定 `["value"]`。 */
|
|
1636
|
+
categories?: (keyof T & string)[];
|
|
1637
|
+
/** 段の色(`"chart-1"`〜`"chart-5"`、段の順に繰り返す)。省略時はすべて `"chart-1"`(段は同じ量の絞り込みなので 1 色)。 */
|
|
1638
|
+
colors?: ChartColorToken[];
|
|
1639
|
+
/** ステップの名前(`index` の値)→ 表示名。ラベル・データ表に反映。例 `{ visit: "訪問" }`。無いキーはそのまま。データ表の列名を直すには、列のキーも渡す(`{ label: "工程", value: "人数" }`。既定は「ステップ」「値」)。 */
|
|
1640
|
+
labels?: Record<string, string>;
|
|
1641
|
+
/** 伝えたい 1 段。`index` の値(ステップ名。例 `"購入"`)で渡す。段は淡い色が既定で、この 1 段だけ濃い色(`colors` の色そのまま)になる。省略すると全部が淡い色。 */
|
|
1642
|
+
highlight?: string;
|
|
305
1643
|
/** ステップ間のコンバージョン率を表示する */
|
|
306
1644
|
showConversion?: boolean;
|
|
307
|
-
/**
|
|
1645
|
+
/** 前期の各段の値(`data` と同じ順)。渡すと転換率の横に前期比(pt)を出し、最も下がった率を強調する。`label` は列見出し・注記の名前(既定「前期」)。KpiCard の `comparison` と同じ形。例 `comparison={{ values: [231_400, 1_210, 402] }}` */
|
|
1646
|
+
comparison?: {
|
|
1647
|
+
values: readonly (number | null)[];
|
|
1648
|
+
label?: string;
|
|
1649
|
+
};
|
|
1650
|
+
/** @deprecated `valueFormatter` か `format` を使う。 */
|
|
308
1651
|
formatValue?: (value: number) => string;
|
|
309
|
-
/**
|
|
1652
|
+
/** マウント時のエントリアニメーションを有効にする。既定 `false`。 */
|
|
310
1653
|
animate?: boolean;
|
|
1654
|
+
ariaLabel?: string;
|
|
311
1655
|
}
|
|
312
|
-
|
|
1656
|
+
/** Generic over the row type, so `index` / `categories` keys are checked against `data`. */
|
|
1657
|
+
declare const FunnelSteps: (<T extends object = FunnelStep>(props: FunnelStepsProps<T> & {
|
|
1658
|
+
ref?: Ref<HTMLDivElement>;
|
|
1659
|
+
}) => ReactElement) & {
|
|
1660
|
+
displayName?: string;
|
|
1661
|
+
};
|
|
1662
|
+
|
|
1663
|
+
/**
|
|
1664
|
+
* Heatmap — a typed heatmap over `EChart`: pass rows, the column keys for the
|
|
1665
|
+
* x axis / y axis (`x` / `y`) and the number to shade by (`value`) instead of an
|
|
1666
|
+
* ECharts option. Cohort retention (週 × コホート), weekday × hour counts, …
|
|
1667
|
+
*
|
|
1668
|
+
* Shading is a single-colour ramp (light → dark) of one theme colour
|
|
1669
|
+
* (`--chart-1` by default; `tone` moves it to another series token or a meaning
|
|
1670
|
+
* colour) and follows light/dark. A cell with no value (null / missing row) is left
|
|
1671
|
+
* unpainted (transparent, no text), never shaded like 0; the tooltip and the table say「—」.
|
|
1672
|
+
* The shading range is the data's min–max unless `scale` fixes it. The ramp's lowest end is the tone mixed 20% into
|
|
1673
|
+
* the surface (`color-mix(in oklch, var(--chart-1) 20%, var(--card))`), so the lowest cell never melts into the
|
|
1674
|
+
* background in dark mode; the legend's gradient starts at the same colour.
|
|
1675
|
+
* Renders inside `ChartFrame` (title, summary, loading skeleton, empty state)
|
|
1676
|
+
* with the numbers as a screen-reader table.
|
|
1677
|
+
*/
|
|
1678
|
+
|
|
1679
|
+
/** Columns of `T` that hold numbers (null / undefined allowed for gaps); untyped rows keep every key. */
|
|
1680
|
+
type NumericColumn<T> = {
|
|
1681
|
+
[K in keyof T]-?: unknown extends T[K] ? K : T[K] extends number | bigint | null | undefined ? K : never;
|
|
1682
|
+
}[keyof T] & string;
|
|
1683
|
+
interface HeatmapProps<T extends Record<string, unknown> = Record<string, unknown>> extends ChartRootAttributes {
|
|
1684
|
+
/** 行の配列。1 行 = 1 マス(x と y の組)。同じ組が複数あれば後の行が勝つ。値は number か数値文字列。 */
|
|
1685
|
+
data: T[];
|
|
1686
|
+
/** 横軸(列)に使う列名。例 `"hour"`・`"week"`。 */
|
|
1687
|
+
x: keyof T & string;
|
|
1688
|
+
/** 縦軸(行)に使う列名。例 `"weekday"`・`"cohort"`。先頭の行が一番上。 */
|
|
1689
|
+
y: keyof T & string;
|
|
1690
|
+
/** マスの濃さを決める数値の列名。null・欠損・数値でない値のマスは塗らない(0 とは別。ツールチップとデータ表は「—」)。 */
|
|
1691
|
+
value: NumericColumn<T>;
|
|
1692
|
+
/** 横軸の並び順(と表示するマス)。省略時は `data` の出現順。ここに無い x の行は描かない。 */
|
|
1693
|
+
xLabels?: string[];
|
|
1694
|
+
/** 縦軸の並び順(と表示するマス)。省略時は `data` の出現順。ここに無い y の行は描かない。 */
|
|
1695
|
+
yLabels?: string[];
|
|
1696
|
+
/**
|
|
1697
|
+
* 列名・軸の値 → 表示名(軸・ツールチップ・データ表に反映)。
|
|
1698
|
+
* 例 `{ mon: "月曜", value: "件数", breached: "SLA 未達" }`。無いキーはそのまま。データ表の先頭列名は `y` のキーを渡すと直る(既定は「項目」)。
|
|
1699
|
+
*/
|
|
1700
|
+
labels?: Record<string, string>;
|
|
1701
|
+
/** 数値の書式(`"number"` / `"percent"` / `{ type: "number", unit: "件" }` など)。マス内・ツールチップ・データ表で同じ書式。既定 `"number"`。 */
|
|
1702
|
+
format?: ValueFormat;
|
|
1703
|
+
/** 書式を関数で直接渡す逃げ道。`format` より優先する。 */
|
|
1704
|
+
valueFormatter?: ValueFormatter;
|
|
1705
|
+
/**
|
|
1706
|
+
* 濃淡の色。`"chart-1"`〜`"chart-5"` か意味色(`"positive"` / `"warning"` / `"negative"` / `"neutral"`)。
|
|
1707
|
+
* 薄い → 濃いの単色グラデーション(レインボーにしない)。既定 `"chart-1"`。
|
|
1708
|
+
*/
|
|
1709
|
+
tone?: ChartSeriesColor;
|
|
1710
|
+
/**
|
|
1711
|
+
* 濃さの固定スケール。省略時はデータの最小〜最大(自動)。比べたい上限・下限が決まっているときだけ渡す。`min` 以下が最も薄く、`max` 以上が最も濃い(範囲外の値は端に丸める)。凡例の両端もこの値になる。
|
|
1712
|
+
* 継続率(0〜100)なら `{ min: 0, max: 100 }`。片方だけでもよく、省略した側はデータの最小・最大。
|
|
1713
|
+
* `minValue` / `maxValue` より優先する。
|
|
1714
|
+
*/
|
|
1715
|
+
scale?: {
|
|
1716
|
+
min?: number;
|
|
1717
|
+
max?: number;
|
|
1718
|
+
};
|
|
1719
|
+
/** @deprecated `scale={{ min }}` を使う。濃さの下限(この値以下が最も薄い)。 */
|
|
1720
|
+
minValue?: number;
|
|
1721
|
+
/** @deprecated `scale={{ max }}` を使う。濃さの上限(この値以上が最も濃い)。 */
|
|
1722
|
+
maxValue?: number;
|
|
1723
|
+
/** マスの中に値を書く(`format` どおり)。既定 `false`。 */
|
|
1724
|
+
showValues?: boolean;
|
|
1725
|
+
/** 凡例(薄い → 濃いの帯と両端の値)を出す。既定 `true`。 */
|
|
1726
|
+
showLegend?: boolean;
|
|
1727
|
+
/** ホバーでツールチップを出す。既定 `true`。 */
|
|
1728
|
+
showTooltip?: boolean;
|
|
1729
|
+
/**
|
|
1730
|
+
* ツールチップとデータ表に添える列(同じ行の別の数値)。例 `["breached"]` →「月曜 9時台 電話 12件・SLA 未達 2件」の「SLA 未達 2件」。
|
|
1731
|
+
* 列名の表示は `labels`、値は `format`(単位つきの書式なら同じ単位)で出る。
|
|
1732
|
+
*/
|
|
1733
|
+
details?: NumericColumn<T>[];
|
|
1734
|
+
/**
|
|
1735
|
+
* この列が真(`true` / 0 でない数)の行のマスに、注意色(`--negative`)の枠を付ける。
|
|
1736
|
+
* 例 SLA 未達が集中したマス。色だけでなく枠の太さでも区別でき、ツールチップに「要注意」と出る。
|
|
1737
|
+
*/
|
|
1738
|
+
flag?: keyof T & string;
|
|
1739
|
+
/** グラフの見出し。 */
|
|
1740
|
+
title?: string;
|
|
1741
|
+
/** グラフが言っていることの 1 文要約。`"auto"` で最大のマスから自動生成。 */
|
|
1742
|
+
summary?: string | "auto";
|
|
1743
|
+
/** 読み込み中。最終形と同じ高さのスケルトンを出す。 */
|
|
1744
|
+
isLoading?: boolean;
|
|
1745
|
+
/** `data` が空のときの表示。 */
|
|
1746
|
+
emptyState?: ChartEmptyState;
|
|
1747
|
+
/** プロット領域の高さ(px)。既定 288。 */
|
|
1748
|
+
height?: number;
|
|
1749
|
+
/** 生成した EChartsOption に最後に深くマージする逃げ道。 */
|
|
1750
|
+
chartOptions?: EChartsOption;
|
|
1751
|
+
/** グラフ右上に PNG 保存/コピーのボタンを出す。見出しがあれば PNG の上に含める(`{ includeTitle: false }` で含めない)。 */
|
|
1752
|
+
actions?: boolean | ChartActionsOptions;
|
|
1753
|
+
/** PNG 保存時のファイル名(拡張子つき)。 */
|
|
1754
|
+
fileName?: string;
|
|
1755
|
+
className?: string;
|
|
1756
|
+
/** スクリーンリーダー向けのラベル。省略時は `<yの列>×<xの列>のヒートマップ`。 */
|
|
1757
|
+
ariaLabel?: string;
|
|
1758
|
+
}
|
|
1759
|
+
/** Generic over the row type, so `x` / `y` / `value` keys are checked against `data`. */
|
|
1760
|
+
declare const Heatmap: (<T extends Record<string, unknown>>(props: HeatmapProps<T> & {
|
|
1761
|
+
ref?: Ref<HTMLDivElement>;
|
|
1762
|
+
}) => ReactElement) & {
|
|
1763
|
+
displayName?: string;
|
|
1764
|
+
};
|
|
313
1765
|
|
|
314
1766
|
type SparklineVariant = "line" | "bar";
|
|
315
1767
|
interface SparklineDataPoint {
|
|
@@ -323,11 +1775,103 @@ interface SparklineProps extends SVGAttributes<SVGSVGElement> {
|
|
|
323
1775
|
/** Tailwind text-colour class; drives both stroke and fill via `currentColor`. */
|
|
324
1776
|
color?: string;
|
|
325
1777
|
area?: boolean;
|
|
1778
|
+
/** マウント時に線を引く / 棒を伸ばす。既定 `false`(`prefers-reduced-motion` では常に無効)。 */
|
|
326
1779
|
animate?: boolean;
|
|
1780
|
+
/**
|
|
1781
|
+
* 点の強調(Tufte 流)。`"auto"` は最新・最大・最小の 3 点だけに小さな点を打つ
|
|
1782
|
+
* (最新は系列の色、最大・最小は muted)。`"latest"` は最新の 1 点だけ、`"none"` は線だけ。`variant="line"` のときだけ効く。既定 `"auto"`。
|
|
1783
|
+
*/
|
|
1784
|
+
highlight?: ChartHighlight | "latest";
|
|
1785
|
+
/** 指定すると `role="img"` で読み上げ対象にする。省略時は装飾として `aria-hidden`。 */
|
|
1786
|
+
"aria-label"?: string;
|
|
327
1787
|
className?: string;
|
|
328
1788
|
}
|
|
329
1789
|
declare const Sparkline: React.ForwardRefExoticComponent<SparklineProps & React.RefAttributes<SVGSVGElement>>;
|
|
330
1790
|
|
|
1791
|
+
declare module "@tanstack/react-table" {
|
|
1792
|
+
interface ColumnMeta<TData extends RowData, TValue> {
|
|
1793
|
+
/**
|
|
1794
|
+
* Classes put on the column's header and body cells — e.g.
|
|
1795
|
+
* `"hidden md:table-cell"` to drop a column on narrow screens.
|
|
1796
|
+
*/
|
|
1797
|
+
className?: string;
|
|
1798
|
+
/**
|
|
1799
|
+
* 列の数値書式。`cell` を持たない列だけに効き、右寄せ・tabular-nums で描く。
|
|
1800
|
+
* 行ごとに通貨が変わるときは関数で行を受ける。CSV の「表示」値にも使われる。
|
|
1801
|
+
*
|
|
1802
|
+
* @example
|
|
1803
|
+
* meta: { format: "currency" }
|
|
1804
|
+
* meta: { format: (row) => ({ type: "currency", currency: row.currency, notation: "standard" }) }
|
|
1805
|
+
*/
|
|
1806
|
+
format?: ValueFormat | ((row: TData) => ValueFormat);
|
|
1807
|
+
/**
|
|
1808
|
+
* 日付の列の書式(`formatDate` の `style`)。`cell` を持たない列だけに効く。左寄せ・tabular-nums で描き、
|
|
1809
|
+
* 値は `Date`・エポックミリ秒・日付文字列(`"2026-10-20"`、ISO 8601)。CSV の「表示」値にも使われる。
|
|
1810
|
+
* `format`(数値)とは併用しない。
|
|
1811
|
+
*
|
|
1812
|
+
* @example
|
|
1813
|
+
* meta: { dateFormat: "date" }
|
|
1814
|
+
* meta: { dateFormat: "datetime", nullLabel: "未更新" }
|
|
1815
|
+
*/
|
|
1816
|
+
dateFormat?: DateStyle;
|
|
1817
|
+
/**
|
|
1818
|
+
* `dateFormat` の列の日時を出すタイムゾーン(IANA 名。例 `"Asia/Tokyo"`)。既定は実行環境(ブラウザ)のタイムゾーン。
|
|
1819
|
+
* サーバーとブラウザで表示が食い違う(SSR)なら固定する。`dateFormat` の列だけに効き、CSV の「表示」値にも同じ値を使う。
|
|
1820
|
+
* `"2026-10-20"` のような日付だけの文字列は、どのタイムゾーンでもその暦日のまま。
|
|
1821
|
+
*
|
|
1822
|
+
* @example
|
|
1823
|
+
* meta: { dateFormat: "datetime", timeZone: "Asia/Tokyo" }
|
|
1824
|
+
*/
|
|
1825
|
+
timeZone?: string;
|
|
1826
|
+
/**
|
|
1827
|
+
* 値が無いときの表示。既定 `"—"`。null / undefined(数値は NaN も)に効き、文字列の列では空文字 `""` も値なしとして扱う。
|
|
1828
|
+
* `format` / `dateFormat` を持つ列と、書式なしの文字列の列に効く。`cell` を自前で書いた列には効かない(`cell` の中で扱う)。
|
|
1829
|
+
* CSV の「表示」値は、書式付き・日付の列だけ `nullLabel` で書き、書式なしの文字列の列は空欄のまま。
|
|
1830
|
+
*
|
|
1831
|
+
* @example
|
|
1832
|
+
* meta: { format: "number", nullLabel: "未集計" }
|
|
1833
|
+
* meta: { nullLabel: "未設定" } // 書式なしの文字列の列
|
|
1834
|
+
*/
|
|
1835
|
+
nullLabel?: string;
|
|
1836
|
+
/**
|
|
1837
|
+
* 値の範囲でセルを意味色に塗り分ける規則(最初に当たった規則。どれにも当たらない値は通常色)。
|
|
1838
|
+
* `cell` を持たない列だけに効き、BarChart / BarList の `thresholds` と同じ型・同じ判定。
|
|
1839
|
+
* 色だけに頼らず、色に応じた記号(○ / △ / × / −)を値の前に添える。CSV は生の値のまま。
|
|
1840
|
+
*
|
|
1841
|
+
* @example
|
|
1842
|
+
* meta: { format: { type: "percent", divisor: 100 }, thresholds: [{ lt: 40, tone: "negative" }, { lt: 70, tone: "warning" }] }
|
|
1843
|
+
*/
|
|
1844
|
+
thresholds?: ChartThreshold[];
|
|
1845
|
+
/**
|
|
1846
|
+
* 狭い幅で列を隠す順。数が小さい列から隠れる(表の置き場の幅が 1 は 640px 未満、2 は 520px 未満、3 は 400px 未満)。
|
|
1847
|
+
* 書かない列と 4 以上の列は、どの幅でも出す(部署名・離職率のような肝心の列に使う)。
|
|
1848
|
+
* 画面の幅ではなく、表を置いた場所の幅(コンテナ幅)で決まる。隠した列は DOM にも読み上げにも出ず、CSV の出力には含まれる。
|
|
1849
|
+
*
|
|
1850
|
+
* @example
|
|
1851
|
+
* meta: { format: "number", priority: 1 } // 幅が足りないときに最初に隠す
|
|
1852
|
+
*/
|
|
1853
|
+
priority?: number;
|
|
1854
|
+
/**
|
|
1855
|
+
* true にすると、増減(`Delta`)など「直前の列の値との比較」を表示する列になる。表の置き場が 320px 未満に狭まると、
|
|
1856
|
+
* この列は隠れる代わりに、直前の列(値の列)のセルの下に同じ内容を小さく(text-xs)積んで出す。比較は消えない。
|
|
1857
|
+
* `priority` で隠す順は最後(どの列よりも後)になり、この列の `priority` は無視される。直前の列も `priority` に関わらず残る。
|
|
1858
|
+
* 列の `cell` に `<Delta variant="inline" … />` を書く。直前に列が無いときは積まず、通常の列として出す。CSV には通常の列として含まれる。
|
|
1859
|
+
*
|
|
1860
|
+
* @example
|
|
1861
|
+
* { accessorKey: "revenue", header: "売上", meta: { format: "currency" } },
|
|
1862
|
+
* { id: "revenueDelta", header: "前月比", meta: { comparison: true }, cell: ({ row }) => <Delta variant="inline" value={row.original.revenue} comparison={{ previous: row.original.prev, vs: "prior-period", grain: "month" }} /> }
|
|
1863
|
+
*/
|
|
1864
|
+
comparison?: boolean;
|
|
1865
|
+
/**
|
|
1866
|
+
* 列の寄せ。見出し(ソートボタンを含む)とセルの両方に効く。既定は、`format` / `thresholds` の列と
|
|
1867
|
+
* `comparison` の列(増減 `Delta`)が `"right"`、それ以外は `"left"`。右寄せの列は tabular-nums で描く。
|
|
1868
|
+
*
|
|
1869
|
+
* @example
|
|
1870
|
+
* meta: { align: "right" }
|
|
1871
|
+
*/
|
|
1872
|
+
align?: "left" | "right";
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
331
1875
|
interface DataTableContextValue<TData> {
|
|
332
1876
|
table: Table<TData>;
|
|
333
1877
|
selectedRows: TData[];
|
|
@@ -338,6 +1882,7 @@ interface DataTableContextValue<TData> {
|
|
|
338
1882
|
enablePagination: boolean;
|
|
339
1883
|
enableRowSelection: boolean;
|
|
340
1884
|
visibleColumnCount: number;
|
|
1885
|
+
isLoading: boolean;
|
|
341
1886
|
}
|
|
342
1887
|
/**
|
|
343
1888
|
* @template TData 行データ型
|
|
@@ -352,7 +1897,8 @@ interface DataTableProps<TData, TValue> {
|
|
|
352
1897
|
* literal が `string` に拡張され型エラーになる。
|
|
353
1898
|
*
|
|
354
1899
|
* @example
|
|
355
|
-
* import type
|
|
1900
|
+
* import { DataTable, type ColumnDef } from "@/components/data-table"
|
|
1901
|
+
* // Vantage: import { DataTable, type ColumnDef } from "@squadbase/vantage/components"
|
|
356
1902
|
*
|
|
357
1903
|
* const columns: ColumnDef<User>[] = [
|
|
358
1904
|
* { accessorKey: "id", header: "ID" },
|
|
@@ -373,12 +1919,54 @@ interface DataTableProps<TData, TValue> {
|
|
|
373
1919
|
enablePagination?: boolean;
|
|
374
1920
|
pagination?: PaginationState;
|
|
375
1921
|
onPaginationChange?: OnChangeFn<PaginationState>;
|
|
1922
|
+
/**
|
|
1923
|
+
* サーバー側ページング時の総ページ数。指定すると manualPagination になる。
|
|
1924
|
+
*
|
|
1925
|
+
* @example
|
|
1926
|
+
* <DataTable pageCount={data.pageCount} … />
|
|
1927
|
+
*/
|
|
376
1928
|
pageCount?: number;
|
|
1929
|
+
/**
|
|
1930
|
+
* サーバー側ページング時の総件数。指定すると manualPagination になり、ページ数は
|
|
1931
|
+
* `rowCount / pageSize` から導かれ、「N件中」もこの値を使う(`pageCount` を同時に渡せばそちらが優先)。
|
|
1932
|
+
*
|
|
1933
|
+
* @example
|
|
1934
|
+
* <DataTable rowCount={1240} pagination={pagination} onPaginationChange={setPagination} … />
|
|
1935
|
+
*/
|
|
1936
|
+
rowCount?: number;
|
|
1937
|
+
/**
|
|
1938
|
+
* true にすると絞り込みを表では行わず、`data` をそのまま使う(サーバー側で絞り込む)。
|
|
1939
|
+
*
|
|
1940
|
+
* @example
|
|
1941
|
+
* <DataTable manualFiltering globalFilter={q} onGlobalFilterChange={setQ} … />
|
|
1942
|
+
*/
|
|
1943
|
+
manualFiltering?: boolean;
|
|
1944
|
+
/**
|
|
1945
|
+
* true にすると並べ替えを表では行わず、`data` の順をそのまま使う(サーバー側で並べ替える)。
|
|
1946
|
+
*
|
|
1947
|
+
* @example
|
|
1948
|
+
* <DataTable manualSorting sorting={sorting} onSortingChange={setSorting} … />
|
|
1949
|
+
*/
|
|
1950
|
+
manualSorting?: boolean;
|
|
1951
|
+
/**
|
|
1952
|
+
* 読み込み中。Content はスケルトン行、Pagination のボタンは無効、表は aria-busy になる。
|
|
1953
|
+
*
|
|
1954
|
+
* @example
|
|
1955
|
+
* <DataTable isLoading={query.isFetching} … />
|
|
1956
|
+
*/
|
|
1957
|
+
isLoading?: boolean;
|
|
377
1958
|
enableRowSelection?: boolean;
|
|
378
1959
|
rowSelection?: RowSelectionState;
|
|
379
1960
|
onRowSelectionChange?: OnChangeFn<RowSelectionState>;
|
|
380
1961
|
columnVisibility?: VisibilityState;
|
|
381
1962
|
onColumnVisibilityChange?: OnChangeFn<VisibilityState>;
|
|
1963
|
+
/**
|
|
1964
|
+
* TanStack Table の `meta`。表全体で共有する値(行を更新する関数など)を渡し、列定義の `cell` から
|
|
1965
|
+
* `table.options.meta` で読む。列ごとの書式は列定義の `meta.format` に書く(こちらではない)。
|
|
1966
|
+
*
|
|
1967
|
+
* @example
|
|
1968
|
+
* <DataTable meta={{ updateRow: (id, patch) => mutate({ id, patch }) }} … />
|
|
1969
|
+
*/
|
|
382
1970
|
meta?: TableMeta<TData>;
|
|
383
1971
|
className?: string;
|
|
384
1972
|
/** Required — the parts to render (toolbar, content, pagination). */
|
|
@@ -391,6 +1979,32 @@ interface DataTableToolbarProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
391
1979
|
}
|
|
392
1980
|
interface DataTableContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
393
1981
|
}
|
|
1982
|
+
interface DataTableExportProps {
|
|
1983
|
+
/**
|
|
1984
|
+
* 保存するファイル名。既定 `"export.csv"`。
|
|
1985
|
+
*
|
|
1986
|
+
* @example
|
|
1987
|
+
* <DataTableExport fileName="sales-2025.csv" />
|
|
1988
|
+
*/
|
|
1989
|
+
fileName?: string;
|
|
1990
|
+
/**
|
|
1991
|
+
* `"display"`(既定)は `meta.format` どおりの表示文字列、`"raw"` は生の値を書き出す。
|
|
1992
|
+
*
|
|
1993
|
+
* @example
|
|
1994
|
+
* <DataTableExport values="raw" />
|
|
1995
|
+
*/
|
|
1996
|
+
values?: CsvValues;
|
|
1997
|
+
/**
|
|
1998
|
+
* `"filtered"`(既定)は並べ替え・絞り込み後の全ページ、`"page"` は表示中のページだけ。
|
|
1999
|
+
*
|
|
2000
|
+
* @example
|
|
2001
|
+
* <DataTableExport scope="page" />
|
|
2002
|
+
*/
|
|
2003
|
+
scope?: CsvScope;
|
|
2004
|
+
/** ボタンの文言。既定 `"CSV を書き出す"`。 */
|
|
2005
|
+
children?: ReactNode;
|
|
2006
|
+
className?: string;
|
|
2007
|
+
}
|
|
394
2008
|
interface DataTablePaginationProps extends HTMLAttributes<HTMLDivElement> {
|
|
395
2009
|
pageSizeOptions?: number[];
|
|
396
2010
|
}
|
|
@@ -403,12 +2017,26 @@ interface DataTableColumnVisibilityProps {
|
|
|
403
2017
|
type DataTablePresetProps<TData, TValue> = Omit<DataTableProps<TData, TValue>, "children"> & {
|
|
404
2018
|
enableColumnVisibility?: boolean;
|
|
405
2019
|
columnLabels?: Record<string, string>;
|
|
2020
|
+
/**
|
|
2021
|
+
* true にすると toolbar に CSV 書き出しボタン(`DataTableExport`)を置く。既定 false。
|
|
2022
|
+
*
|
|
2023
|
+
* @example
|
|
2024
|
+
* <DataTablePreset exportable … />
|
|
2025
|
+
*/
|
|
2026
|
+
exportable?: boolean;
|
|
2027
|
+
/**
|
|
2028
|
+
* `exportable` のときの保存ファイル名。既定 `"export.csv"`。
|
|
2029
|
+
*
|
|
2030
|
+
* @example
|
|
2031
|
+
* <DataTablePreset exportable exportFileName="sales.csv" … />
|
|
2032
|
+
*/
|
|
2033
|
+
exportFileName?: string;
|
|
406
2034
|
/** Extension slots */
|
|
407
2035
|
toolbar?: ReactNode;
|
|
408
2036
|
bulkActions?: (selectedRows: TData[]) => ReactNode;
|
|
409
2037
|
};
|
|
410
2038
|
declare function useDataTable<TData>(): DataTableContextValue<TData>;
|
|
411
|
-
declare function DataTable<TData, TValue>({ columns, data, enableSorting, sorting: sortingProp, onSortingChange, enableFiltering, columnFilters: columnFiltersProp, onColumnFiltersChange, globalFilter: globalFilterProp, onGlobalFilterChange, enablePagination, pagination: paginationProp, onPaginationChange, pageCount, enableRowSelection, rowSelection: rowSelectionProp, onRowSelectionChange, columnVisibility: columnVisibilityProp, onColumnVisibilityChange, meta, className, children, }: DataTableProps<TData, TValue>): React.JSX.Element;
|
|
2039
|
+
declare function DataTable<TData, TValue>({ columns, data, enableSorting, sorting: sortingProp, onSortingChange, enableFiltering, columnFilters: columnFiltersProp, onColumnFiltersChange, globalFilter: globalFilterProp, onGlobalFilterChange, enablePagination, pagination: paginationProp, onPaginationChange, pageCount, rowCount, manualFiltering, manualSorting, isLoading, enableRowSelection, rowSelection: rowSelectionProp, onRowSelectionChange, columnVisibility: columnVisibilityProp, onColumnVisibilityChange, meta, className, children, }: DataTableProps<TData, TValue>): React.JSX.Element;
|
|
412
2040
|
declare namespace DataTable {
|
|
413
2041
|
var displayName: string;
|
|
414
2042
|
}
|
|
@@ -416,8 +2044,39 @@ declare const DataTableToolbar: React.ForwardRefExoticComponent<DataTableToolbar
|
|
|
416
2044
|
declare const DataTableContent: React.ForwardRefExoticComponent<DataTableContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
417
2045
|
declare const DataTablePagination: React.ForwardRefExoticComponent<DataTablePaginationProps & React.RefAttributes<HTMLDivElement>>;
|
|
418
2046
|
declare const DataTableColumnVisibility: React.ForwardRefExoticComponent<DataTableColumnVisibilityProps & React.RefAttributes<HTMLButtonElement>>;
|
|
2047
|
+
type CsvCell = string | number | null | undefined;
|
|
2048
|
+
type CsvValues = "display" | "raw";
|
|
2049
|
+
type CsvScope = "filtered" | "page";
|
|
2050
|
+
/**
|
|
2051
|
+
* CSV 文字列を作る純関数(RFC 4180: CRLF、`,` `"` 改行を含む欄は `"` で囲み `"` は二重化)。
|
|
2052
|
+
* 既定で BOM 付き UTF-8(Excel で文字化けしない)。`guardFormulas` が true の間、先頭が
|
|
2053
|
+
* `= + - @` の文字列欄には `'` を付けて数式として実行されないようにする(数値と符号付きの数値表記は除く)。
|
|
2054
|
+
*
|
|
2055
|
+
* @example
|
|
2056
|
+
* toCsv(["月", "売上"], [["2025-01", 1200], ["2025-02", null]])
|
|
2057
|
+
* // "\uFEFF月,売上\r\n2025-01,1200\r\n2025-02,"
|
|
2058
|
+
*/
|
|
2059
|
+
declare function toCsv(header: string[], rows: CsvCell[][], options?: {
|
|
2060
|
+
bom?: boolean;
|
|
2061
|
+
guardFormulas?: boolean;
|
|
2062
|
+
}): string;
|
|
2063
|
+
/**
|
|
2064
|
+
* 表の現在の状態から CSV を作る。行は画面と同じ並べ替え・絞り込み後の順、列は表示中の列のみ。
|
|
2065
|
+
*
|
|
2066
|
+
* @example
|
|
2067
|
+
* const csv = tableToCsv(table, { values: "raw", scope: "page" })
|
|
2068
|
+
*/
|
|
2069
|
+
declare function tableToCsv<TData>(table: Table<TData>, { values, scope }?: {
|
|
2070
|
+
values?: CsvValues;
|
|
2071
|
+
scope?: CsvScope;
|
|
2072
|
+
}): string;
|
|
2073
|
+
/** toolbar に置く CSV 書き出しボタン。`useDataTable()` の table から画面と同じ順・同じ集合を書き出す。 */
|
|
2074
|
+
declare function DataTableExport({ fileName, values, scope, children, className, }: DataTableExportProps): React.JSX.Element;
|
|
2075
|
+
declare namespace DataTableExport {
|
|
2076
|
+
var displayName: string;
|
|
2077
|
+
}
|
|
419
2078
|
/** The usual arrangement — toolbar, body and pagination — in one component. */
|
|
420
|
-
declare function DataTablePreset<TData, TValue>({ enableColumnVisibility, columnLabels, toolbar, bulkActions, ...tableProps }: DataTablePresetProps<TData, TValue>): React.JSX.Element;
|
|
2079
|
+
declare function DataTablePreset<TData, TValue>({ enableColumnVisibility, columnLabels, exportable, exportFileName, toolbar, bulkActions, ...tableProps }: DataTablePresetProps<TData, TValue>): React.JSX.Element;
|
|
421
2080
|
declare namespace DataTablePreset {
|
|
422
2081
|
var displayName: string;
|
|
423
2082
|
}
|
|
@@ -435,9 +2094,15 @@ interface FilterBarSelectProps {
|
|
|
435
2094
|
label: string;
|
|
436
2095
|
options: FilterOption[];
|
|
437
2096
|
placeholder?: string;
|
|
2097
|
+
/**
|
|
2098
|
+
* 渡すと、選択肢の先頭に「絞り込まない」項目をこの文言で足す(例: `"すべて"`)。選ぶとこのキーを値から外す(`undefined`)ので、
|
|
2099
|
+
* アクティブチップにも出ない。絞り込んでいないときのトリガーは `placeholder`(既定は `label`)のまま。既定は足さない。
|
|
2100
|
+
* @example allLabel="すべて"
|
|
2101
|
+
*/
|
|
2102
|
+
allLabel?: string;
|
|
438
2103
|
className?: string;
|
|
439
2104
|
}
|
|
440
|
-
declare function FilterBarSelect({ filterKey, label, options, placeholder, className, }: FilterBarSelectProps): React.JSX.Element;
|
|
2105
|
+
declare function FilterBarSelect({ filterKey, label, options, placeholder, allLabel, className, }: FilterBarSelectProps): React.JSX.Element;
|
|
441
2106
|
declare namespace FilterBarSelect {
|
|
442
2107
|
var displayName: string;
|
|
443
2108
|
}
|
|
@@ -483,23 +2148,47 @@ declare namespace FilterBarPreset {
|
|
|
483
2148
|
var displayName: string;
|
|
484
2149
|
}
|
|
485
2150
|
|
|
2151
|
+
/** 既定のプリセット(英語・4 月始まり)。`locale` / `fiscalYearStartMonth` を変えるなら `createDatePresets` か DateRangePicker の同名 props。 */
|
|
486
2152
|
declare const defaultPresets: PresetItem[];
|
|
487
2153
|
interface DateRangePickerProps {
|
|
488
2154
|
/**
|
|
489
|
-
*
|
|
2155
|
+
* 選択中の日付範囲。型はこの部品独自の `DateRange`。
|
|
490
2156
|
* react-day-picker の `DateRange` とは別物なので注意 — そちらが必要なら
|
|
491
2157
|
* このファイルの末尾で re-export している `RdpDateRange` を使う。
|
|
492
2158
|
*
|
|
493
2159
|
* @example
|
|
494
|
-
* import type
|
|
2160
|
+
* import { DateRangePicker, type DateRange } from "@/components/date-range-picker"
|
|
2161
|
+
* // Vantage: import { DateRangePicker, type DateRange } from "@squadbase/vantage/components"
|
|
495
2162
|
*
|
|
496
2163
|
* const [range, setRange] = useState<DateRange | undefined>()
|
|
497
2164
|
* <DateRangePicker value={range} onChange={setRange} />
|
|
498
2165
|
*/
|
|
499
2166
|
value?: DateRange;
|
|
500
2167
|
onChange?: (range: DateRange) => void;
|
|
2168
|
+
/**
|
|
2169
|
+
* ショートカットの一覧。指定すると `locale` / `fiscalYearStartMonth` による既定の一覧の代わりに使う。
|
|
2170
|
+
*
|
|
2171
|
+
* @example
|
|
2172
|
+
* presets={[{ label: "直近 10 日", getValue: () => ({ from: subDays(new Date(), 9), to: new Date() }) }]}
|
|
2173
|
+
*/
|
|
501
2174
|
presets?: PresetItem[];
|
|
502
2175
|
showPresets?: boolean;
|
|
2176
|
+
/**
|
|
2177
|
+
* プリセットのラベルとカレンダーの月名・曜日の言語。`ja*` なら日本語、それ以外は英語。既定 `"en-US"`(英語)。
|
|
2178
|
+
* 他部品の既定は ja-JP だが、この部品は従来のプリセットが英語だったので既存の見た目を保つため英語を既定にしている。
|
|
2179
|
+
*
|
|
2180
|
+
* @example
|
|
2181
|
+
* <DateRangePicker locale="ja-JP" />
|
|
2182
|
+
*/
|
|
2183
|
+
locale?: string;
|
|
2184
|
+
/**
|
|
2185
|
+
* 年度の開始月(1-12)。「今年度」「前年度」と、年度基準の「今四半期」「前四半期」の区切りになる。既定 `4`(4 月始まり)。
|
|
2186
|
+
* 範囲外・整数でない値は 4 として扱う。
|
|
2187
|
+
*
|
|
2188
|
+
* @example
|
|
2189
|
+
* <DateRangePicker fiscalYearStartMonth={1} />
|
|
2190
|
+
*/
|
|
2191
|
+
fiscalYearStartMonth?: number;
|
|
503
2192
|
maxDate?: Date;
|
|
504
2193
|
minDate?: Date;
|
|
505
2194
|
placeholder?: string;
|
|
@@ -560,29 +2249,287 @@ declare const metricValueVariants: (props?: ({
|
|
|
560
2249
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
561
2250
|
interface MetricValueProps extends HTMLAttributes<HTMLDivElement>, VariantProps<typeof metricValueVariants> {
|
|
562
2251
|
}
|
|
2252
|
+
/** @deprecated KPI の数字は KpiCard を使う。 */
|
|
563
2253
|
declare const MetricValue: React.ForwardRefExoticComponent<MetricValueProps & React.RefAttributes<HTMLDivElement>>;
|
|
564
2254
|
interface MetricUnitProps extends HTMLAttributes<HTMLSpanElement> {
|
|
565
2255
|
}
|
|
2256
|
+
/** @deprecated KPI の単位は KpiCard の `format`(`{ type: "number", unit: "社" }`)で付ける。 */
|
|
566
2257
|
declare const MetricUnit: React.ForwardRefExoticComponent<MetricUnitProps & React.RefAttributes<HTMLSpanElement>>;
|
|
567
2258
|
|
|
2259
|
+
/**
|
|
2260
|
+
* Lightweight KPI insights: progress toward a target (with a simple linear pace
|
|
2261
|
+
* projection) and "highest / lowest in N periods" record detection. No statistics.
|
|
2262
|
+
*
|
|
2263
|
+
* Both follow `polarity`: for a lower-is-better metric (churn, cost) the target
|
|
2264
|
+
* is met at or below it, and the record is the lowest value, never the highest.
|
|
2265
|
+
*/
|
|
2266
|
+
|
|
2267
|
+
interface KpiPeriod {
|
|
2268
|
+
start: Date | string | number;
|
|
2269
|
+
end: Date | string | number;
|
|
2270
|
+
}
|
|
2271
|
+
interface TargetProgress {
|
|
2272
|
+
target: number;
|
|
2273
|
+
/**
|
|
2274
|
+
* Distance left to the target, never negative: `target − current` when higher
|
|
2275
|
+
* is better, `current − target` when lower is better. 0 once achieved.
|
|
2276
|
+
*/
|
|
2277
|
+
remaining: number;
|
|
2278
|
+
/** Whether the current value meets the target (≥ for higher-is-better, ≤ for lower-is-better). */
|
|
2279
|
+
achieved: boolean;
|
|
2280
|
+
/**
|
|
2281
|
+
* How far the target is met, as a ratio: `current / target` when higher is
|
|
2282
|
+
* better, `target / current` when lower is better (1 = exactly on target).
|
|
2283
|
+
*/
|
|
2284
|
+
achievement: number;
|
|
2285
|
+
/** achievement / elapsed when the period is in progress, else null. Higher-is-better only. */
|
|
2286
|
+
projected: number | null;
|
|
2287
|
+
/** Fraction of the period elapsed at `now`, or null without a valid period. */
|
|
2288
|
+
elapsed: number | null;
|
|
2289
|
+
}
|
|
2290
|
+
declare function computeTargetProgress(current: number | null | undefined, target: number | null | undefined, options?: {
|
|
2291
|
+
period?: KpiPeriod;
|
|
2292
|
+
now?: Date | number;
|
|
2293
|
+
polarity?: Polarity;
|
|
2294
|
+
}): TargetProgress | null;
|
|
2295
|
+
/** @deprecated Use `PeriodGrain` (same values). */
|
|
2296
|
+
type HistoryGrain = PeriodGrain;
|
|
2297
|
+
/**
|
|
2298
|
+
* The grain of a period from its length: ~1 day, 7 days, 28–31 days, 89–92 days
|
|
2299
|
+
* or 365–366 days. Anything else (a custom range) returns undefined.
|
|
2300
|
+
*/
|
|
2301
|
+
declare function inferPeriodGrain(period: KpiPeriod | null | undefined): PeriodGrain | undefined;
|
|
2302
|
+
interface RecordInsight {
|
|
2303
|
+
span: number;
|
|
2304
|
+
grain: PeriodGrain;
|
|
2305
|
+
/** "highest" for higher-is-better, "lowest" for lower-is-better. */
|
|
2306
|
+
kind: "highest" | "lowest";
|
|
2307
|
+
label: string;
|
|
2308
|
+
}
|
|
2309
|
+
/** Fewer finite points than this never yields a record. */
|
|
2310
|
+
declare const RECORD_MIN_POINTS = 6;
|
|
2311
|
+
/**
|
|
2312
|
+
* The latest point is a record when it beats every earlier finite point:
|
|
2313
|
+
* strictly highest for higher-is-better, strictly lowest for lower-is-better.
|
|
2314
|
+
*/
|
|
2315
|
+
declare function detectRecord(history: ReadonlyArray<number | null | undefined> | null | undefined, grain?: PeriodGrain, polarity?: Polarity): RecordInsight | null;
|
|
2316
|
+
|
|
2317
|
+
interface KpiCardSource {
|
|
2318
|
+
/** Period the data covers (e.g. "2023-04 以降"). ISO year-months / dates in it are written by the card ("2023年4月 以降"). */
|
|
2319
|
+
period?: string;
|
|
2320
|
+
/** Number of rows aggregated; formatted by the card ("48,210件から集計"). */
|
|
2321
|
+
count?: number;
|
|
2322
|
+
/**
|
|
2323
|
+
* 集計から除いた行数。出典の脚注に「12件を除外」と添える(ja 以外は「12 excluded」)。0 や負の値は出さない。
|
|
2324
|
+
* 除外の理由(テスト用アカウント、欠損など)は `note` に書く。
|
|
2325
|
+
* @example source={{ count: 48_210, excluded: 12, note: "テスト用アカウントを除外" }}
|
|
2326
|
+
*/
|
|
2327
|
+
excluded?: number;
|
|
2328
|
+
/** Data source name (e.g. "Snowflake"). */
|
|
2329
|
+
name?: string;
|
|
2330
|
+
/** 換算・税抜などの脚注。フッターに出す。例: `note: "税抜、1 ドル=150 円で換算"`。数字を使う説明は summary ではなくここへ。 */
|
|
2331
|
+
note?: string;
|
|
2332
|
+
}
|
|
2333
|
+
interface KpiCardProps extends Omit<ComponentProps<"div">, "children"> {
|
|
2334
|
+
/** Metric name (tier 1). */
|
|
2335
|
+
label: string;
|
|
2336
|
+
/** Current value (tier 2). null / undefined renders "—". */
|
|
2337
|
+
value: number | null | undefined;
|
|
2338
|
+
/**
|
|
2339
|
+
* Value format, also used for previous / target / remaining. Default `"compact"`.
|
|
2340
|
+
* `"currency"` is JPY in 万・億; `"percent"` takes a ratio (0.021 → 2.1%) and
|
|
2341
|
+
* switches the delta to points. See `formatValue` for the full table.
|
|
2342
|
+
*/
|
|
2343
|
+
format?: ValueFormat;
|
|
2344
|
+
/** Default `"ja-JP"`. */
|
|
2345
|
+
locale?: string;
|
|
2346
|
+
/**
|
|
2347
|
+
* What the value is compared against; drives the delta (tier 3) and previous line (tier 4).
|
|
2348
|
+
* 前期・前年・目標以外は `vs: "custom"` + `label`(バッジの呼び名。末尾の「比」を外した語が前期実績行の呼び名になる)。
|
|
2349
|
+
* @example comparison={{ previous: 617, vs: "custom", label: "昨日比" }}
|
|
2350
|
+
*/
|
|
2351
|
+
comparison?: Comparison;
|
|
2352
|
+
/**
|
|
2353
|
+
* 前年比と前月比など、複数の比較を併記する。先頭だけが前期実績行と summary に使われ、2 つ目以降は Delta 行のみ。`comparison` も渡したらそれが先頭。バッジは値の下に並ぶ。
|
|
2354
|
+
* @example comparisons={[{ previous: 4_290, vs: "prior-period", grain: "month" }, { previous: 3_900, vs: "prior-year", grain: "month" }]} / comparisons={[{ previous: 617, vs: "custom", label: "昨日比" }, { previous: 590, vs: "custom", label: "先週の同じ曜日比" }]}
|
|
2355
|
+
*/
|
|
2356
|
+
comparisons?: Comparison[];
|
|
2357
|
+
/**
|
|
2358
|
+
* 確定前の値。値の隣に「速報」バッジを出し、目標の「達成」を言い切らず、最高記録の判定も出さない。
|
|
2359
|
+
* @example provisional / provisional={{ label: "暫定" }}
|
|
2360
|
+
*/
|
|
2361
|
+
provisional?: boolean | {
|
|
2362
|
+
label?: string;
|
|
2363
|
+
};
|
|
2364
|
+
/** Whether a rise is good. Default `"higher-is-better"`. `"neutral"` never colours the change and skips the target and record logic. */
|
|
2365
|
+
polarity?: Polarity;
|
|
2366
|
+
/** `"relative"` ("+12.4%"), `"points"` ("-0.5pt") or `"difference"` ("+¥530万", in `format`). Default: points for a `percent` format, else relative. */
|
|
2367
|
+
change?: ChangeDisplay;
|
|
2368
|
+
/** Absolute ratio below which the change reads as flat. Default 0.01. */
|
|
2369
|
+
neutralBand?: number;
|
|
2370
|
+
/** Show the previous actual ("前月 400"). Default true; needs `comparison`. */
|
|
2371
|
+
showPrevious?: boolean;
|
|
2372
|
+
/** Conclusion sentence template (tier 5); see the placeholders above. */
|
|
2373
|
+
summary?: string;
|
|
2374
|
+
/**
|
|
2375
|
+
* Target for the current period. Under the value it adds a 6px bar (actual, the pace
|
|
2376
|
+
* projection, a tick at the target) and one line "目標の 49%・このペースなら 98%"
|
|
2377
|
+
* (the projection only while `period` is in progress). With `polarity="lower-is-better"`
|
|
2378
|
+
* or a rate target (points) there is no bar: "目標 … まであと …" in the footer.
|
|
2379
|
+
*/
|
|
2380
|
+
target?: number;
|
|
2381
|
+
/**
|
|
2382
|
+
* 目標行・見込み行での目標の呼び名。既定「目標」。予算・計画・ノルマなど業務の言葉に合わせる。
|
|
2383
|
+
* @example targetLabel="予算" // 予算まであと ¥2,934万(98.1% 達成)
|
|
2384
|
+
*/
|
|
2385
|
+
targetLabel?: string;
|
|
2386
|
+
/**
|
|
2387
|
+
* 目標に対する進み具合の出し方。`"achievement"` は達成率(現在値 ÷ 目標。「98.1% 達成」)、`"points"` は目標との差(「あと 2.8pt」)。
|
|
2388
|
+
* 既定は `format` から決まる: `percent`(率)は `"points"`(率を率で割った達成度は読めない)、それ以外は `"achievement"`。
|
|
2389
|
+
* `"points"` のとき `{achievement}` は目標との符号付きの差("-2.8pt")になり、見込み行は出ない。
|
|
2390
|
+
*/
|
|
2391
|
+
targetDisplay?: "achievement" | "points";
|
|
2392
|
+
/** Current period; with `target`, adds a pace projection while the period is in progress. */
|
|
2393
|
+
period?: KpiPeriod;
|
|
2394
|
+
/** Series ending at the current period (last point = `value`); adds a record badge. */
|
|
2395
|
+
history?: ReadonlyArray<number | null | undefined>;
|
|
2396
|
+
/** Grain of `history` (and of the comparison labels). Default: inferred from `period`, else `"month"` for the record. */
|
|
2397
|
+
historyGrain?: PeriodGrain;
|
|
2398
|
+
/**
|
|
2399
|
+
* `history` が 6 点以上あるとき、フッター末尾に軸なしのスパークライン(高さ 32px・`--chart-1`・最新点だけドット)を出す。既定 true。
|
|
2400
|
+
* 推移を出したくないカードは `showHistory={false}`(記録バッジは `history` があれば出る)。
|
|
2401
|
+
* @example showHistory={false}
|
|
2402
|
+
*/
|
|
2403
|
+
showHistory?: boolean;
|
|
2404
|
+
/** Data source footnote. */
|
|
2405
|
+
source?: KpiCardSource;
|
|
2406
|
+
/** When the data was last refreshed: "3 分前に更新". 出し方は `updatedAtDisplay`。 */
|
|
2407
|
+
updatedAt?: Date | string | number;
|
|
2408
|
+
/**
|
|
2409
|
+
* `updatedAt` の出し方。`"relative"`(既定)は「3 分前に更新」、`"absolute"` は「2026/10/20 14:30 に更新」、
|
|
2410
|
+
* `"both"` は「2026/10/20 14:30 に更新(3 分前)」。絶対時刻は実行環境のタイムゾーンで出す(`timeZone` で固定できる)。
|
|
2411
|
+
* 画面を印刷・スクリーンショットで残すなら、時間が経っても読める `"absolute"` か `"both"`。
|
|
2412
|
+
* @example updatedAtDisplay="absolute"
|
|
2413
|
+
*/
|
|
2414
|
+
updatedAtDisplay?: "relative" | "absolute" | "both";
|
|
2415
|
+
/**
|
|
2416
|
+
* `updatedAt` の絶対時刻(`updatedAtDisplay` が `"absolute"` / `"both"`)を出すタイムゾーン(IANA 名。例 `"Asia/Tokyo"`)。
|
|
2417
|
+
* 既定は実行環境(ブラウザ)のタイムゾーン。サーバーとブラウザで表示が食い違う(SSR)なら固定する。「3 分前」には影響しない。
|
|
2418
|
+
* @example updatedAtDisplay="absolute" timeZone="Asia/Tokyo"
|
|
2419
|
+
*/
|
|
2420
|
+
timeZone?: string;
|
|
2421
|
+
/** Reference time for the projection and relative time (for deterministic rendering). */
|
|
2422
|
+
now?: Date | number;
|
|
2423
|
+
/** Render a skeleton with the final shape instead of the values. */
|
|
2424
|
+
isLoading?: boolean;
|
|
2425
|
+
/**
|
|
2426
|
+
* `"sm"` は Sheet の中など狭い場所で 2 枚を横に並べるときの小さいサイズ。値の文字と余白が一段小さくなり、スパークラインは出さない。既定 `"default"`。
|
|
2427
|
+
* @example size="sm"
|
|
2428
|
+
*/
|
|
2429
|
+
size?: "default" | "sm";
|
|
2430
|
+
}
|
|
2431
|
+
/**
|
|
2432
|
+
* Fill `{name}` placeholders from `values`. Unknown names stay as written.
|
|
2433
|
+
*
|
|
2434
|
+
* Without `fallback`, a known name whose value is null / undefined / empty
|
|
2435
|
+
* becomes "—". With `fallback`, any such missing value replaces the whole
|
|
2436
|
+
* sentence with `fallback` (which may be null to drop it).
|
|
2437
|
+
*/
|
|
2438
|
+
declare function fillKpiTemplate(template: string, values: Readonly<Record<string, string | null | undefined>>): string;
|
|
2439
|
+
declare function fillKpiTemplate(template: string, values: Readonly<Record<string, string | null | undefined>>, fallback: string | null): string | null;
|
|
2440
|
+
declare function KpiCard({ label, value, format, locale, comparison: comparisonProp, comparisons, provisional, polarity, change, neutralBand, showPrevious, summary, target, targetLabel, targetDisplay, period, history, historyGrain, showHistory, source, updatedAt, updatedAtDisplay, timeZone, now, isLoading, size, className, ...props }: KpiCardProps): React.JSX.Element;
|
|
2441
|
+
|
|
2442
|
+
declare const deltaVariants: (props?: ({
|
|
2443
|
+
variant?: "inline" | "badge" | null | undefined;
|
|
2444
|
+
sentiment?: "negative" | "neutral" | "positive" | null | undefined;
|
|
2445
|
+
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
2446
|
+
interface DeltaProps extends Omit<HTMLAttributes<HTMLSpanElement>, "children">, Pick<VariantProps<typeof deltaVariants>, "variant"> {
|
|
2447
|
+
/** The current value. The previous one comes from `comparison`. */
|
|
2448
|
+
value: number | null | undefined;
|
|
2449
|
+
/** What the value is compared against. Required so the delta always carries its label. */
|
|
2450
|
+
comparison: Comparison;
|
|
2451
|
+
/** Whether a rise is good. Default `"higher-is-better"`. */
|
|
2452
|
+
polarity?: Polarity;
|
|
2453
|
+
/** Absolute ratio below which the change reads as flat (0.01 = 1%). Default 0.01. */
|
|
2454
|
+
neutralBand?: number;
|
|
2455
|
+
/** Format of the metric itself; a `percent` metric shows its change in points. */
|
|
2456
|
+
format?: ValueFormat;
|
|
2457
|
+
/**
|
|
2458
|
+
* `"relative"` ("+12.4%"), `"points"` ("-0.5pt") or `"difference"` (the absolute difference in the
|
|
2459
|
+
* metric's own `format`, "+¥530万"). Default: points for a `percent` format, else relative.
|
|
2460
|
+
*/
|
|
2461
|
+
change?: ChangeDisplay;
|
|
2462
|
+
/**
|
|
2463
|
+
* 変化(`"relative"` の率・`"points"` の pt)の小数桁数。固定で、末尾の 0 も出す。例: `digits={2}` → "+0.14pt"。
|
|
2464
|
+
* 同じカード群で桁がばらつかないよう、全部に同じ値を渡す。未指定は 1 桁("+14.0%")。`"points"` は未指定のとき `format.digits` に従う。
|
|
2465
|
+
*/
|
|
2466
|
+
digits?: number;
|
|
2467
|
+
/** Locale for the change. Default `"ja-JP"`. */
|
|
2468
|
+
locale?: string;
|
|
2469
|
+
/** Show the comparison label ("前月比") after the change. Default true. */
|
|
2470
|
+
showLabel?: boolean;
|
|
2471
|
+
}
|
|
2472
|
+
/** Text shown when the values cannot be compared (no previous value, or a zero baseline): the same "—" as every missing value. */
|
|
2473
|
+
declare const DELTA_NOT_COMPARABLE = "\u2014";
|
|
2474
|
+
declare const Delta: React.ForwardRefExoticComponent<DeltaProps & React.RefAttributes<HTMLSpanElement>>;
|
|
2475
|
+
|
|
2476
|
+
/**
|
|
2477
|
+
* @deprecated 新規は Delta を使う。value/direction を別々に受けるため食い違える(C4)。
|
|
2478
|
+
*/
|
|
568
2479
|
interface TrendIndicatorProps {
|
|
569
2480
|
value: number;
|
|
570
2481
|
direction: TrendDirection;
|
|
571
2482
|
positiveIsGood?: boolean;
|
|
572
2483
|
className?: string;
|
|
573
2484
|
}
|
|
2485
|
+
/**
|
|
2486
|
+
* Arrow plus percentage change.
|
|
2487
|
+
*
|
|
2488
|
+
* @deprecated 新規は Delta を使う。value/direction を別々に受けるため食い違える(C4)。
|
|
2489
|
+
*/
|
|
574
2490
|
declare const TrendIndicator: React.ForwardRefExoticComponent<TrendIndicatorProps & React.RefAttributes<HTMLSpanElement>>;
|
|
575
2491
|
|
|
576
2492
|
interface StatusBadgeProps {
|
|
577
2493
|
status: string;
|
|
578
2494
|
label?: string;
|
|
2495
|
+
/** status → tone (`positive` | `negative` | `warning` | `info` | `neutral`) or legacy colour name. */
|
|
579
2496
|
colorMap?: Partial<Record<string, string>>;
|
|
580
2497
|
className?: string;
|
|
581
2498
|
}
|
|
582
2499
|
declare const StatusBadge: React.ForwardRefExoticComponent<StatusBadgeProps & React.RefAttributes<HTMLSpanElement>>;
|
|
583
2500
|
|
|
2501
|
+
declare function formatRelativeTime(date: Date | string | number, options?: {
|
|
2502
|
+
now?: Date | number;
|
|
2503
|
+
locale?: string;
|
|
2504
|
+
}): string;
|
|
2505
|
+
|
|
584
2506
|
interface PlaceholderProps extends HTMLAttributes<HTMLSpanElement> {
|
|
585
2507
|
}
|
|
586
2508
|
declare const Placeholder: React.ForwardRefExoticComponent<PlaceholderProps & React.RefAttributes<HTMLSpanElement>>;
|
|
587
2509
|
|
|
588
|
-
|
|
2510
|
+
declare const DEFAULT_SAMPLE_LABEL = "\u898B\u672C\u306E\u5024";
|
|
2511
|
+
interface SampleState {
|
|
2512
|
+
label: string;
|
|
2513
|
+
}
|
|
2514
|
+
/**
|
|
2515
|
+
* The mark a card inside `SampleData` should show, or null. A card that shows it wraps its
|
|
2516
|
+
* content in `<SampleClaim>` so the parts inside do not show it again.
|
|
2517
|
+
*/
|
|
2518
|
+
declare function useSampleMark(): SampleState | null;
|
|
2519
|
+
/** Ends the `SampleData` scope for the parts inside a card that already shows the mark. */
|
|
2520
|
+
declare function SampleClaim({ children }: {
|
|
2521
|
+
children?: ReactNode;
|
|
2522
|
+
}): React.JSX.Element;
|
|
2523
|
+
interface SampleBadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
2524
|
+
/** 印の文言。既定「見本の値」。 */
|
|
2525
|
+
label?: string;
|
|
2526
|
+
}
|
|
2527
|
+
declare function SampleBadge({ label, className, ...props }: SampleBadgeProps): React.JSX.Element;
|
|
2528
|
+
interface SampleDataProps {
|
|
2529
|
+
/** 印の文言。既定「見本の値」。 */
|
|
2530
|
+
label?: string;
|
|
2531
|
+
children?: ReactNode;
|
|
2532
|
+
}
|
|
2533
|
+
declare function SampleData({ label, children }: SampleDataProps): React.JSX.Element;
|
|
2534
|
+
|
|
2535
|
+
export { AppShell, type AppShellHeaderProps, type AppShellProps, type AppShellSidebarProps, AreaChart, type AreaChartProps, BarChart, type BarChartProps, BarList, type BarListItem, type BarListOptions, type BarListProps, type BarListSortOrder, COMPARISON_LABELS, CategoryBar, type CategoryBarMarker, type CategoryBarProps, type ChangeDisplay, type ChartActionsOptions, type ChartAnnotation, type ChartColor, type ChartColorToken, type ChartColors, type ChartCommonProps, type ChartComparison, type ChartEmptyState, type ChartEventPayload, type ChartForecast, type ChartForecastRow, ChartFrame, type ChartFrameProps, type ChartHighlight, type ChartRootAttributes, type ChartSeriesColor, type ChartSkeletonVariant, type ChartThreshold, type ChartTone, type Comparison, type ComparisonKind, type ComparisonOptions, type ComparisonResult, DEFAULT_LOCALE, DEFAULT_SAMPLE_LABEL, DELTA_NOT_COMPARABLE, DashboardCard, DashboardCardAction, type DashboardCardActionProps, DashboardCardContent, type DashboardCardContentProps, DashboardCardDescription, type DashboardCardDescriptionProps, DashboardCardFooter, type DashboardCardFooterProps, DashboardCardHeader, type DashboardCardHeaderProps, DashboardCardPreset, type DashboardCardPresetProps, type DashboardCardProps, DashboardCardSkeleton, type DashboardCardSkeletonProps, DashboardCardTitle, type DashboardCardTitleProps, DataTable, DataTableColumnVisibility, type DataTableColumnVisibilityProps, DataTableContent, type DataTableContentProps, DataTableExport, type DataTableExportProps, DataTablePagination, type DataTablePaginationProps, DataTablePreset, type DataTablePresetProps, type DataTableProps, DataTableToolbar, type DataTableToolbarProps, type DateRange, DateRangePicker, type DateRangePickerProps, type DateStyle, Delta, type DeltaDirection, type DeltaProps, type DeltaSentiment, DonutChart, type DonutChartOptions, type DonutChartProps, type DonutVariant, EChart, type EChartProps, EMPTY_VALUE, FilterBar, FilterBarActiveChips, type FilterBarActiveChipsProps, FilterBarClearButton, type FilterBarClearButtonProps, FilterBarMultiSelect, type FilterBarMultiSelectProps, FilterBarPreset, type FilterBarPresetProps, type FilterBarProps, FilterBarSelect, type FilterBarSelectProps, type FilterConfig, type FilterOption, type FilterType, type FilterValues, type FormatDateOptions, type FormatKind, type FormatValueOptions, type FunnelStep, FunnelSteps, type FunnelStepsProps, Heatmap, type HeatmapProps, type HistoryGrain, KpiCard, type KpiCardProps, type KpiCardSource, type KpiPeriod, Legend, type LegendProps, LineChart, type LineChartProps, MINUS_SIGN, type MetricItem, MetricUnit, type MetricUnitProps, MetricValue, type MetricValueProps, type MetricVariant, MultiSelect, type MultiSelectProps, type NavGroup, type NavItem, type NumericKeys, PageShell, PageShellActions, type PageShellActionsProps, PageShellContent, type PageShellContentProps, PageShellDescription, type PageShellDescriptionProps, PageShellHeader, PageShellHeaderEnd, type PageShellHeaderEndProps, type PageShellHeaderProps, PageShellHeading, type PageShellHeadingProps, PageShellMeta, type PageShellMetaProps, type PageShellProps, PageShellSummary, PageShellSummaryCard, type PageShellSummaryCardProps, type PageShellSummaryProps, PageShellTitle, type PageShellTitleProps, type PeriodGrain, Placeholder, type PlaceholderProps, type Polarity, type PresetItem, ProgressCircle, type ProgressCircleProps, RECORD_MIN_POINTS, type RecordInsight, SampleBadge, type SampleBadgeProps, SampleClaim, SampleData, type SampleDataProps, ScatterChart, type ScatterChartProps, type ScatterReferenceLine, SearchableSelect, type SearchableSelectProps, SectionHeader, type SectionHeaderProps, type SegmentOption, SegmentedControl, type SegmentedControlProps, type SelectOption, type SelectOptionGroup, type SelectOptions, Sparkline, type SparklineDataPoint, type SparklineProps, type SparklineVariant, StatusBadge, type StatusBadgeProps, type TargetProgress, Tracker, type TrackerBlock, type TrackerProps, type TrendDirection, TrendIndicator, type TrendIndicatorProps, UpdatedAt, type UpdatedAtProps, type ValueFormat, type ValueFormatter, WaterfallChart, type WaterfallChartProps, type WaterfallMode, comparisonBaseline, comparisonLabel, computeComparison, computeTargetProgress, defaultChangeDisplay, defaultPresets, deltaVariants, detectRecord, fillKpiTemplate, flattenOptions, formatChange, formatChangeAmount, formatDate, formatDateRange, formatDatesInText, formatDelta, formatKind, formatPoints, formatRelativeTime, formatValue, funnelStepsVariants, inferPeriodGrain, isGroupedOptions, metricValueVariants, pageShellSummaryCardVariants, tableToCsv, toCsv, toValueFormatter, toneForValue, useDataTable, useResolvedChartColors, useSampleMark };
|