@eifi1/ui-kit 0.52.0 → 0.53.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -54
- package/dist/billing/cancel-subscription.d.ts +5 -14
- package/dist/billing/cancel-subscription.js +1 -3
- package/dist/billing/cancel-subscription.js.map +1 -1
- package/dist/billing/plan-card.d.ts +5 -13
- package/dist/billing/plan-card.js +3 -11
- package/dist/billing/plan-card.js.map +1 -1
- package/dist/billing/plan-switch.d.ts +5 -14
- package/dist/billing/plan-switch.js +1 -3
- package/dist/billing/plan-switch.js.map +1 -1
- package/dist/chart.d.ts +3 -14
- package/dist/chart.js +64 -11
- package/dist/chart.js.map +1 -1
- package/dist/components/date-field.d.ts +1 -1
- package/dist/components/date-field.js.map +1 -1
- package/dist/components/date-picker.d.ts +1 -1
- package/dist/components/date-picker.js.map +1 -1
- package/dist/components/date-range-picker.d.ts +4 -17
- package/dist/components/date-range-picker.js +2 -2
- package/dist/components/date-range-picker.js.map +1 -1
- package/dist/components/nav-pills.d.ts +1 -1
- package/dist/components/nav-pills.js.map +1 -1
- package/dist/components/series-chart-axes.d.ts +1 -1
- package/dist/components/series-chart-axes.js.map +1 -1
- package/dist/components/series-chart.d.ts +64 -19
- package/dist/components/series-chart.js +2 -1
- package/dist/components/series-chart.js.map +1 -1
- package/dist/components/treemap-labels.d.ts +6 -1
- package/dist/components/treemap-labels.js +2 -2
- package/dist/components/treemap-labels.js.map +1 -1
- package/dist/components/treemap.d.ts +29 -4
- package/dist/components/treemap.js +22 -9
- package/dist/components/treemap.js.map +1 -1
- package/dist/data-table.d.ts +1 -6
- package/dist/data-table.js +1 -9
- package/dist/data-table.js.map +1 -1
- package/dist/demo/demo-countdown.d.ts +0 -5
- package/dist/demo/demo-countdown.js +0 -4
- package/dist/demo/demo-countdown.js.map +1 -1
- package/dist/eslint/index.js +1 -1
- package/dist/feedback/feedback-mutation.d.ts +11 -23
- package/dist/feedback/feedback-mutation.js +1 -9
- package/dist/feedback/feedback-mutation.js.map +1 -1
- package/dist/feedback/feedback-public-list.d.ts +1 -6
- package/dist/feedback/feedback-public-list.js +1 -2
- package/dist/feedback/feedback-public-list.js.map +1 -1
- package/dist/feedback/feedback-row-detail-labels.js +0 -8
- package/dist/feedback/feedback-row-detail-labels.js.map +1 -1
- package/dist/feedback/feedback-row-detail.d.ts +3 -50
- package/dist/feedback/feedback-row-detail.js +0 -8
- package/dist/feedback/feedback-row-detail.js.map +1 -1
- package/dist/feedback/feedback-status-undo.d.ts +3 -19
- package/dist/feedback/feedback-status-undo.js.map +1 -1
- package/dist/feedback/feedback-thread.d.ts +0 -9
- package/dist/feedback/feedback-thread.js.map +1 -1
- package/dist/feedback.d.ts +6 -40
- package/dist/feedback.js +88 -46
- package/dist/feedback.js.map +1 -1
- package/dist/i18n/defaults.js +0 -4
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.js +2 -19
- package/dist/i18n/german.js.map +1 -1
- package/dist/i18n/kit-labels.d.ts +5 -14
- package/dist/i18n/kit-labels.js.map +1 -1
- package/dist/i18n/locales/en.js +2 -30
- package/dist/i18n/locales/en.js.map +3 -3
- package/dist/i18n/locales/es.js +2 -19
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.js +2 -19
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.js +2 -19
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.js +2 -20
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.js +2 -19
- package/dist/i18n/locales/zh.js.map +1 -1
- package/dist/i18n/review.js +9 -4
- package/dist/i18n/review.js.map +1 -1
- package/dist/i18n/shared-labels.js +0 -1
- package/dist/i18n/shared-labels.js.map +1 -1
- package/dist/index.d.ts +15 -64
- package/dist/index.js +22 -102
- package/dist/index.js.map +1 -1
- package/dist/rhf/fields.d.ts +2 -2
- package/dist/rhf/fields.js.map +1 -1
- package/dist/search/search-index.d.ts +0 -6
- package/dist/search/search-index.js +0 -4
- package/dist/search/search-index.js.map +1 -1
- package/dist/search.d.ts +1 -8
- package/dist/search.js +2 -7
- package/dist/search.js.map +1 -1
- package/dist/shell/account-menu-language.d.ts +7 -21
- package/dist/shell/account-menu-language.js +1 -3
- package/dist/shell/account-menu-language.js.map +1 -1
- package/dist/shell/account-menu-text-size.d.ts +9 -23
- package/dist/shell/account-menu-text-size.js +2 -3
- package/dist/shell/account-menu-text-size.js.map +1 -1
- package/dist/shell/app-shell.d.ts +0 -10
- package/dist/shell/app-shell.js +1 -7
- package/dist/shell/app-shell.js.map +1 -1
- package/dist/shell/company-switcher.d.ts +1 -1
- package/dist/shell/company-switcher.js.map +1 -1
- package/dist/shell/dev-menu.d.ts +1 -1
- package/dist/shell/dev-menu.js.map +1 -1
- package/dist/shell/top-bar-parts-labels.d.ts +1 -1
- package/dist/shell/top-bar-parts-labels.js.map +1 -1
- package/dist/shell.d.ts +7 -29
- package/dist/shell.js +12 -42
- package/dist/shell.js.map +1 -1
- package/dist/sync.d.ts +2 -6
- package/dist/sync.js +2 -15
- package/dist/sync.js.map +1 -1
- package/dist/theme/chart-palette.d.ts +0 -5
- package/dist/theme/chart-palette.js +0 -2
- package/dist/theme/chart-palette.js.map +1 -1
- package/package.json +1 -1
- package/src/billing/cancel-subscription.tsx +5 -16
- package/src/billing/plan-card.tsx +7 -24
- package/src/billing/plan-switch.tsx +5 -16
- package/src/chart.ts +62 -13
- package/src/components/date-field.tsx +1 -1
- package/src/components/date-picker.tsx +0 -1
- package/src/components/date-range-picker.tsx +6 -22
- package/src/components/nav-pills.tsx +1 -1
- package/src/components/series-chart-axes.ts +6 -1
- package/src/components/series-chart.tsx +78 -21
- package/src/components/treemap-labels.ts +11 -3
- package/src/components/treemap.tsx +65 -12
- package/src/data-table.ts +1 -11
- package/src/demo/demo-countdown.ts +3 -8
- package/src/feedback/feedback-mutation.ts +12 -33
- package/src/feedback/feedback-public-list.tsx +1 -7
- package/src/feedback/feedback-row-detail-labels.ts +0 -8
- package/src/feedback/feedback-row-detail.tsx +8 -58
- package/src/feedback/feedback-status-undo.ts +4 -18
- package/src/feedback/feedback-thread.tsx +0 -10
- package/src/feedback.ts +89 -48
- package/src/i18n/defaults.ts +0 -4
- package/src/i18n/german.ts +2 -19
- package/src/i18n/kit-labels.tsx +5 -14
- package/src/i18n/locales/es.ts +2 -19
- package/src/i18n/locales/fr.ts +2 -19
- package/src/i18n/locales/hu.ts +2 -19
- package/src/i18n/locales/it.ts +2 -20
- package/src/i18n/locales/zh.ts +2 -19
- package/src/i18n/review.ts +9 -4
- package/src/i18n/shared-labels.ts +0 -1
- package/src/index.ts +30 -112
- package/src/rhf/fields.tsx +2 -2
- package/src/search/search-index.ts +0 -15
- package/src/search.ts +8 -8
- package/src/shell/account-menu-language.tsx +7 -27
- package/src/shell/account-menu-text-size.tsx +13 -32
- package/src/shell/app-shell.tsx +0 -13
- package/src/shell/company-switcher.tsx +1 -1
- package/src/shell/dev-menu.tsx +1 -1
- package/src/shell/top-bar-parts-labels.ts +1 -1
- package/src/shell.ts +17 -44
- package/src/sync.ts +2 -15
- package/src/theme/chart-palette.ts +0 -2
- package/tokens.css +4 -4
- package/dist/billing/dialog-close.d.ts +0 -29
- package/dist/billing/dialog-close.js +0 -8
- package/dist/billing/dialog-close.js.map +0 -1
- package/dist/components/field-sync-labels.d.ts +0 -3
- package/dist/components/field-sync-labels.js +0 -12
- package/dist/components/field-sync-labels.js.map +0 -1
- package/dist/components/field-sync.d.ts +0 -186
- package/dist/components/field-sync.js +0 -269
- package/dist/components/field-sync.js.map +0 -1
- package/dist/components/section-nav.d.ts +0 -44
- package/dist/components/section-nav.js +0 -33
- package/dist/components/section-nav.js.map +0 -1
- package/dist/components/sign-chip-labels.d.ts +0 -3
- package/dist/components/sign-chip-labels.js +0 -11
- package/dist/components/sign-chip-labels.js.map +0 -1
- package/dist/components/sign-chip.d.ts +0 -77
- package/dist/components/sign-chip.js +0 -47
- package/dist/components/sign-chip.js.map +0 -1
- package/dist/lib/isin.d.ts +0 -38
- package/dist/lib/isin.js +0 -36
- package/dist/lib/isin.js.map +0 -1
- package/dist/shell/role-switcher.d.ts +0 -28
- package/dist/shell/role-switcher.js +0 -31
- package/dist/shell/role-switcher.js.map +0 -1
- package/src/billing/dialog-close.ts +0 -34
- package/src/components/field-sync-labels.ts +0 -14
- package/src/components/field-sync.tsx +0 -504
- package/src/components/section-nav.tsx +0 -72
- package/src/components/sign-chip-labels.ts +0 -13
- package/src/components/sign-chip.tsx +0 -133
- package/src/lib/isin.ts +0 -72
- package/src/shell/role-switcher.tsx +0 -53
|
@@ -14,8 +14,6 @@ import { Button } from "../components/button";
|
|
|
14
14
|
import { DialogFrame } from "../components/dialog-frame";
|
|
15
15
|
import { useBillingLabels } from "./billing-labels";
|
|
16
16
|
import type { BillingLabels } from "./billing-labels";
|
|
17
|
-
import { dialogClose } from "./dialog-close";
|
|
18
|
-
import type { WithDialogClose } from "./dialog-close";
|
|
19
17
|
import { BILLING_INTERVALS, billingCurrencyFor, formatPlanPrice, planPrice } from "./plan-price";
|
|
20
18
|
import type { BillingCurrency, BillingInterval, PlanPrices } from "./plan-price";
|
|
21
19
|
|
|
@@ -502,16 +500,13 @@ export function PlanPicker({
|
|
|
502
500
|
);
|
|
503
501
|
}
|
|
504
502
|
|
|
505
|
-
|
|
506
|
-
interface GrantWarningConfirmFields {
|
|
503
|
+
export interface GrantWarningConfirmProps {
|
|
507
504
|
/** Shown, controlled. */
|
|
508
505
|
open: boolean;
|
|
509
506
|
/** "Back", Escape, the backdrop — and after "Buy anyway". 0.52: every other kit
|
|
510
|
-
* dialog's `onClose` (CONTRIBUTING §4; refactor audit 2026-10-30, API-5)
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
* `false` when there is no `onClose`. */
|
|
514
|
-
onOpenChange?: (open: boolean) => void;
|
|
507
|
+
* dialog's `onClose` (CONTRIBUTING §4; refactor audit 2026-10-30, API-5); required
|
|
508
|
+
* since 0.53 removed `onOpenChange` (deprecated in 0.52). */
|
|
509
|
+
onClose: () => void;
|
|
515
510
|
/** "Buy anyway": the app opens its checkout. The dialog closes itself after it. */
|
|
516
511
|
onConfirm: () => void;
|
|
517
512
|
/** Prop > `<UiKitProvider labels={{ billing }}>` > English: `grantWarningTitle`,
|
|
@@ -519,11 +514,6 @@ interface GrantWarningConfirmFields {
|
|
|
519
514
|
labels?: LabelOverride<BillingLabels>;
|
|
520
515
|
}
|
|
521
516
|
|
|
522
|
-
/** What {@link GrantWarningConfirm} takes: `onClose`, or alone the deprecated
|
|
523
|
-
* `onOpenChange`, is required (0.52 code review: with neither it compiled, and nothing
|
|
524
|
-
* could dismiss it). */
|
|
525
|
-
export type GrantWarningConfirmProps = WithDialogClose<GrantWarningConfirmFields>;
|
|
526
|
-
|
|
527
517
|
/**
|
|
528
518
|
* 0.42 (§16.8 B): the permanent-grant warning before a checkout — `grantWarningTitle`,
|
|
529
519
|
* `grantWarningBody`, "Back" and "Buy anyway" (`grantWarningAction`). {@link PlanPicker}
|
|
@@ -533,22 +523,15 @@ export type GrantWarningConfirmProps = WithDialogClose<GrantWarningConfirmFields
|
|
|
533
523
|
* to a checkout — show this before that checkout, so a permanent-grant holder is still
|
|
534
524
|
* warned. Carries `data-grant-warning`.
|
|
535
525
|
*/
|
|
536
|
-
export function GrantWarningConfirm({
|
|
537
|
-
open,
|
|
538
|
-
onClose,
|
|
539
|
-
onOpenChange,
|
|
540
|
-
onConfirm,
|
|
541
|
-
labels: labelsProp,
|
|
542
|
-
}: GrantWarningConfirmProps) {
|
|
526
|
+
export function GrantWarningConfirm({ open, onClose, onConfirm, labels: labelsProp }: GrantWarningConfirmProps) {
|
|
543
527
|
const labels = useBillingLabels(labelsProp);
|
|
544
528
|
const common = useKitLabels("common", DEFAULT_COMMON_LABELS);
|
|
545
|
-
const close = dialogClose({ onClose, onOpenChange });
|
|
546
529
|
return (
|
|
547
530
|
<DialogFrame
|
|
548
531
|
open={open}
|
|
549
532
|
title={labels.grantWarningTitle}
|
|
550
533
|
description={labels.grantWarningBody}
|
|
551
|
-
onClose={
|
|
534
|
+
onClose={onClose}
|
|
552
535
|
data-grant-warning=""
|
|
553
536
|
actions={(lower) => (
|
|
554
537
|
<>
|
|
@@ -567,7 +550,7 @@ export function GrantWarningConfirm({
|
|
|
567
550
|
// and the lowering panel is not inert: a double click on "Buy anyway" opened
|
|
568
551
|
// the checkout twice (0.52 code review, plan-card.tsx). The caller's `open`
|
|
569
552
|
// turning false still plays the exit.
|
|
570
|
-
|
|
553
|
+
onClose();
|
|
571
554
|
}}
|
|
572
555
|
>
|
|
573
556
|
{labels.grantWarningAction}
|
|
@@ -13,8 +13,6 @@ import { COMMIT_EXCEPT_BILLING } from "../components/write-lock";
|
|
|
13
13
|
import { DEFAULT_PLAN_CHANGE_LABELS } from "./plan-change-labels";
|
|
14
14
|
import { useBillingLabels } from "./billing-labels";
|
|
15
15
|
import type { BillingLabels } from "./billing-labels";
|
|
16
|
-
import { dialogClose } from "./dialog-close";
|
|
17
|
-
import type { WithDialogClose } from "./dialog-close";
|
|
18
16
|
import type { PlanSwitchPreview } from "./billing-overview";
|
|
19
17
|
import { minorToMajor } from "./plan-price";
|
|
20
18
|
import type { BillingInterval } from "./plan-price";
|
|
@@ -39,16 +37,13 @@ export interface PlanSwitchSide {
|
|
|
39
37
|
interval: BillingInterval;
|
|
40
38
|
}
|
|
41
39
|
|
|
42
|
-
|
|
43
|
-
interface PlanSwitchConfirmFields {
|
|
40
|
+
export interface PlanSwitchConfirmProps {
|
|
44
41
|
open: boolean;
|
|
45
42
|
/** The payer dismissed it — Cancel, Escape, the backdrop. Confirm leaves it open: close
|
|
46
43
|
* it once the switch answers. 0.52: every other kit dialog's `onClose` (CONTRIBUTING
|
|
47
|
-
* §4; refactor audit 2026-10-30, API-5).
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
* `false` when there is no `onClose`. */
|
|
51
|
-
onOpenChange?: (open: boolean) => void;
|
|
44
|
+
* §4; refactor audit 2026-10-30, API-5); required since 0.53 removed `onOpenChange`
|
|
45
|
+
* (deprecated in 0.52). */
|
|
46
|
+
onClose: () => void;
|
|
52
47
|
/** What the payer pays now: the overview's `paid`. */
|
|
53
48
|
from: PlanSwitchSide;
|
|
54
49
|
/** The pick. */
|
|
@@ -88,11 +83,6 @@ interface PlanSwitchConfirmFields {
|
|
|
88
83
|
labels?: LabelOverride<BillingLabels>;
|
|
89
84
|
}
|
|
90
85
|
|
|
91
|
-
/** What {@link PlanSwitchConfirm} takes: `onClose`, or alone the deprecated
|
|
92
|
-
* `onOpenChange`, is required (0.52 code review: with neither it compiled, and nothing
|
|
93
|
-
* could dismiss it). */
|
|
94
|
-
export type PlanSwitchConfirmProps = WithDialogClose<PlanSwitchConfirmFields>;
|
|
95
|
-
|
|
96
86
|
/**
|
|
97
87
|
* The confirm for a plan switch (§15.2.10): from → to, each with its billing period;
|
|
98
88
|
* Paddle's preview — "Charged now" (an upgrade) or "Credited towards your next charges"
|
|
@@ -118,7 +108,6 @@ export type PlanSwitchConfirmProps = WithDialogClose<PlanSwitchConfirmFields>;
|
|
|
118
108
|
export function PlanSwitchConfirm({
|
|
119
109
|
open,
|
|
120
110
|
onClose,
|
|
121
|
-
onOpenChange,
|
|
122
111
|
from,
|
|
123
112
|
to,
|
|
124
113
|
preview,
|
|
@@ -165,7 +154,7 @@ export function PlanSwitchConfirm({
|
|
|
165
154
|
open={open}
|
|
166
155
|
title={labels.switchTitle}
|
|
167
156
|
description={labels.switchFromTo(side(from), side(to))}
|
|
168
|
-
onClose={
|
|
157
|
+
onClose={onClose}
|
|
169
158
|
busy={pending}
|
|
170
159
|
// A preview that loads is busy too, but holds nothing: Cancel stays a way out.
|
|
171
160
|
aria-busy={preview === undefined || undefined}
|
package/src/chart.ts
CHANGED
|
@@ -10,14 +10,24 @@
|
|
|
10
10
|
// because the main barrel re-exports everything here too, so `import { Button } from
|
|
11
11
|
// "@eifi1/ui-kit"` reaches recharts as well (packaging-contract.test.ts asserts it).
|
|
12
12
|
export * from "./components/chart";
|
|
13
|
-
|
|
14
|
-
//
|
|
15
|
-
//
|
|
13
|
+
// Named, not `*`, for chart-palette, series-chart and toggle-legend: 0.53 took the slice's
|
|
14
|
+
// share of the 55 names no app reads off the surface (deprecated in 0.52, refactor audit
|
|
15
|
+
// 2026-10-30, API-4) — `EDGE_MIN_CONTRAST`, `resolveTooltipPlacement`, `STROKE_PATTERNS`,
|
|
16
|
+
// which their modules keep for the kit's own use.
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
PALETTE_SIZE,
|
|
19
|
+
CVD_ORDER,
|
|
20
|
+
paletteFor,
|
|
21
|
+
CHART_COLORS,
|
|
22
|
+
CHART_ROLES,
|
|
23
|
+
CHART_MUTED_HEX,
|
|
24
|
+
chartEdge,
|
|
25
|
+
PALETTE_HEX,
|
|
26
|
+
HEATMAP_HEX,
|
|
27
|
+
lerpHex,
|
|
28
|
+
textOn,
|
|
29
|
+
type PaletteForOptions,
|
|
30
|
+
type HeatStops,
|
|
21
31
|
} from "./theme/chart-palette";
|
|
22
32
|
|
|
23
33
|
// The tile chart (treemap) the apps share — moved here from keksdose so every consumer
|
|
@@ -27,10 +37,42 @@ export * from "./components/treemap-labels";
|
|
|
27
37
|
|
|
28
38
|
// lenkbank's zoomable series chart, its synced x-zoom, the toggle legend and the
|
|
29
39
|
// mirrored-pair axis geometry — moved here so the apps derive them from the package.
|
|
30
|
-
export * from "./components/series-chart";
|
|
31
40
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
41
|
+
AXIS_TICK_WIDTH,
|
|
42
|
+
AXIS_TITLE_STRIP,
|
|
43
|
+
anchoredBand,
|
|
44
|
+
axisBandWidth,
|
|
45
|
+
mergeSeries,
|
|
46
|
+
oneAxis,
|
|
47
|
+
padBand,
|
|
48
|
+
paddedDomain,
|
|
49
|
+
seriesKey,
|
|
50
|
+
soleSeriesColor,
|
|
51
|
+
visibleSeries,
|
|
52
|
+
seriesLegendEntries,
|
|
53
|
+
StaticSeriesChart,
|
|
54
|
+
SeriesChart,
|
|
55
|
+
type TimeTickUnit,
|
|
56
|
+
type SeriesChartAxisBudget,
|
|
57
|
+
type SeriesSource,
|
|
58
|
+
type SeriesChartSeries,
|
|
59
|
+
type SeriesChartType,
|
|
60
|
+
type SeriesChartPoint,
|
|
61
|
+
type SeriesChartRow,
|
|
62
|
+
type SeriesChartXValue,
|
|
63
|
+
type SeriesChartTickValues,
|
|
64
|
+
type SeriesChartAxis,
|
|
65
|
+
type SeriesChartXTick,
|
|
66
|
+
type SeriesChartX,
|
|
67
|
+
type SeriesChartTooltipPlacement,
|
|
68
|
+
type SeriesChartTooltip,
|
|
69
|
+
type SeriesChartSpan,
|
|
70
|
+
type SeriesChartTone,
|
|
71
|
+
type SeriesChartReference,
|
|
72
|
+
type SeriesChartMarker,
|
|
73
|
+
type SeriesChartHit,
|
|
74
|
+
type SeriesChartProps,
|
|
75
|
+
type SeriesLegendAxes,
|
|
34
76
|
} from "./components/series-chart";
|
|
35
77
|
// 0.32.1 (keksdose's 0.32 report): the height every chart takes, for an app's wrappers.
|
|
36
78
|
export type { ChartHeight } from "./components/chart-height";
|
|
@@ -41,10 +83,17 @@ export * from "./components/chart-zoom";
|
|
|
41
83
|
// packaging contract reads this entry's own imports to know which modules may import
|
|
42
84
|
// recharts, so chart-zoom-core has to be one of them (MOD-6).
|
|
43
85
|
export { SharedXZoom } from "./components/chart-zoom-core";
|
|
44
|
-
export * from "./components/toggle-legend";
|
|
45
86
|
export {
|
|
46
|
-
|
|
47
|
-
|
|
87
|
+
strokeDash,
|
|
88
|
+
STEP_DASH,
|
|
89
|
+
toggleHidden,
|
|
90
|
+
ToggleLegend,
|
|
91
|
+
StaticLegend,
|
|
92
|
+
LegendColumn,
|
|
93
|
+
LegendGroup,
|
|
94
|
+
type LegendEntry,
|
|
95
|
+
type ToggleLegendProps,
|
|
96
|
+
type StaticLegendProps,
|
|
48
97
|
} from "./components/toggle-legend";
|
|
49
98
|
export * from "./components/facing-pair";
|
|
50
99
|
export * from "./components/series-chart-labels";
|
|
@@ -137,7 +137,7 @@ export interface DatePickerBaseProps extends Omit<ComponentPropsWithoutRef<"div"
|
|
|
137
137
|
*
|
|
138
138
|
* Off by default: the caption becomes one more stop in the panel's tab order, which a
|
|
139
139
|
* 0.x minor does not spring on a form. Works in the popover and in
|
|
140
|
-
* `DateRangePicker`'s phone sheet alike, beside presets and
|
|
140
|
+
* `DateRangePicker`'s phone sheet alike, beside presets and with `apply`
|
|
141
141
|
* (a preset picked while the months are open goes back to the days, on its start).
|
|
142
142
|
*
|
|
143
143
|
* Why not a two-month panel (`months={2}`) instead, or beside it: for a twelve-month
|
|
@@ -16,7 +16,6 @@ import { PanelCalendar } from "./jump-calendar";
|
|
|
16
16
|
export type { DateTriggerAttributes } from "./date-field";
|
|
17
17
|
export { DateRangePicker } from "./date-range-picker";
|
|
18
18
|
export type {
|
|
19
|
-
DateRangeCommit,
|
|
20
19
|
DateRangeDraftSummary,
|
|
21
20
|
DateRangePickerPreset,
|
|
22
21
|
DateRangePickerProps,
|
|
@@ -40,17 +40,6 @@ export interface DateRangePickerPreset {
|
|
|
40
40
|
to: string;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
/**
|
|
44
|
-
* The 0.x values of DateRangePicker's `commit`, when it was the panel's mode:
|
|
45
|
-
* `"immediate"` is `apply` left out, `"apply"` is `apply`. See
|
|
46
|
-
* {@link DateRangePickerProps.apply}.
|
|
47
|
-
*
|
|
48
|
-
* @deprecated 0.52 — DateRangePicker's `apply` (`commit="apply"` → `apply`, `"immediate"`
|
|
49
|
-
* → nothing); removed in 0.53. `commit` is the write lock's opt-in on every other kit
|
|
50
|
-
* control, and since 0.52 on this one too (refactor audit 2026-10-30, API-3).
|
|
51
|
-
*/
|
|
52
|
-
export type DateRangeCommit = "immediate" | "apply";
|
|
53
|
-
|
|
54
43
|
export interface DateRangePickerProps extends DatePickerBaseProps {
|
|
55
44
|
from: string;
|
|
56
45
|
to: string;
|
|
@@ -89,8 +78,7 @@ export interface DateRangePickerProps extends DatePickerBaseProps {
|
|
|
89
78
|
* must never escape the panel.
|
|
90
79
|
*
|
|
91
80
|
* `commit="apply"` until 0.52 (refactor audit 2026-10-30, API-3): `commit` is the write
|
|
92
|
-
* lock's prop on every other kit control. The old spelling
|
|
93
|
-
* goes in 0.53 ({@link DateRangeCommit}); `apply` wins where both are given.
|
|
81
|
+
* lock's prop on every other kit control. The old spelling went in 0.53.
|
|
94
82
|
*/
|
|
95
83
|
apply?: boolean;
|
|
96
84
|
/**
|
|
@@ -100,12 +88,10 @@ export interface DateRangePickerProps extends DatePickerBaseProps {
|
|
|
100
88
|
* kit control since 0.33, and on this one since 0.52 (API-3). A range inside a form with
|
|
101
89
|
* its own Save stays editable under the lock — leave this off there.
|
|
102
90
|
*
|
|
103
|
-
* The strings `"immediate"` and `"apply"
|
|
104
|
-
*
|
|
105
|
-
* {@link DateRangeCommit}. They cannot be taken for a scope, which is a boolean or an
|
|
106
|
-
* object.
|
|
91
|
+
* The strings `"immediate"` and `"apply"`, the panel's mode in 0.x, went in 0.53
|
|
92
|
+
* (deprecated in 0.52): `apply` is the mode.
|
|
107
93
|
*/
|
|
108
|
-
commit?: CommitScope
|
|
94
|
+
commit?: CommitScope;
|
|
109
95
|
/**
|
|
110
96
|
* Draw the trigger yourself. keksdose's report range field
|
|
111
97
|
* (reports/report-range-field.tsx, "Why this is app-level") is why: its trigger
|
|
@@ -428,10 +414,8 @@ export function DateRangePicker(props: DateRangePickerProps) {
|
|
|
428
414
|
const locale = useKitLocale(localeProp);
|
|
429
415
|
const text = useDatePickerLabels(clearLabel, undefined, undefined);
|
|
430
416
|
const render = useTriggerFormat("dateRangePicker", locale, formatOptions, formatValue);
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
const drafting = apply ?? commit === "apply";
|
|
434
|
-
const lock = useLockReason(typeof commit === "string" ? undefined : commit, disabledReason);
|
|
417
|
+
const drafting = apply ?? false;
|
|
418
|
+
const lock = useLockReason(commit, disabledReason);
|
|
435
419
|
const locked = lock.locked;
|
|
436
420
|
const messages = useFieldMessages({
|
|
437
421
|
hint,
|
|
@@ -59,7 +59,7 @@ export interface NavPillsProps<T extends string> extends Omit<
|
|
|
59
59
|
* 0.49: `wrap` (default) puts the pills on as many rows as they need. `scroll` keeps
|
|
60
60
|
* them on ONE row that scrolls sideways — faded at a cut edge, the current pill
|
|
61
61
|
* scrolled into view (the row only, never the page) — for a strip that must stay one
|
|
62
|
-
* line high, as
|
|
62
|
+
* line high, as a section's pages under a page title on a phone.
|
|
63
63
|
*/
|
|
64
64
|
layout?: "wrap" | "scroll";
|
|
65
65
|
/** The `<nav>` (or the `<div role="group">`) — hence `HTMLElement` (0.34, API-2,
|
|
@@ -212,7 +212,12 @@ export function anchoredBand(extent: readonly [number, number] | undefined): [nu
|
|
|
212
212
|
* it in its neighbour's colour on each click. Resolving the colours on the full list
|
|
213
213
|
* and filtering after keeps each series in the colour its legend entry shows.
|
|
214
214
|
*/
|
|
215
|
-
|
|
215
|
+
// Generic so a typed list comes back typed (0.53): a chart of `Month` rows takes it, and
|
|
216
|
+
// its `dot`s still read `point.row` as a `Month`.
|
|
217
|
+
export function visibleSeries<TRow extends object>(
|
|
218
|
+
series: readonly SeriesChartSeries<TRow>[],
|
|
219
|
+
hidden: ReadonlySet<string>,
|
|
220
|
+
): SeriesChartSeries<TRow>[] {
|
|
216
221
|
return series
|
|
217
222
|
.map((entry, index) => ({ ...entry, color: entry.color ?? paletteFor(index) }))
|
|
218
223
|
.filter((entry) => !hidden.has(entry.key));
|
|
@@ -129,7 +129,14 @@ import { useChartEdge, useEdgesInForce } from "./chart-edge";
|
|
|
129
129
|
import { cn } from "../lib/cn";
|
|
130
130
|
import { formatWithMinus } from "../lib/minus";
|
|
131
131
|
|
|
132
|
-
|
|
132
|
+
/**
|
|
133
|
+
* One line, area or bar run of a {@link SeriesChart}.
|
|
134
|
+
*
|
|
135
|
+
* `TRow` is the chart's row type (0.53, keksdose after 0.52), and only `dot` reads it: its
|
|
136
|
+
* `point.row` is that type. Without a type argument a series is what it was, and a chart
|
|
137
|
+
* of typed rows still takes it — see {@link SeriesChartProps}.
|
|
138
|
+
*/
|
|
139
|
+
export interface SeriesChartSeries<TRow extends object = object> {
|
|
133
140
|
/** The row key this line reads — and the `--color-<key>` it is painted with, so it
|
|
134
141
|
* must be a CSS identifier. Build keys out of data with {@link seriesKey}. */
|
|
135
142
|
key: string;
|
|
@@ -177,8 +184,9 @@ export interface SeriesChartSeries {
|
|
|
177
184
|
* point: `true` for the default dot, `false`/`null` for none, or any SVG node drawn
|
|
178
185
|
* as-is at `point.cx`/`point.cy` — a buy/sell marker on keksdose's paper price.
|
|
179
186
|
* Never called for a point with no value. Bars have no points, and ignore it.
|
|
187
|
+
* `point.row` is the caller's own row, typed as the chart's rows are (0.53).
|
|
180
188
|
*/
|
|
181
|
-
dot?: boolean | ((point: SeriesChartPoint) => ReactNode);
|
|
189
|
+
dot?: boolean | ((point: SeriesChartPoint<TRow>) => ReactNode);
|
|
182
190
|
/** Line (or area outline) weight in px. Default 2, or 1.5 for a `step`. keksdose
|
|
183
191
|
* draws the subject of a chart at 2.5 and the reference it is read against at 1.5. */
|
|
184
192
|
strokeWidth?: number;
|
|
@@ -213,14 +221,16 @@ export interface SeriesChartSeries {
|
|
|
213
221
|
/** What a series draws. See {@link SeriesChartSeries.type}. */
|
|
214
222
|
export type SeriesChartType = "line" | "bar" | "area";
|
|
215
223
|
|
|
216
|
-
/** One point of a series, as a `dot` function is handed it.
|
|
217
|
-
|
|
224
|
+
/** One point of a series, as a `dot` function is handed it. `TRow` is the chart's row
|
|
225
|
+
* type (0.53); without one, `row` is a {@link SeriesChartRow}, as before. */
|
|
226
|
+
export interface SeriesChartPoint<TRow extends object = object> {
|
|
218
227
|
/** The series' key. */
|
|
219
228
|
key: string;
|
|
220
229
|
/** The row's position in `rows`. */
|
|
221
230
|
index: number;
|
|
222
|
-
/** The caller's own row, with everything the chart did not plot still in it
|
|
223
|
-
|
|
231
|
+
/** The caller's own row, with everything the chart did not plot still in it: the very
|
|
232
|
+
* object in `rows`, typed as `rows` is. */
|
|
233
|
+
row: SeriesChartRowOf<TRow>;
|
|
224
234
|
/** The abscissa in the caller's terms: the number, the category, or (time) a Date. */
|
|
225
235
|
x: SeriesChartXValue;
|
|
226
236
|
value: number;
|
|
@@ -233,9 +243,32 @@ export interface SeriesChartPoint {
|
|
|
233
243
|
|
|
234
244
|
/** A row of a series chart: one abscissa value and the series' values at it. Anything
|
|
235
245
|
* else in it (a raw ISO period for a drilldown) rides along untouched and is handed
|
|
236
|
-
* back in {@link SeriesChartPoint.row} and {@link SeriesChartHit.row}
|
|
246
|
+
* back in {@link SeriesChartPoint.row} and {@link SeriesChartHit.row} — typed as the
|
|
247
|
+
* caller's rows are since 0.53, and as this where their type names no keys. */
|
|
237
248
|
export type SeriesChartRow = Readonly<Record<string, unknown>>;
|
|
238
249
|
|
|
250
|
+
/**
|
|
251
|
+
* The row a hit or a point hands back, for a chart whose rows are `TRow[]` (0.53, keksdose
|
|
252
|
+
* after 0.52): `TRow` itself, so a drilldown reads `hit.row.rawPeriod` as the string it
|
|
253
|
+
* is. A {@link SeriesChartRow} where `TRow` names no keys — `object`, the default, which
|
|
254
|
+
* keeps `SeriesChartHit` and `SeriesChartPoint` without a type argument what they were, and
|
|
255
|
+
* the `object[]` rows an app passes today; `{}`; and `any` or `never` (`rows={[]}`), which
|
|
256
|
+
* are both assignable to `null` while no object type is.
|
|
257
|
+
*
|
|
258
|
+
* Both tests take `TRow` in the CHECKED position, never in the `extends` one, so TypeScript
|
|
259
|
+
* measures every type below as covariant in it (`SeriesChartSeries`, through `dot`'s
|
|
260
|
+
* parameter, contravariant) and relates two of them by their type arguments alone: a
|
|
261
|
+
* `SeriesChartHit<Month>` is a `SeriesChartHit`, and a handler or a series typed without an
|
|
262
|
+
* argument fits a chart of `Month` rows, though an interface has no index signature and is
|
|
263
|
+
* not, field by field, a `SeriesChartRow`. Written `object extends TRow ?`, the type is
|
|
264
|
+
* invariant and both of those stop type-checking.
|
|
265
|
+
*/
|
|
266
|
+
type SeriesChartRowOf<TRow> = [TRow] extends [null]
|
|
267
|
+
? SeriesChartRow
|
|
268
|
+
: [keyof TRow] extends [never]
|
|
269
|
+
? SeriesChartRow
|
|
270
|
+
: TRow;
|
|
271
|
+
|
|
239
272
|
/** An abscissa value: a number (`x.type: "number"`), a category (a string, a number or
|
|
240
273
|
* a Date standing for a period), or a time (a Date, epoch ms or an ISO string). */
|
|
241
274
|
export type SeriesChartXValue = number | string | Date;
|
|
@@ -551,29 +584,42 @@ export interface SeriesChartMarker {
|
|
|
551
584
|
r?: number;
|
|
552
585
|
}
|
|
553
586
|
|
|
554
|
-
/** What a click on the plot picked.
|
|
555
|
-
|
|
587
|
+
/** What a click on the plot picked. `TRow` is the chart's row type (0.53); without one,
|
|
588
|
+
* `row` is a {@link SeriesChartRow}, as before. */
|
|
589
|
+
export interface SeriesChartHit<TRow extends object = object> {
|
|
556
590
|
/** The row's position in `rows`. */
|
|
557
591
|
index: number;
|
|
558
|
-
/** The caller's own row — with its `rawPeriod`, id or whatever the drilldown needs
|
|
559
|
-
|
|
592
|
+
/** The caller's own row — with its `rawPeriod`, id or whatever the drilldown needs: the
|
|
593
|
+
* very object in `rows`, typed as `rows` is, so it is read without a cast. */
|
|
594
|
+
row: SeriesChartRowOf<TRow>;
|
|
560
595
|
x: SeriesChartXValue;
|
|
561
596
|
/** The series, when the click landed ON a bar. A click anywhere else picks the slot
|
|
562
597
|
* (the period), not a series. */
|
|
563
598
|
key?: string;
|
|
564
599
|
}
|
|
565
600
|
|
|
566
|
-
|
|
601
|
+
/**
|
|
602
|
+
* The props of {@link SeriesChart} and {@link StaticSeriesChart}, for rows of type `TRow`.
|
|
603
|
+
*
|
|
604
|
+
* `TRow` is inferred from `rows` (0.53, keksdose after 0.52), and what the chart hands back
|
|
605
|
+
* — `hit.row` in `onPointClick`, `point.row` in a series' `dot` — is that type, so a
|
|
606
|
+
* drilldown reads its own fields without narrowing an `unknown`. Without a type argument,
|
|
607
|
+
* `SeriesChartProps` is what it was: any object is a row, and a row comes back as a
|
|
608
|
+
* {@link SeriesChartRow}. So is `ComponentProps<typeof SeriesChart>`, which reads the
|
|
609
|
+
* constraint, `object`. A series, a handler or a `dot` typed without an argument fits a
|
|
610
|
+
* chart of typed rows too.
|
|
611
|
+
*/
|
|
612
|
+
export interface SeriesChartProps<TRow extends object = object> {
|
|
567
613
|
/**
|
|
568
614
|
* One row per abscissa value. A missing key is a hole (see `connectNulls`).
|
|
569
615
|
*
|
|
570
616
|
* Any object (0.52, refactor audit 2026-10-30, API-2): an `interface` has no index
|
|
571
617
|
* signature, so a typed sweep did not fit `SeriesChartRow` and Kurvenschmiede cast its
|
|
572
618
|
* Ackermann rows `as unknown as Record<string, number>[]`. The chart reads the keys
|
|
573
|
-
* `series` and `x` name, and hands the row back as
|
|
619
|
+
* `series` and `x` name, and hands the row back typed as these are (0.53).
|
|
574
620
|
*/
|
|
575
|
-
rows: readonly
|
|
576
|
-
series: readonly SeriesChartSeries[];
|
|
621
|
+
rows: readonly TRow[];
|
|
622
|
+
series: readonly SeriesChartSeries<TRow>[];
|
|
577
623
|
/** Default: one untitled axis, `"y"`. */
|
|
578
624
|
axes?: readonly SeriesChartAxis[];
|
|
579
625
|
x?: SeriesChartX;
|
|
@@ -628,7 +674,7 @@ export interface SeriesChartProps {
|
|
|
628
674
|
* a chart without bars, named "period — series: value", behind ONE tab stop. With this
|
|
629
675
|
* they are buttons that Enter and Space activate; without, images to read.
|
|
630
676
|
*/
|
|
631
|
-
onPointClick?: (hit: SeriesChartHit) => void;
|
|
677
|
+
onPointClick?: (hit: SeriesChartHit<TRow>) => void;
|
|
632
678
|
/** Where the tooltip may go: for a chart inside a scroll wrapper. See
|
|
633
679
|
* {@link SeriesChartTooltip}. */
|
|
634
680
|
tooltip?: SeriesChartTooltip;
|
|
@@ -760,8 +806,10 @@ export interface SeriesLegendAxes {
|
|
|
760
806
|
* series whose axis is not drawn says the unit that axis would have: "Velocity (mm/s)"
|
|
761
807
|
* — see {@link SeriesChartAxis.unit}. Without them, the labels are as given.
|
|
762
808
|
*/
|
|
763
|
-
export function seriesLegendEntries(
|
|
764
|
-
|
|
809
|
+
export function seriesLegendEntries<TRow extends object>(
|
|
810
|
+
// Generic only so a typed list fits (0.53): `SeriesChartSeries<Month>` is not a
|
|
811
|
+
// `SeriesChartSeries`, whose `dot` would be handed rows that are not `Month`s.
|
|
812
|
+
series: readonly SeriesChartSeries<TRow>[],
|
|
765
813
|
{ axes, budgeted }: SeriesLegendAxes = {},
|
|
766
814
|
): LegendEntry[] {
|
|
767
815
|
const undrawn = new Map<string, string | undefined>();
|
|
@@ -1819,7 +1867,12 @@ const ZoomablePlot = withChartZoom(SeriesPlot);
|
|
|
1819
1867
|
* category or time chart otherwise re-maps every row on every render, and `maxRows`'
|
|
1820
1868
|
* envelope would be worked out again with it.
|
|
1821
1869
|
*/
|
|
1822
|
-
function usePlotProps(
|
|
1870
|
+
function usePlotProps<TRow extends object>(typed: SeriesChartProps<TRow>): PlotProps {
|
|
1871
|
+
// `TRow` types only what the caller is handed back, and that is its own row objects,
|
|
1872
|
+
// untouched (0.53): the plot reads them as the `object` rows they are. Through `unknown`
|
|
1873
|
+
// because the two are not comparable for an unresolved `TRow`: `SeriesChartSeries` is
|
|
1874
|
+
// contravariant in it (its `dot` is handed rows) and `rows` covariant.
|
|
1875
|
+
const props = typed as unknown as SeriesChartProps;
|
|
1823
1876
|
const x = props.x ?? {};
|
|
1824
1877
|
const { rows } = props;
|
|
1825
1878
|
const { type, key } = x;
|
|
@@ -1833,7 +1886,7 @@ function usePlotProps(props: SeriesChartProps): PlotProps {
|
|
|
1833
1886
|
* button. For a thumbnail, a print view, or a chart the consumer wraps in its own
|
|
1834
1887
|
* interaction.
|
|
1835
1888
|
*/
|
|
1836
|
-
export function StaticSeriesChart(props: SeriesChartProps) {
|
|
1889
|
+
export function StaticSeriesChart<TRow extends object = object>(props: SeriesChartProps<TRow>) {
|
|
1837
1890
|
return <SeriesPlot {...usePlotProps(props)} />;
|
|
1838
1891
|
}
|
|
1839
1892
|
|
|
@@ -1842,8 +1895,12 @@ export function StaticSeriesChart(props: SeriesChartProps) {
|
|
|
1842
1895
|
* axes), double-click or press the reset button to go back; wrap several in
|
|
1843
1896
|
* `SharedXZoom` to move their x windows together. Which axes zoom depends on the marks
|
|
1844
1897
|
* — see {@link SeriesChartProps.zoomAxes}.
|
|
1898
|
+
*
|
|
1899
|
+
* Generic in its rows (0.53): `hit.row` and a `dot`'s `point.row` are typed as `rows` is —
|
|
1900
|
+
* see {@link SeriesChartProps}. A plain function, so the generic survives: a `memo` or a
|
|
1901
|
+
* `forwardRef` around it would read `TRow` as its constraint.
|
|
1845
1902
|
*/
|
|
1846
|
-
export function SeriesChart(props: SeriesChartProps) {
|
|
1903
|
+
export function SeriesChart<TRow extends object = object>(props: SeriesChartProps<TRow>) {
|
|
1847
1904
|
// The zoom fits the PLOTTED rows — slot indices and epoch ms, not the caller's labels.
|
|
1848
1905
|
return <ZoomablePlot {...usePlotProps(props)} />;
|
|
1849
1906
|
}
|
|
@@ -13,13 +13,18 @@ export interface TreemapLabels {
|
|
|
13
13
|
* `valueFormatter` when that returns text, else as the number in the provider's
|
|
14
14
|
* locale; `share` is the tile's share of what is drawn, already a formatted percent
|
|
15
15
|
* ("60 %" in German, "60%" in English) — the function only arranges them.
|
|
16
|
+
*
|
|
17
|
+
* `share` is `""` when the map's `shareInValue` says the formatter's text already holds
|
|
18
|
+
* it (0.53): leave out whatever frames it, as every catalogue drops its " (share)" —
|
|
19
|
+
* "Migros: CHF 412.30 · 12%", not "… · 12% ()".
|
|
16
20
|
*/
|
|
17
21
|
tile: (name: string, value: string, share: string) => string;
|
|
18
22
|
/**
|
|
19
23
|
* A group's accessible name (0.52, `TreemapNode.children`): its frame is a stop of the
|
|
20
24
|
* map's keyboard before its tiles, so a reader hears the group and its total once, on the
|
|
21
25
|
* way in. `value` and `share` as for {@link TreemapLabels.tile}, of the group's tiles
|
|
22
|
-
* together; the word "group" tells it from
|
|
26
|
+
* together, the share `""` under `shareInValue` as there; the word "group" tells it from
|
|
27
|
+
* a tile of the same shape.
|
|
23
28
|
*/
|
|
24
29
|
group: (name: string, value: string, share: string) => string;
|
|
25
30
|
/**
|
|
@@ -32,8 +37,11 @@ export interface TreemapLabels {
|
|
|
32
37
|
inGroup: (name: string, group: string) => string;
|
|
33
38
|
}
|
|
34
39
|
|
|
40
|
+
// The share in brackets only when there is one: `""` under the map's `shareInValue` (0.53,
|
|
41
|
+
// keksdose after 0.52), which the catalogues in src/i18n/locales follow, each in its own
|
|
42
|
+
// typography.
|
|
35
43
|
export const DEFAULT_TREEMAP_LABELS: TreemapLabels = {
|
|
36
|
-
tile: (name, value, share) => `${name}: ${value} (${share})`,
|
|
37
|
-
group: (name, value, share) => `${name}, group: ${value} (${share})`,
|
|
44
|
+
tile: (name, value, share) => `${name}: ${value}${share ? ` (${share})` : ""}`,
|
|
45
|
+
group: (name, value, share) => `${name}, group: ${value}${share ? ` (${share})` : ""}`,
|
|
38
46
|
inGroup: (name, group) => `${name}, in ${group}`,
|
|
39
47
|
};
|