@eifi1/ui-kit 0.52.0 → 0.54.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 +52 -59
- package/dist/account/delete-account-setting.d.ts +3 -2
- package/dist/account/delete-account-setting.js.map +1 -1
- package/dist/auth/auth-errors.d.ts +36 -0
- package/dist/auth/auth-errors.js +20 -0
- package/dist/auth/auth-errors.js.map +1 -1
- 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/amount-input.d.ts +2 -1
- package/dist/components/amount-input.js.map +1 -1
- package/dist/components/calendar-heatmap.js +4 -2
- package/dist/components/calendar-heatmap.js.map +1 -1
- package/dist/components/currency-option-list.d.ts +2 -1
- package/dist/components/currency-option-list.js +10 -3
- package/dist/components/currency-option-list.js.map +1 -1
- package/dist/components/currency-select.d.ts +3 -1
- package/dist/components/currency-select.js.map +1 -1
- package/dist/components/danger-confirm.d.ts +22 -1
- package/dist/components/danger-confirm.js +50 -28
- package/dist/components/danger-confirm.js.map +1 -1
- package/dist/components/data-table-filter-popover.d.ts +2 -1
- package/dist/components/data-table-filter-popover.js +3 -2
- package/dist/components/data-table-filter-popover.js.map +1 -1
- package/dist/components/data-table-filters.d.ts +33 -3
- package/dist/components/data-table-filters.js +6 -4
- package/dist/components/data-table-filters.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/dialog-frame.d.ts +3 -1
- package/dist/components/dialog-frame.js +6 -2
- package/dist/components/dialog-frame.js.map +1 -1
- package/dist/components/mini-calendar.js +3 -2
- package/dist/components/mini-calendar.js.map +1 -1
- package/dist/components/modal.d.ts +27 -0
- package/dist/components/modal.js +5 -3
- package/dist/components/modal.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/number-input.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/stat-tile.d.ts +21 -2
- package/dist/components/stat-tile.js +4 -2
- package/dist/components/stat-tile.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/currencies.d.ts +16 -2
- package/dist/currencies.js +2 -1
- package/dist/currencies.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-context-labels.js +2 -1
- package/dist/feedback/feedback-context-labels.js.map +1 -1
- package/dist/feedback/feedback-context.d.ts +19 -3
- package/dist/feedback/feedback-context.js +12 -1
- package/dist/feedback/feedback-context.js.map +1 -1
- package/dist/feedback/feedback-diagnostics.d.ts +17 -0
- package/dist/feedback/feedback-diagnostics.js +27 -0
- package/dist/feedback/feedback-diagnostics.js.map +1 -0
- package/dist/feedback/feedback-dialog.d.ts +10 -0
- package/dist/feedback/feedback-dialog.js +6 -4
- package/dist/feedback/feedback-dialog.js.map +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-record.d.ts +5 -0
- package/dist/feedback/feedback-record.js.map +1 -1
- package/dist/feedback/feedback-row-detail-labels.js +1 -8
- package/dist/feedback/feedback-row-detail-labels.js.map +1 -1
- package/dist/feedback/feedback-row-detail.d.ts +6 -50
- package/dist/feedback/feedback-row-detail.js +3 -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-submit-dialog.d.ts +5 -1
- package/dist/feedback/feedback-submit-dialog.js +15 -3
- package/dist/feedback/feedback-submit-dialog.js.map +1 -1
- package/dist/feedback/feedback-submit.d.ts +30 -2
- package/dist/feedback/feedback-submit.js +5 -2
- package/dist/feedback/feedback-submit.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/hooks/use-hotkey.js +11 -1
- package/dist/hooks/use-hotkey.js.map +1 -1
- package/dist/i18n/defaults.js +0 -4
- package/dist/i18n/defaults.js.map +1 -1
- package/dist/i18n/german.js +5 -20
- 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 +5 -31
- package/dist/i18n/locales/en.js.map +3 -3
- package/dist/i18n/locales/es.js +5 -20
- package/dist/i18n/locales/es.js.map +1 -1
- package/dist/i18n/locales/fr.js +5 -20
- package/dist/i18n/locales/fr.js.map +1 -1
- package/dist/i18n/locales/hu.js +5 -20
- package/dist/i18n/locales/hu.js.map +1 -1
- package/dist/i18n/locales/it.js +5 -21
- package/dist/i18n/locales/it.js.map +1 -1
- package/dist/i18n/locales/zh.js +5 -20
- 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 +18 -67
- package/dist/index.js +28 -103
- package/dist/index.js.map +1 -1
- package/dist/lib/dates.d.ts +7 -1
- package/dist/lib/dates.js +8 -1
- package/dist/lib/dates.js.map +1 -1
- package/dist/lib/format.d.ts +37 -2
- package/dist/lib/format.js +25 -1
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/intl-cache.d.ts +4 -2
- package/dist/lib/intl-cache.js.map +1 -1
- package/dist/lib/translation-review.d.ts +26 -0
- package/dist/lib/translation-review.js +14 -0
- package/dist/lib/translation-review.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/account/delete-account-setting.tsx +3 -2
- package/src/auth/auth-errors.ts +69 -0
- 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/amount-input.tsx +2 -1
- package/src/components/calendar-heatmap.tsx +8 -2
- package/src/components/currency-option-list.tsx +12 -4
- package/src/components/currency-select.tsx +3 -1
- package/src/components/danger-confirm.tsx +80 -27
- package/src/components/data-table-filter-popover.tsx +19 -11
- package/src/components/data-table-filters.ts +36 -8
- 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/dialog-frame.tsx +12 -4
- package/src/components/mini-calendar.tsx +5 -2
- package/src/components/modal.tsx +36 -7
- package/src/components/nav-pills.tsx +1 -1
- package/src/components/number-input.tsx +4 -3
- package/src/components/series-chart-axes.ts +6 -1
- package/src/components/series-chart.tsx +78 -21
- package/src/components/stat-tile.tsx +32 -3
- package/src/components/treemap-labels.ts +11 -3
- package/src/components/treemap.tsx +65 -12
- package/src/currencies.ts +23 -3
- package/src/data-table.ts +1 -11
- package/src/demo/demo-countdown.ts +3 -8
- package/src/feedback/feedback-context-labels.ts +1 -0
- package/src/feedback/feedback-context.tsx +34 -2
- package/src/feedback/feedback-diagnostics.tsx +41 -0
- package/src/feedback/feedback-dialog.tsx +16 -4
- package/src/feedback/feedback-mutation.ts +12 -33
- package/src/feedback/feedback-public-list.tsx +1 -7
- package/src/feedback/feedback-record.ts +5 -0
- package/src/feedback/feedback-row-detail-labels.ts +1 -8
- package/src/feedback/feedback-row-detail.tsx +21 -58
- package/src/feedback/feedback-status-undo.ts +4 -18
- package/src/feedback/feedback-submit-dialog.tsx +15 -2
- package/src/feedback/feedback-submit.tsx +36 -3
- package/src/feedback/feedback-thread.tsx +0 -10
- package/src/feedback.ts +89 -48
- package/src/hooks/use-hotkey.ts +24 -1
- package/src/i18n/defaults.ts +0 -4
- package/src/i18n/german.ts +4 -19
- package/src/i18n/kit-labels.tsx +5 -14
- package/src/i18n/locales/es.ts +4 -19
- package/src/i18n/locales/fr.ts +4 -19
- package/src/i18n/locales/hu.ts +4 -19
- package/src/i18n/locales/it.ts +4 -20
- package/src/i18n/locales/zh.ts +4 -19
- package/src/i18n/review.ts +9 -4
- package/src/i18n/shared-labels.ts +0 -1
- package/src/index.ts +44 -114
- package/src/lib/dates.ts +24 -2
- package/src/lib/format.ts +66 -3
- package/src/lib/intl-cache.ts +4 -2
- package/src/lib/translation-review.ts +52 -0
- 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
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
import { cn } from "../lib/cn";
|
|
2
|
-
import { NavPills } from "./nav-pills";
|
|
3
|
-
import type { NavPillItem, NavPillLinkProps } from "./nav-pills";
|
|
4
|
-
import type { ReactElement, Ref } from "react";
|
|
5
|
-
|
|
6
|
-
/** @deprecated 0.52 — `NavPillsProps` with `layout="scroll"`, what SectionNav wraps; removed in
|
|
7
|
-
* 0.53 (no app renders SectionNav: refactor audit 2026-10-30, MOD-5). */
|
|
8
|
-
export interface SectionNavProps<T extends string> {
|
|
9
|
-
/** The section's pages, each with its `href` (a pill without one is a button that
|
|
10
|
-
* calls `onSelect`). Labels short: the row is one line. */
|
|
11
|
-
items: NavPillItem<T>[];
|
|
12
|
-
/** The page that is open. `null`: none of them. */
|
|
13
|
-
current: T | null;
|
|
14
|
-
/** The section's name — the landmark's accessible name ("Accounting"). */
|
|
15
|
-
label: string;
|
|
16
|
-
/** Called with a pill's value on a click, before the router follows its link. */
|
|
17
|
-
onSelect?: (value: T) => void;
|
|
18
|
-
/** Your router's link. Default: the `<UiKitProvider linkComponent>`, then `<a>`. */
|
|
19
|
-
renderLink?: (props: NavPillLinkProps) => ReactElement;
|
|
20
|
-
/** Default `true`: only below `md`, where the sidebar that lists the same pages is
|
|
21
|
-
* gone. `false` shows it at every width. */
|
|
22
|
-
phoneOnly?: boolean;
|
|
23
|
-
className?: string;
|
|
24
|
-
ref?: Ref<HTMLElement>;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* The pages of a section on a phone, as one row of pills under the page title (0.49
|
|
29
|
-
* KIT-6) — kastlan's section pills, which each section page drew by hand.
|
|
30
|
-
*
|
|
31
|
-
* On a desktop the sidebar lists a group's pages; on a phone the AppShell's bar holds
|
|
32
|
-
* the groups, and a group's pages are a sheet away. This row puts them on the page
|
|
33
|
-
* itself: {@link NavPills} with `layout="scroll"` — one line that scrolls sideways, faded
|
|
34
|
-
* where it is cut, the open page scrolled into view (the row only, never the page). At
|
|
35
|
-
* most 48 px high: 44 px pills, the touch target a finger needs, and 2 px above and
|
|
36
|
-
* below. Each pill is a link (`aria-current="page"` on the open one) and its own tab
|
|
37
|
-
* stop; the row is a `<nav>` named by `label`.
|
|
38
|
-
*
|
|
39
|
-
* Place it right under the page's title (`PageHeader`); the AppShell's own row of a
|
|
40
|
-
* group's pages above the bar (`mobileSubNav`) is the shell-wide alternative — use one,
|
|
41
|
-
* not both, for the same pages.
|
|
42
|
-
*
|
|
43
|
-
* @deprecated 0.52 — `<NavPills layout="scroll" itemClassName="min-h-11 focus-visible:ring-inset"
|
|
44
|
-
* className="md:hidden">`, the same row; removed in 0.53. kastlan, whose section pills it
|
|
45
|
-
* was made for (0.49 KIT-6), never adopted it: no app renders it (refactor audit
|
|
46
|
-
* 2026-10-30, MOD-5).
|
|
47
|
-
*/
|
|
48
|
-
export function SectionNav<T extends string>({
|
|
49
|
-
items,
|
|
50
|
-
current,
|
|
51
|
-
label,
|
|
52
|
-
onSelect,
|
|
53
|
-
renderLink,
|
|
54
|
-
phoneOnly = true,
|
|
55
|
-
className,
|
|
56
|
-
ref,
|
|
57
|
-
}: SectionNavProps<T>) {
|
|
58
|
-
return (
|
|
59
|
-
<NavPills
|
|
60
|
-
ref={ref}
|
|
61
|
-
aria-label={label}
|
|
62
|
-
items={items}
|
|
63
|
-
current={current}
|
|
64
|
-
onSelect={onSelect}
|
|
65
|
-
renderLink={renderLink}
|
|
66
|
-
layout="scroll"
|
|
67
|
-
// The ring inside the pill: the row scrolls, so it clips what leaves its box.
|
|
68
|
-
itemClassName="min-h-11 focus-visible:ring-inset"
|
|
69
|
-
className={cn("py-0.5 large:py-0", phoneOnly && "md:hidden", className)}
|
|
70
|
-
/>
|
|
71
|
-
);
|
|
72
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
// The English words of ./sign-chip, in a module with no component code: the English
|
|
2
|
-
// catalogue (src/i18n/defaults.ts) imports them without the component, so `en` loads as one
|
|
3
|
-
// chunk like the other languages (0.34, KS U8). ./sign-chip re-exports them.
|
|
4
|
-
|
|
5
|
-
import type { SignChipLabels } from "./sign-chip";
|
|
6
|
-
|
|
7
|
-
/** @deprecated 0.52 — a `Chip` of your own, as keksdose's DirectionToggle is (MOD-5); removed in 0.53. */
|
|
8
|
-
export const DEFAULT_SIGN_CHIP_LABELS: SignChipLabels = {
|
|
9
|
-
outflow: "Outflow",
|
|
10
|
-
inflow: "Inflow",
|
|
11
|
-
direction: (current, next) => `Direction: ${current} — switch to ${next}`,
|
|
12
|
-
switchTo: (next) => `Switch to ${next}`,
|
|
13
|
-
};
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
import { ArrowUpDown, Minus, Plus } from "lucide-react";
|
|
2
|
-
import { Chip } from "./chip";
|
|
3
|
-
import { Tooltip } from "./tooltip";
|
|
4
|
-
import { cn } from "../lib/cn";
|
|
5
|
-
import { useKitLabels, type LabelOverride } from "../i18n/kit-labels";
|
|
6
|
-
import { useLargeText } from "../hooks/use-large-text";
|
|
7
|
-
import { DEFAULT_SIGN_CHIP_LABELS } from "./sign-chip-labels";
|
|
8
|
-
|
|
9
|
-
// ── Labels ────────────────────────────────────────────────────────────────────
|
|
10
|
-
|
|
11
|
-
/** The words a {@link SignChip} says — the `signChip` namespace of
|
|
12
|
-
* `<UiKitProvider labels>`, and per chip through its `labels` prop.
|
|
13
|
-
*
|
|
14
|
-
* @deprecated 0.52 — a `Chip` of your own, as keksdose's DirectionToggle is (MOD-5); removed in 0.53. */
|
|
15
|
-
export interface SignChipLabels {
|
|
16
|
-
/** The chip's text while the figure is negative — money going out. */
|
|
17
|
-
outflow: string;
|
|
18
|
-
/** The chip's text while the figure is positive — money coming in. */
|
|
19
|
-
inflow: string;
|
|
20
|
-
/** The chip's accessible name and its tooltip: the state it is in, and what a press
|
|
21
|
-
* turns it into — `current` and `next` are the two words above. The other option is
|
|
22
|
-
* nowhere on screen to be read, so the name has to say both. */
|
|
23
|
-
direction: (current: string, next: string) => string;
|
|
24
|
-
/** 0.32: what a press does, in words under the chip at Large and Extra large —
|
|
25
|
-
* `next` is the other direction's word ("Switch to Inflow"). The tooltip's half of
|
|
26
|
-
* `direction`, shown, since a fact may not live only in a tooltip there (§4). */
|
|
27
|
-
switchTo: (next: string) => string;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Defined in ./sign-chip-labels, which holds no component code (0.34, KS U8).
|
|
31
|
-
export { DEFAULT_SIGN_CHIP_LABELS };
|
|
32
|
-
|
|
33
|
-
/** @deprecated 0.52 — a `Chip` of your own, as keksdose's DirectionToggle is (MOD-5); removed in 0.53. */
|
|
34
|
-
export interface SignChipProps {
|
|
35
|
-
/** The figure is negative (an outflow) — the same flag {@link AmountInput}'s
|
|
36
|
-
* `negative` is, so one state feeds both: `<AmountInput negative={neg}
|
|
37
|
-
* onNegativeChange={setNeg} />` and `<SignChip negative={neg}
|
|
38
|
-
* onNegativeChange={setNeg} />`. */
|
|
39
|
-
negative: boolean;
|
|
40
|
-
/** A press: the other direction. */
|
|
41
|
-
onNegativeChange: (negative: boolean) => void;
|
|
42
|
-
disabled?: boolean;
|
|
43
|
-
/** Per-chip overrides of the `signChip` namespace. */
|
|
44
|
-
labels?: LabelOverride<SignChipLabels>;
|
|
45
|
-
/** On the chip. Place it in its row from here — keksdose's form passes `self-end`
|
|
46
|
-
* to sit it on the display figure's baseline strip. */
|
|
47
|
-
className?: string;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* The SIGN of an amount, as one chip that shows only the state it is in — keksdose
|
|
52
|
-
* K15, its `DirectionToggle` (feedback #417, #430, #431, dev#434) made a kit piece,
|
|
53
|
-
* so the figure and its direction come from one package and wear one palette.
|
|
54
|
-
*
|
|
55
|
-
* WHY A CHIP, NOT A SEGMENTED CONTROL. A two-option toggle spends half its width
|
|
56
|
-
* telling you what the figure is NOT, and at a phone's width it was the widest thing on
|
|
57
|
-
* the form after the figure itself (#417). This sits beside the amount and reads as one
|
|
58
|
-
* phrase with it — "−42,50 Outflow" — and a press flips it. Hiding the alternative costs
|
|
59
|
-
* discoverability, so two things pay it back: the ± glyph and the swap arrows say "this
|
|
60
|
-
* is a control", not a badge; and the name and tooltip spell out both the current state
|
|
61
|
-
* and what a press will do.
|
|
62
|
-
*
|
|
63
|
-
* NOT A PRESSED/UNPRESSED TOGGLE. A {@link Chip} toggle has a FIXED label naming its
|
|
64
|
-
* on-state, with `aria-pressed` carrying the state. Here the word IS the state, so it
|
|
65
|
-
* is an action button with no `aria-pressed`: "Direction: Inflow, not pressed" would
|
|
66
|
-
* name no on-state for "not pressed" to be the absence of. The name changing under
|
|
67
|
-
* focus is the echo.
|
|
68
|
-
*
|
|
69
|
-
* THE COLOUR is the money pairing — the chip's `expense` / `income` tones, the same
|
|
70
|
-
* `--money-expense` / `--money-income` that {@link AmountInput}'s `tone` paints the
|
|
71
|
-
* figure with (dev#434): only the text and the border carry the tint, on a neutral
|
|
72
|
-
* surface, because a filled pill next to a tinted figure reads as one smear.
|
|
73
|
-
*
|
|
74
|
-
* SIZE. `lg` on a phone — the 44px touch target beside a display figure that has no
|
|
75
|
-
* field height to match — and from `md` up exactly a labelled field's 42px, so it never
|
|
76
|
-
* stands taller than the fields in its grid row (#431).
|
|
77
|
-
*
|
|
78
|
-
* An exported chip rather than an `AmountInput signControl` slot: the slot would have
|
|
79
|
-
* to own the row the two share, and every form lays that row out differently (beside
|
|
80
|
-
* the figure on a phone, in a grid column on a desktop). The chip is the part that was
|
|
81
|
-
* being re-written; the row stays the form's.
|
|
82
|
-
*
|
|
83
|
-
* Deprecated in 0.52, removed in 0.53 (decision 4 of the refactor audit 2026-10-30,
|
|
84
|
-
* MOD-5): keksdose, whose chip this was (K15), kept its own `DirectionToggle` on `Chip`
|
|
85
|
-
* and `Tooltip`, and no other app renders one.
|
|
86
|
-
*
|
|
87
|
-
* @deprecated 0.52 — a `Chip` of your own, as keksdose's DirectionToggle is (MOD-5); removed in 0.53.
|
|
88
|
-
*/
|
|
89
|
-
export function SignChip({ negative, onNegativeChange, disabled, labels: labelsProp, className }: SignChipProps) {
|
|
90
|
-
const labels = useKitLabels("signChip", DEFAULT_SIGN_CHIP_LABELS, labelsProp);
|
|
91
|
-
const current = negative ? labels.outflow : labels.inflow;
|
|
92
|
-
const next = negative ? labels.inflow : labels.outflow;
|
|
93
|
-
const name = labels.direction(current, next);
|
|
94
|
-
// §4: at Large the chip's word is joined by what a press does, as a line under it —
|
|
95
|
-
// and the bubble that said only that goes.
|
|
96
|
-
const large = useLargeText();
|
|
97
|
-
const chip = (
|
|
98
|
-
<Chip
|
|
99
|
-
size="lg"
|
|
100
|
-
tone={negative ? "expense" : "income"}
|
|
101
|
-
icon={negative ? Minus : Plus}
|
|
102
|
-
onClick={() => onNegativeChange(!negative)}
|
|
103
|
-
disabled={disabled}
|
|
104
|
-
aria-label={name}
|
|
105
|
-
// `gap-1.5 px-3`: the chip's narrower body, because on a 375px screen every
|
|
106
|
-
// pixel of it is taken from the figure beside it (#430). `md:py-2.5` with the
|
|
107
|
-
// hairline border is the 42px a labelled field measures (#431).
|
|
108
|
-
className={cn("shrink-0 gap-1.5 whitespace-nowrap px-3 font-medium md:min-h-0 md:py-2.5", !large && className)}
|
|
109
|
-
>
|
|
110
|
-
{current}
|
|
111
|
-
{/* The swap arrows after the word, in the label's own row: decoration (the
|
|
112
|
-
name already says what a press does), set a little apart from the word. */}
|
|
113
|
-
<ArrowUpDown className="ms-1.5 inline size-3.5 align-[-0.2em] opacity-60" aria-hidden />
|
|
114
|
-
</Chip>
|
|
115
|
-
);
|
|
116
|
-
if (!large) {
|
|
117
|
-
return (
|
|
118
|
-
<Tooltip label={name} lazy>
|
|
119
|
-
{chip}
|
|
120
|
-
</Tooltip>
|
|
121
|
-
);
|
|
122
|
-
}
|
|
123
|
-
return (
|
|
124
|
-
// The caller's placement (`self-end`…) moves to the pair, which is now the row's item.
|
|
125
|
-
<span data-slot="sign-chip" className={cn("inline-flex shrink-0 flex-col items-start gap-0.5", className)}>
|
|
126
|
-
{chip}
|
|
127
|
-
{/* Hidden from the accessibility tree: the chip's name already says it. */}
|
|
128
|
-
<span aria-hidden className="text-xs text-muted">
|
|
129
|
-
{labels.switchTo(next)}
|
|
130
|
-
</span>
|
|
131
|
-
</span>
|
|
132
|
-
);
|
|
133
|
-
}
|
package/src/lib/isin.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ISIN helpers — ISO 6166 — for keksdose, whose securities holdings are keyed by ISIN
|
|
3
|
-
* and whose import and edit forms checked only the shape (two letters, ten
|
|
4
|
-
* characters): a mistyped ISIN saved happily and then matched no price feed.
|
|
5
|
-
*
|
|
6
|
-
* An ISIN is twelve characters: a two-letter prefix (the issuing country, or a
|
|
7
|
-
* supranational code such as `XS`), nine letters or digits (the national number) and
|
|
8
|
-
* one check digit. The check digit is the Luhn digit of the first eleven characters
|
|
9
|
-
* with every letter expanded to two digits (A = 10 … Z = 35) — which is all that is
|
|
10
|
-
* checked here. Whether the prefix is an assigned code, and whether the security
|
|
11
|
-
* exists, is a lookup, not a checksum.
|
|
12
|
-
*
|
|
13
|
-
* Deprecated in 0.52, removed in 0.53 (decision 4 of the refactor audit 2026-10-30,
|
|
14
|
-
* MOD-5): keksdose, which they were written for, never imported them, and no other app
|
|
15
|
-
* does.
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
/** Letters to their two-digit numbers (A = 10 … Z = 35), digits as they are. */
|
|
19
|
-
function expandLetters(value: string): string {
|
|
20
|
-
return value.replace(/[A-Z]/g, (c) => String(c.charCodeAt(0) - 55));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/** The Luhn sum of `digits` with the RIGHTMOST digit doubled first — the shape of the
|
|
24
|
-
* sum when a check digit is about to be appended. */
|
|
25
|
-
function luhnSum(digits: string, doubleRightmost: boolean): number {
|
|
26
|
-
let sum = 0;
|
|
27
|
-
let double = doubleRightmost;
|
|
28
|
-
for (let i = digits.length - 1; i >= 0; i--) {
|
|
29
|
-
let d = digits.charCodeAt(i) - 48;
|
|
30
|
-
if (double) {
|
|
31
|
-
d *= 2;
|
|
32
|
-
if (d > 9) d -= 9;
|
|
33
|
-
}
|
|
34
|
-
sum += d;
|
|
35
|
-
double = !double;
|
|
36
|
-
}
|
|
37
|
-
return sum;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/**
|
|
41
|
-
* The ISIN as it is printed: upper case, unbroken (ISO 6166 has no grouping), with
|
|
42
|
-
* the spaces and hyphens a paste from a broker's statement carries dropped.
|
|
43
|
-
*
|
|
44
|
-
* @deprecated 0.52 — none: no app checks an ISIN with it; copy lib/isin.ts (MOD-5); removed in 0.53.
|
|
45
|
-
*/
|
|
46
|
-
export function formatIsin(value: string): string {
|
|
47
|
-
return value.replace(/[\s-]/g, "").toUpperCase();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* The check digit for the first eleven characters of an ISIN (prefix and national
|
|
52
|
-
* number). For BUILDING one — a test fixture, a demo — rather than checking it.
|
|
53
|
-
*
|
|
54
|
-
* @deprecated 0.52 — none: no app checks an ISIN with it; copy lib/isin.ts (MOD-5); removed in 0.53.
|
|
55
|
-
*/
|
|
56
|
-
export function isinCheckDigit(body: string): string {
|
|
57
|
-
const sum = luhnSum(expandLetters(formatIsin(body)), true);
|
|
58
|
-
return String((10 - (sum % 10)) % 10);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Whether `value` is a valid ISIN: two letters, nine letters or digits, one digit,
|
|
63
|
-
* and a matching Luhn check digit over the letter-expanded form. Spaces, hyphens and
|
|
64
|
-
* lower case are fine (see {@link formatIsin}).
|
|
65
|
-
*
|
|
66
|
-
* @deprecated 0.52 — none: no app checks an ISIN with it; copy lib/isin.ts (MOD-5); removed in 0.53.
|
|
67
|
-
*/
|
|
68
|
-
export function isValidIsin(value: string): boolean {
|
|
69
|
-
const isin = formatIsin(value);
|
|
70
|
-
if (!/^[A-Z]{2}[A-Z0-9]{9}\d$/.test(isin)) return false;
|
|
71
|
-
return luhnSum(expandLetters(isin), false) % 10 === 0;
|
|
72
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { FlaskConical } from "lucide-react";
|
|
2
|
-
import { OptionSwitcherMenu } from "./option-switcher-menu";
|
|
3
|
-
import { DEFAULT_TOP_BAR_LABELS, useKitLabels } from "../i18n/kit-labels";
|
|
4
|
-
|
|
5
|
-
/** @deprecated 0.52 — `DevMenuProps` (`roles`, `currentRole`, `onRole`) (MOD-5); removed in 0.53. */
|
|
6
|
-
export interface RoleSwitcherProps<R extends string> {
|
|
7
|
-
roles: readonly R[];
|
|
8
|
-
value: R;
|
|
9
|
-
onChange: (role: R) => void;
|
|
10
|
-
/** Default: `topBar.switchRole` from the {@link UiKitProvider}, else English. */
|
|
11
|
-
"aria-label"?: string;
|
|
12
|
-
heading?: string;
|
|
13
|
-
/** The trigger's tooltip. Default: `topBar.role(value)`. */
|
|
14
|
-
title?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* A reusable user-role switcher (feedback #337): a thin wrapper over
|
|
19
|
-
* {@link OptionSwitcherMenu} with the standard flask icon, so an app drops it in
|
|
20
|
-
* the top bar with just the role list + current value + a handler. Typically
|
|
21
|
-
* dev-only / UI-only, but the app decides where and whether to render it.
|
|
22
|
-
*
|
|
23
|
-
* The flask wears `--warning` rather than a fixed `amber-500`: it is a caution
|
|
24
|
-
* marker — the app is not showing you your own role — and the token carries that
|
|
25
|
-
* amber across both themes instead of pinning one hue onto every palette.
|
|
26
|
-
*
|
|
27
|
-
* Deprecated in 0.52, removed in 0.53 (decision 4 of the refactor audit 2026-10-30,
|
|
28
|
-
* MOD-5): the role switch every app draws is `DevMenu`'s Account section (0.51), and no
|
|
29
|
-
* app renders this one.
|
|
30
|
-
*
|
|
31
|
-
* @deprecated 0.52 — `DevMenu` with `roles`, `currentRole` and `onRole` (MOD-5); removed in 0.53.
|
|
32
|
-
*/
|
|
33
|
-
export function RoleSwitcher<R extends string>({
|
|
34
|
-
roles,
|
|
35
|
-
value,
|
|
36
|
-
onChange,
|
|
37
|
-
"aria-label": ariaLabel,
|
|
38
|
-
heading,
|
|
39
|
-
title,
|
|
40
|
-
}: RoleSwitcherProps<R>) {
|
|
41
|
-
const labels = useKitLabels("topBar", DEFAULT_TOP_BAR_LABELS, { switchRole: ariaLabel });
|
|
42
|
-
return (
|
|
43
|
-
<OptionSwitcherMenu<R>
|
|
44
|
-
aria-label={labels.switchRole}
|
|
45
|
-
title={title ?? labels.role(value)}
|
|
46
|
-
heading={heading}
|
|
47
|
-
icon={<FlaskConical className="size-5 text-warning" />}
|
|
48
|
-
options={roles.map((r) => ({ value: r, label: r }))}
|
|
49
|
-
value={value}
|
|
50
|
-
onSelect={onChange}
|
|
51
|
-
/>
|
|
52
|
-
);
|
|
53
|
-
}
|