@fasl-work/caos-app-shell 0.17.0 → 0.19.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/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ export { A as APP_ROUTE, a as AppShell, b as ArchTab, c as ArchitectureConfig, d
2
2
  import * as react from 'react';
3
3
  import { ReactNode, Component, ErrorInfo } from 'react';
4
4
  import * as zustand from 'zustand';
5
- import { F as FormatOptions } from './tokens-BTOzar-U.js';
6
- export { N as NBSP, a as NOT_AVAILABLE, b as SCIENTIFIC_BELOW, c as SHELL_TOKENS, S as ShellColorToken, d as ShellToken, f as formatNumber, e as formatTicks, r as resolveToken, u as useFormat, g as useThemeTokens } from './tokens-BTOzar-U.js';
5
+ import { F as FormatOptions } from './tokens-BvU9bFPw.js';
6
+ export { b as FittedLabel, N as NBSP, c as NOT_AVAILABLE, d as SCIENTIFIC_BELOW, e as SHELL_TOKENS, S as ShellColorToken, f as ShellToken, g as fitLabel, h as fontFamily, i as formatNumber, j as formatTicks, n as niceStep, k as niceTicks, l as resolveToken, t as textWidth, u as useFormat, m as useThemeTokens, w as widestLabel } from './tokens-BvU9bFPw.js';
7
7
  import { L as Lang, B as BiText } from './text-BlY47nIt.js';
8
8
  export { p as pick, u as useLangStore, a as useShellLang } from './text-BlY47nIt.js';
9
9
 
@@ -1082,16 +1082,32 @@ interface BarDatum {
1082
1082
  value: number | null | undefined;
1083
1083
  /** An explicit colour by meaning; otherwise the accent, or faint beside a highlighted bar. */
1084
1084
  tone?: Tone;
1085
- /** The bar the reader is on (the selected variant, the case asked about). */
1085
+ /** The bar the reader is on (the selected variant, the case asked about). A bar with a `tone` keeps it and is outlined (0.19.0). */
1086
1086
  highlight?: boolean;
1087
1087
  /** One line shown as the bar's title. */
1088
1088
  hint?: BiText;
1089
+ /** A floating bar (0.19.0): the bar's two ends on the value axis, in any order (a waterfall layer, a bridge step). Without it the bar spans
1090
+ * zero to `value`. `value` stays the number the bar states (a layer's size, a step's amount, a total): it is written at the bar, read in the
1091
+ * readout and the table, which add the two ends. A span of zero length is drawn as a dot as thick as a bar (a total on a bridge); a span with
1092
+ * a missing end draws nothing; a span outside `axis.range` is cut to it. */
1093
+ span?: [number | null | undefined, number | null | undefined];
1094
+ /** Grouped bars (0.19.0): consecutive data with the same `group.id` share one category band, side by side (vertical) or one under another
1095
+ * (horizontal), and the category axis prints the group label once; `label` then names the member (a regime, a year), read with its group
1096
+ * ("Retail, Stress: 18"). Data of one group that are not consecutive make a band each. */
1097
+ group?: {
1098
+ id: string;
1099
+ label: BiText;
1100
+ };
1101
+ /** The number format of this bar (0.19.0), over `axis.format`: its value label, its readout, its ends and its table cells (a layer stated to three
1102
+ * decimals in a stack of two). The axis keeps `axis.format`. */
1103
+ format?: FormatOptions;
1089
1104
  }
1090
1105
  interface BarChartProps {
1091
1106
  /** The chart's accessible name. */
1092
1107
  title: BiText;
1093
1108
  data: BarDatum[];
1094
- /** The value axis: its title, unit and number format; `range` fixes the domain (it always includes zero). */
1109
+ /** The value axis: its title, unit and number format; `range` fixes the domain (it includes zero, unless a datum has a `span`: then
1110
+ * the range is the axis, a bridge's from 100 to 140 for instance). */
1095
1111
  axis: {
1096
1112
  label: BiText;
1097
1113
  unit?: BiText;
@@ -1108,6 +1124,15 @@ interface BarChartProps {
1108
1124
  height?: number | 'fill';
1109
1125
  /** Called with a bar's id when it is clicked or chosen with the keyboard. */
1110
1126
  onSelect?: (id: string) => void;
1127
+ /** Turn zoom and pan by category off (0.19.0), with the reason (at least 12 characters; the gate lists every chart that sets it).
1128
+ * The crosshair, the readout, the keyboard, the data table and the summary cannot be turned off. */
1129
+ zoomOff?: BiText;
1130
+ /** What each tone means (0.19.0), drawn as a legend under the bars: grouped bars name their members by tone. A tone no bar uses is drawn
1131
+ * anyway and warned about in development. */
1132
+ legend?: Array<{
1133
+ tone: Tone;
1134
+ label: BiText;
1135
+ }>;
1111
1136
  }
1112
1137
  /**
1113
1138
  * The house categorical chart (CAOS_MANAGE audit 2026-10-07: every product hand-drew its bar charts with fixed margins,
@@ -1115,42 +1140,14 @@ interface BarChartProps {
1115
1140
  * over two lines at a word and only then shortened, with the whole label as its title; ticks are round and share one
1116
1141
  * notation; values are written in the interface language. It renders once its box has a width and declares
1117
1142
  * `data-chart`, which the gate's text check (G10) measures.
1118
- */
1119
- declare function BarChart({ title, data, axis, orientation, values, height, onSelect }: BarChartProps): react.JSX.Element;
1120
-
1121
- /**
1122
- * Text that fits the drawing it labels, measured in the font the page renders.
1123
1143
  *
1124
- * Products drew their axes and labels with fixed margins and a fixed width per character. The Linux fonts (DejaVu
1125
- * Sans) are wider than the Windows ones and Spanish labels are longer than English ones, so a column sized for one
1126
- * ran its labels out of the drawing in the other (CAOS_Fragmenta 0.05.000: "Tamaño medio clásico, limitado al bloque
1127
- * in situ" read "dio clásico, limitado al bloque in situ"; its deploy gate failed on Linux). Here a label is measured
1128
- * with the canvas text metrics of the page's own font (`--font-sans`, which the gate's wide-font pass replaces),
1129
- * broken over two lines at a word when it does not fit, and only then shortened with an ellipsis, so the drawing can
1130
- * give the whole label as its title. Ported from CAOS_Fragmenta `viz/text.ts` (0.07.000).
1131
- */
1132
- /** The page's sans-serif stack as the shell token resolves it. */
1133
- declare function fontFamily(): string;
1134
- /** The width of one line of text at a font size, in CSS pixels; outside a browser, an estimate on the wide side. */
1135
- declare function textWidth(text: string, px: number, weight?: number): number;
1136
- /** The widest a set of labels needs, each on one line. */
1137
- declare function widestLabel(labels: readonly string[], px: number, weight?: number): number;
1138
- interface FittedLabel {
1139
- /** One or two lines; the last is shortened with an ellipsis only when the lines allowed are not enough. */
1140
- lines: string[];
1141
- /** Whether the label was shortened, so the drawing gives the whole label as its title. */
1142
- shortened: boolean;
1143
- }
1144
- /** A label in at most `maxLines` lines of `width` pixels: whole when it fits, broken at a word, shortened last. */
1145
- declare function fitLabel(label: string, width: number, px: number, maxLines?: 1 | 2): FittedLabel;
1146
- /** The 1, 2, 2.5 or 5 times a power of ten at or above `x`. */
1147
- declare function niceStep(x: number): number;
1148
- /**
1149
- * Round ticks covering [lo, hi], as many as leave room for labels about `labelSize` pixels along an axis of `room`
1150
- * pixels (at least two, at most `most`). The first tick is at or below `lo` and the last at or above `hi`, so a bar
1151
- * or a point never runs past the last labelled value.
1144
+ * Since 0.19.0 it carries Tier A of the interactive-visualization rubric: a crosshair band and a readout for the bar under
1145
+ * the pointer or the keyboard, zoom and pan by category (wheel while the chart has the focus, Ctrl and wheel, brush, Shift and
1146
+ * drag, pinch), a reset control shown while zoomed, the keyboard model (arrows, Home, End, + and -, Shift with the arrows,
1147
+ * 0 and Escape), a hidden table of the values and a one-line summary. A value axis of counts ticks at whole numbers only
1148
+ * (`data-ticks-repeat` declares the labels that repeat, for the gate), and a long axis title wraps instead of being cut.
1152
1149
  */
1153
- declare function niceTicks(lo: number, hi: number, room: number, labelSize: number, most?: number): number[];
1150
+ declare function BarChart({ title, data, axis, orientation, values, height, onSelect, zoomOff, legend }: BarChartProps): react.JSX.Element;
1154
1151
 
1155
1152
  /** One section of the control rail. A rail whose content does not fit is SPLIT into sections, one shown at a
1156
1153
  * time, never scrolled (ADR-0071 rule 6: a panel must show its own controls). */
@@ -1380,4 +1377,4 @@ interface ViewsRowProps {
1380
1377
  */
1381
1378
  declare function ViewsRow({ children, shares }: ViewsRowProps): react.JSX.Element;
1382
1379
 
1383
- export { BREAKPOINTS, BarChart, type BarChartProps, type BarDatum, BiText, Callout, CardDeck, type CardDeckProps, type CaseDef, type CaseFocusConfig, type CaseGroup, type CaseKind, CaseSelector, type CaseSelectorProps, type CaseSelectorText, CaseWorkbench, type CaseWorkbenchProps, ChipGroup, type ChipGroupProps, type ChipOption, type Citation, CitationsProvider, Cite, DECK_TEXT, DOC_AREAS, type DeckCard, DocPage, type DocPageProps, DocReferences, DocRefsScope, DocSection, type DocSectionProps, EXECUTIVE_SCHEMA_VERSION, Equation, type ExecutiveData, type ExecutiveProblem, ExecutiveView, type ExecutiveViewProps, FLIP_LIMITS, FLIP_TEXT, FOCUS_PARAM, FOCUS_TEXT, FOUR_CS, Figure, type FittedLabel, FlipCard, type FlipCardProps, type FocusMode, type FocusModeConfig, type FocusModeOptions, FocusShell, type FocusShellProps, FormatOptions, Gauge, type GaugeProps, type GaugeZone, Glossary, type GlossaryEntry, InlineMath, Knob, type KnobProps, Landing, type Lane, LaneBadge, Lang, LanguageToggle, MAX_PEER_TABS, MAX_WORKBENCH_GROUPS, PanelBoundary, type PausedVizController, PlotCard, type PlotCardProps, type Provenance, Question, type QuestionProps, type RailSection, Readout, type ReadoutItem, type ReadoutProps, ReferenceList, Refs, Stage, type StageSize, Stat, type StatProps, type SubTabDef, SubTabs, type SubTabsProps, type SurfaceFocusConfig, SurfacePage, type SurfacePageProps, type TabDef, type TabGroupDef, TabGroups, type TabGroupsProps, Tabs, type TabsProps, type Theme, ThemeToggle, type Tone, type UsePausedVizOptions, VariantBar, type VariantBarProps, type VariantDef, Verdict, type VerdictProps, type ViewFocusConfig, ViewsRow, type ViewsRowProps, type VizFrame, type VizLoop, type VizLoopDeps, type VizLoopOptions, type WorkbenchGroup, WorkbenchLayout, type WorkbenchLayoutProps, type WorkbenchRoute, WorkbenchShell, type WorkbenchShellProps, type WorkbenchState, WorkbenchStateContext, applyTheme, caseKind, caseTooltip, casesInSource, createVizLoop, deckPosition, deckWindow, firstAppearance, fitLabel, fontFamily, groupByCategory, isStale, makeStateKey, niceStep, niceTicks, perPageFor, readCaseParam, readTheme, removeQueryParam, replaceQueryParam, sourcesPresent, textWidth, useFocusMode, usePausedViz, useStageSize, useThemeStore, useUrlView, useWorkbenchState, validateExecutive, viewParamOf, widestLabel, withCaseParam };
1380
+ export { BREAKPOINTS, BarChart, type BarChartProps, type BarDatum, BiText, Callout, CardDeck, type CardDeckProps, type CaseDef, type CaseFocusConfig, type CaseGroup, type CaseKind, CaseSelector, type CaseSelectorProps, type CaseSelectorText, CaseWorkbench, type CaseWorkbenchProps, ChipGroup, type ChipGroupProps, type ChipOption, type Citation, CitationsProvider, Cite, DECK_TEXT, DOC_AREAS, type DeckCard, DocPage, type DocPageProps, DocReferences, DocRefsScope, DocSection, type DocSectionProps, EXECUTIVE_SCHEMA_VERSION, Equation, type ExecutiveData, type ExecutiveProblem, ExecutiveView, type ExecutiveViewProps, FLIP_LIMITS, FLIP_TEXT, FOCUS_PARAM, FOCUS_TEXT, FOUR_CS, Figure, FlipCard, type FlipCardProps, type FocusMode, type FocusModeConfig, type FocusModeOptions, FocusShell, type FocusShellProps, FormatOptions, Gauge, type GaugeProps, type GaugeZone, Glossary, type GlossaryEntry, InlineMath, Knob, type KnobProps, Landing, type Lane, LaneBadge, Lang, LanguageToggle, MAX_PEER_TABS, MAX_WORKBENCH_GROUPS, PanelBoundary, type PausedVizController, PlotCard, type PlotCardProps, type Provenance, Question, type QuestionProps, type RailSection, Readout, type ReadoutItem, type ReadoutProps, ReferenceList, Refs, Stage, type StageSize, Stat, type StatProps, type SubTabDef, SubTabs, type SubTabsProps, type SurfaceFocusConfig, SurfacePage, type SurfacePageProps, type TabDef, type TabGroupDef, TabGroups, type TabGroupsProps, Tabs, type TabsProps, type Theme, ThemeToggle, type Tone, type UsePausedVizOptions, VariantBar, type VariantBarProps, type VariantDef, Verdict, type VerdictProps, type ViewFocusConfig, ViewsRow, type ViewsRowProps, type VizFrame, type VizLoop, type VizLoopDeps, type VizLoopOptions, type WorkbenchGroup, WorkbenchLayout, type WorkbenchLayoutProps, type WorkbenchRoute, WorkbenchShell, type WorkbenchShellProps, type WorkbenchState, WorkbenchStateContext, applyTheme, caseKind, caseTooltip, casesInSource, createVizLoop, deckPosition, deckWindow, firstAppearance, groupByCategory, isStale, makeStateKey, perPageFor, readCaseParam, readTheme, removeQueryParam, replaceQueryParam, sourcesPresent, useFocusMode, usePausedViz, useStageSize, useThemeStore, useUrlView, useWorkbenchState, validateExecutive, viewParamOf, withCaseParam };