@sonata-innovations/fiber-types 2.3.0 → 3.0.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/AGENTS.md CHANGED
@@ -40,6 +40,7 @@ npx ajv-cli validate --spec=draft2020 \
40
40
  - **Options must be `{ label, value }` objects**, not bare strings. `value` may be a string or a number.
41
41
  - **Option-bearing components do not default to their first option.** Initial value is `null` unless `properties.defaultValue` matches an option's `value`.
42
42
  - **Never set runtime-only fields** (`value`, `valid`, `addedComponents`) in Flow JSON.
43
+ - **`theme.fontFamily` may be an object, not just a string.** `{ family, src }` names a font the renderer loads itself; a bare string assumes the host page already has it. Narrow before treating it as a stack.
43
44
  - **`Component` is a discriminated union.** Narrow on `component.type` and `properties` narrows with it; use `ComponentOfType<"inputText">` to name one variant.
44
45
  - **If an AI/LLM generated the flow**, run `normalizeConditionalOrder(flow)` before handing it to FBTL — it reorders conditionals to sit after their triggers, structurally only, and is idempotent.
45
46
 
package/CHANGELOG.md CHANGED
@@ -2,6 +2,45 @@
2
2
 
3
3
  All notable changes to the Fiber schema types. Dates are release dates.
4
4
 
5
+ ## 3.0.0 — 2026-08-20
6
+
7
+ ### Removed — BREAKING
8
+
9
+ - **`FlowConfiguration.mode` and the `FlowModeType` type are gone.** One enum was doing three unrelated jobs: it selected a presentation, it partitioned which `FlowStyleType` values were legal, and it bundled two navigation behaviours. Each half now lives where it belongs — presentation on `theme.style`, behaviour on `navigation` — and the style vocabulary is flat.
10
+
11
+ A stored flow with `mode: "conversational"` already carried a focused `theme.style`, so its **look is unchanged**; add `navigation.autoAdvance: true` to keep the auto-advance, which is now opt-in. A flow with `mode: "standard"` needs only the key deleted. `mode` is no longer read anywhere, so a stale key is inert — but the schema no longer describes it. Full migration: [`docs/features/style-families.md`](docs/features/style-families.md).
12
+
13
+ ### Added
14
+
15
+ - **`FOCUSED_STYLES` and `styleFamily()`** — the four styles (`centered-minimal`, `stacked-cards`, `soft-float`, `bold-statement`) that share the focused presentation, and the derivation from a `FlowStyleType` to its family (`"form"` | `"focused"`). Also exported: the `StyleFamily` type.
16
+
17
+ The family is derived and internal — it never appears in Flow JSON. It exists because ~32 CSS rules are shared by all four focused styles, and because deriving presentation from `theme.style` means every render path that carries the theme carries the presentation, the session protocol included. Exporting it replaces two hand-synced copies of the old style partition (one in FBT, one in the theme editor).
18
+
19
+ - **`NavigationConfig.autoAdvance`** (default `false`) — advance ~500ms after a single-select choice. Explicit and off by default: a form moving without a click is surprising and shifts content and focus, so it is now a deliberate choice rather than a side effect of a presentation mode.
20
+ - **`NavigationConfig.advanceOnEnter`** (default `true`) — advance on Enter in a single-line input. Previously gated behind conversational mode, which meant an ordinary one-question-per-screen form did not advance on Enter — a missing feature rather than a mode boundary.
21
+
22
+ ### Changed
23
+
24
+ - `FlowStyleType` keeps all ten values and is now a **flat** vocabulary. Nothing partitions it; any style is valid on any flow.
25
+ - `flow-schema.json` / `flow-schema.md`: `mode` removed, the two `navigation` flags added, and the style description regrouped by family. The two sentences claiming conversational mode produced one question per screen are gone — it never did; it assumed the flow was already shaped that way.
26
+
27
+ ## 2.5.0 — 2026-08-20
28
+
29
+ ### Added
30
+
31
+ - **`ThemeConfig.fontFamily` now also accepts a loadable font config** — `{ family, src?, faces?, stack? }`, with the new `FontFamilyConfig`, `FontFaceConfig` and `FontSource` types exported. A plain family string still works and still means "the host page already loads this font"; the object form carries the sources a renderer needs to register the face itself. This is what makes a brand font work inside a shadow root, where an `@font-face` declared in the root's stylesheet is never registered at all. The schema (`flow-schema.json`) accepts either shape.
32
+
33
+ Widening the type is source-compatible for anything that *sets* `fontFamily`, but code that *reads* it as a `string` needs to narrow. `isFontFamilyConfig` and `fontFamilyStack` are exported from `@sonata-innovations/fiber-fbre` for that.
34
+
35
+ ## 2.4.0 — 2026-07-11 (never published)
36
+
37
+ > The version bump landed in the repo but was never tagged, so npm went 2.3.0 → 2.5.0. The change below ships as part of 2.5.0.
38
+
39
+
40
+ ### Added
41
+
42
+ - `ComponentInputType` (`"text" | "email" | "tel" | "url" | "password"`) is now exported from the package index. It is the declared type of the `inputText` component's `inputType` property and was the only property-level union not re-exported — every sibling (`ComponentWidth`, `DateFormat`, `ComponentCalloutVariant`, `SignatureMode`, …) already was. Consumers can now type a helper against it directly instead of restating the string union. No runtime or schema change: the `inputType` values are unchanged and were already documented in `flow-schema.json`.
43
+
5
44
  ## 2.3.0 — 2026-07-10
6
45
 
7
46
  ### Added
package/README.md CHANGED
@@ -46,7 +46,7 @@ npx ajv-cli validate --spec=draft2020 \
46
46
  import type {
47
47
  Flow, FlowScreen, Component, ComponentProperties,
48
48
  FlowMetadata, FlowConfiguration, ThemeConfig, NavigationConfig,
49
- ControlsConfig, ConfirmationConfig,
49
+ ControlsConfig, ConfirmationConfig, FontFamilyConfig,
50
50
  FlowData, ScreenData, ComponentData, CalculationData,
51
51
  FileUploadData, RangeValue,
52
52
  FlowConditionConfig, ConditionRule, ConditionOperator,
@@ -66,6 +66,12 @@ import {
66
66
  } from "@sonata-innovations/fiber-types";
67
67
  ```
68
68
 
69
+ Those are the headline types. Every **per-component property shape**
70
+ (`ComponentInputProperties`, `ComponentOptionProperties`, `ComponentRepeaterProperties`, …)
71
+ and every **property-level union** (`ComponentWidth`, `DateFormat`, `ComponentInputType`,
72
+ `ComponentCalloutVariant`, `SignatureMode`, `OptionItem`, `TableColumn`, …) is exported too —
73
+ import them when you need to type a helper against a single property rather than a whole component.
74
+
69
75
  `Component` is a **discriminated union keyed on `type`** — narrow on `component.type` and `component.properties` narrows with it:
70
76
 
71
77
  ```ts
@@ -76,6 +82,7 @@ if (component.type === "inputText") {
76
82
 
77
83
  ## Gotchas
78
84
 
85
+ - **`ThemeConfig.fontFamily` is `string | FontFamilyConfig`.** A plain string is a CSS stack and means "the host page already loads this font"; `{ family, src }` carries the sources a renderer registers itself. Code that reads the knob as a `string` has to narrow — `isFontFamilyConfig` / `fontFamilyStack` are exported from `@sonata-innovations/fiber-fbre` for that.
79
86
  - **30 component types.** Display types (`header`, `text`, `divider`, `callout`, `table`) never appear in FlowData; `computed` does.
80
87
  - **`pattern` validation rules take `params.regex`**, not `params.pattern`. A `pattern` key is silently ignored and the rule always passes.
81
88
  - **Options must be `{ label, value }` objects**, not bare strings. `value` may be a string or a number.
package/dist/flow.d.ts CHANGED
@@ -5,7 +5,6 @@ export type ScreenTransitionType = "none" | "slide" | "fade" | "slideFade" | "ri
5
5
  export type FlowStyleType = "clean" | "outlined" | "refined-clean" | "airy-clean" | "soft-outlined" | "defined-outlined" | "centered-minimal" | "stacked-cards" | "soft-float" | "bold-statement";
6
6
  export type ControlsLayout = "default" | "centered" | "inline-full" | "stacked";
7
7
  export type StepperStyle = "default" | "dots" | "pill" | "glow" | "bar" | "text";
8
- export type FlowModeType = "standard" | "conversational";
9
8
  export type FlowMetadata = Record<string, string> & {
10
9
  name?: string;
11
10
  description?: string;
@@ -14,6 +13,49 @@ export type FlowMetadata = Record<string, string> & {
14
13
  * `darkMode: boolean`. Light is the default. A future "auto" (follow the
15
14
  * viewer's `prefers-color-scheme`) is an additive option, not yet supported. */
16
15
  export type ColorScheme = "light" | "dark";
16
+ /** One `url(...)` entry inside a face's `src`. `format` is the CSS
17
+ * `format()` hint — "woff2", "woff", "truetype". */
18
+ export type FontSource = {
19
+ url: string;
20
+ format?: string;
21
+ };
22
+ /** A single `@font-face`: one weight/style of a family. */
23
+ export type FontFaceConfig = {
24
+ src: FontSource[];
25
+ /** CSS `font-weight` — "400", "700", or a variable range like "100 900". */
26
+ weight?: string;
27
+ style?: "normal" | "italic" | "oblique";
28
+ display?: "auto" | "block" | "swap" | "fallback" | "optional";
29
+ unicodeRange?: string;
30
+ };
31
+ /**
32
+ * A brand font the renderer can actually load, rather than a family name it
33
+ * can only hope the host page already has.
34
+ *
35
+ * Naming a family in a theme does nothing on its own: `fontFamily` maps to a
36
+ * CSS family *string*, and if no `@font-face` for it is registered in the
37
+ * owning document the form falls back to `system-ui` and looks approximately
38
+ * fine, so nobody reports it. It matters most exactly where the host cannot
39
+ * patch around it — a form mounted in a shadow root, since `@font-face`
40
+ * rules inside a shadow stylesheet are not registered at all.
41
+ *
42
+ * Give the family sources here and the renderer registers the faces in the
43
+ * owning document itself (`ensureFontLoaded` in `@sonata-innovations/fiber-fbre`),
44
+ * so the family string and the loaded face cannot drift apart.
45
+ */
46
+ export type FontFamilyConfig = {
47
+ /** CSS family name. Used both for the `@font-face` and the token value. */
48
+ family: string;
49
+ /** Shorthand for a single regular face. Merged with `faces`. */
50
+ src?: FontSource[];
51
+ /** Additional faces — a second weight, an italic. */
52
+ faces?: FontFaceConfig[];
53
+ /**
54
+ * The full stack written to `--fbre-font`. Defaults to the family plus a
55
+ * system fallback, so a face that fails to load still renders sensibly.
56
+ */
57
+ stack?: string;
58
+ };
17
59
  /**
18
60
  * Visual theme settings. Two layers:
19
61
  * - `colorScheme` + `style` pick built-in presets (the seed palette + shape).
@@ -40,8 +82,12 @@ export type ThemeConfig = {
40
82
  border?: string;
41
83
  /** Corner radius, any CSS length (`--fbre-radius`), e.g. `"3px"`. */
42
84
  radius?: string;
43
- /** Font family stack (`--fbre-font`). */
44
- fontFamily?: string;
85
+ /**
86
+ * Font family (`--fbre-font`). A plain CSS stack string uses whatever the
87
+ * host page already provides; a `FontFamilyConfig` additionally carries the
88
+ * sources the renderer needs to register the face itself.
89
+ */
90
+ fontFamily?: string | FontFamilyConfig;
45
91
  /** Error state color (`--fbre-error`). */
46
92
  error?: string;
47
93
  /** Success state color (`--fbre-success`). */
@@ -52,6 +98,25 @@ export type ThemeConfig = {
52
98
  export type NavigationConfig = {
53
99
  transition?: ScreenTransitionType;
54
100
  allowInvalidTransition?: boolean;
101
+ /**
102
+ * Advance to the next screen ~500ms after a single-select choice
103
+ * (radio, yesNo, cardSelect, dropDown). Default `false` — a form that
104
+ * moves without a click is surprising, and the content shift carries an
105
+ * accessibility cost, so it is opt-in. The builders' focused presets turn
106
+ * it on.
107
+ *
108
+ * Only ever fires on a screen with exactly one visible input; a shared
109
+ * screen behaves like a normal form so later components aren't skipped.
110
+ */
111
+ autoAdvance?: boolean;
112
+ /**
113
+ * Advance to the next screen when Enter is pressed in a single-line input
114
+ * (`inputText`, `inputNumber`). Default `true` — Enter-to-advance is a form
115
+ * convention, not a flourish. Never fires in a textarea, inside an open
116
+ * popup, on the last screen, on an invalid screen, or on a screen with more
117
+ * than one visible input.
118
+ */
119
+ advanceOnEnter?: boolean;
55
120
  };
56
121
  export type ControlsConfig = {
57
122
  show?: boolean;
@@ -79,7 +144,6 @@ export type ConfirmationConfig = {
79
144
  body?: string;
80
145
  };
81
146
  export type FlowConfiguration = {
82
- mode?: FlowModeType;
83
147
  theme?: ThemeConfig;
84
148
  navigation?: NavigationConfig;
85
149
  controls?: ControlsConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../src/flow.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACxD,OAAO,KAAK,EACV,yBAAyB,EACzB,aAAa,EACd,MAAM,yBAAyB,CAAC;AAEjC,MAAM,MAAM,oBAAoB,GAC5B,MAAM,GACN,OAAO,GACP,MAAM,GACN,WAAW,GACX,MAAM,GACN,WAAW,CAAC;AAEhB,MAAM,MAAM,aAAa,GACrB,OAAO,GACP,UAAU,GACV,eAAe,GACf,YAAY,GACZ,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,eAAe,GACf,YAAY,GACZ,gBAAgB,CAAC;AAErB,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,UAAU,GAAG,aAAa,GAAG,SAAS,CAAC;AAEhF,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,CAAC;AAEjF,MAAM,MAAM,YAAY,GAAG,UAAU,GAAG,gBAAgB,CAA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C,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,10 +1,12 @@
1
- export type { Flow, FlowScreen, FlowConfiguration, ThemeConfig, ColorScheme, NavigationConfig, ControlsConfig, ConfirmationConfig, FlowMetadata, Component, ComponentOfType, ComponentProperties, ScreenTransitionType, FlowStyleType, ControlsLayout, StepperStyle, FlowModeType, } from "./flow.js";
1
+ export type { Flow, FlowScreen, FlowConfiguration, ThemeConfig, ColorScheme, NavigationConfig, ControlsConfig, FontSource, FontFaceConfig, FontFamilyConfig, ConfirmationConfig, FlowMetadata, Component, ComponentOfType, ComponentProperties, ScreenTransitionType, FlowStyleType, ControlsLayout, StepperStyle, } from "./flow.js";
2
2
  export type { ComponentType, ComponentPropertiesByType, } from "./component-variants.js";
3
3
  export { COMPONENT_VARIANT_TYPES, assertManifestTypeMapParity, } from "./component-variants.js";
4
4
  export type { ConditionAction, ConditionLogic, ConditionOperator, ConditionRule, ConditionRuleSource, ConditionGroup, FlowConditionConfig, } from "./conditions.js";
5
5
  export type { ValidationRuleType, ValidationRule, FlowValidationConfig, } from "./validation.js";
6
6
  export { generateUUID } from "./uuid.js";
7
7
  export { normalizeOptions } from "./normalize-options.js";
8
+ export { FOCUSED_STYLES, styleFamily } from "./style-family.js";
9
+ export type { StyleFamily } from "./style-family.js";
8
10
  export type { FlowData, ScreenData, ComponentData, CalculationData, FileUploadData, FileUploadBase64Data, FileUploadS3Data, RangeValue, } from "./flow-data.js";
9
11
  export { regenerateComponentUUIDs, regenerateFlowUUIDs, } from "./uuid-regeneration.js";
10
12
  export { normalizeConditionalOrder } from "./normalize-conditional-order.js";
@@ -13,5 +15,5 @@ export type { PresetData, TemplateData } from "./preset-template-data.js";
13
15
  export type { CalculationFormat, FlowCalculation, } from "./calculation.js";
14
16
  export type { ComponentCategory, ComponentManifestEntry, } from "./component-manifest.js";
15
17
  export { COMPONENT_MANIFEST, COMPONENT_TYPES, DISPLAY_ONLY_TYPES, CATEGORY_LABELS, getComponentManifestEntry, getManifestByCategory, } from "./component-manifest.js";
16
- export type { ComponentWidth, DateFormat, ComponentDisplayProperties, ComponentDividerProperties, ComponentInputProperties, OptionItem, ComponentOptionProperties, ComponentSliderProperties, ComponentSwitchProperties, ComponentRatingProperties, ComponentFileUploadProperties, ComponentGroupProperties, ComponentRepeaterProperties, ComponentDateProperties, ComponentTimeProperties, ComponentDateTimeProperties, ComponentDateRangeProperties, ComponentTimeRangeProperties, ComponentDateTimeRangeProperties, ComponentYesNoProperties, ComponentConfirmProperties, ComponentColorPickerProperties, CardSelectOption, ComponentCardSelectProperties, ComponentCalloutVariant, ComponentCalloutProperties, TableColumn, TableRow, ComponentTableProperties, SignatureMode, ComponentSignatureProperties, ComponentComputedProperties, } from "./properties.js";
18
+ export type { ComponentWidth, DateFormat, ComponentDisplayProperties, ComponentDividerProperties, ComponentInputType, ComponentInputProperties, OptionItem, ComponentOptionProperties, ComponentSliderProperties, ComponentSwitchProperties, ComponentRatingProperties, ComponentFileUploadProperties, ComponentGroupProperties, ComponentRepeaterProperties, ComponentDateProperties, ComponentTimeProperties, ComponentDateTimeProperties, ComponentDateRangeProperties, ComponentTimeRangeProperties, ComponentDateTimeRangeProperties, ComponentYesNoProperties, ComponentConfirmProperties, ComponentColorPickerProperties, CardSelectOption, ComponentCardSelectProperties, ComponentCalloutVariant, ComponentCalloutProperties, TableColumn, TableRow, ComponentTableProperties, SignatureMode, ComponentSignatureProperties, ComponentComputedProperties, } from "./properties.js";
17
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,IAAI,EACJ,UAAU,EACV,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,oBAAoB,EACpB,aAAa,EACb,cAAc,EACd,YAAY,EACZ,YAAY,GACb,MAA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ity, } from "./component-variants.js";
2
2
  export { generateUUID } from "./uuid.js";
3
3
  export { normalizeOptions } from "./normalize-options.js";
4
+ export { FOCUSED_STYLES, styleFamily } from "./style-family.js";
4
5
  export { regenerateComponentUUIDs, regenerateFlowUUIDs, } from "./uuid-regeneration.js";
5
6
  export { normalizeConditionalOrder } from "./normalize-conditional-order.js";
6
7
  export { getValidationConfig, getComponentDisplayLabel, } from "./component-accessors.js";
@@ -0,0 +1,8 @@
1
+ import type { FlowStyleType } from "./flow.js";
2
+ /** The four styles whose presentation is the focused treatment. */
3
+ export declare const FOCUSED_STYLES: ReadonlySet<FlowStyleType>;
4
+ export type StyleFamily = "form" | "focused";
5
+ /** Which family a style belongs to. Unset styles are `"form"` (the `clean`
6
+ * default). */
7
+ export declare function styleFamily(style?: FlowStyleType): StyleFamily;
8
+ //# sourceMappingURL=style-family.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"style-family.d.ts","sourceRoot":"","sources":["../src/style-family.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAE/C,mEAAmE;AACnE,eAAO,MAAM,cAAc,EAAE,WAAW,CAAC,aAAa,CAKpD,CAAC;AAEH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,CAAC;AAE7C;gBACgB;AAChB,wBAAgB,WAAW,CAAC,KAAK,CAAC,EAAE,aAAa,GAAG,WAAW,CAE9D"}
@@ -0,0 +1,27 @@
1
+ /* ==========================================================================
2
+ Style families
3
+ Spec: docs/features/style-families.md
4
+
5
+ The ten `FlowStyleType` values form a flat vocabulary, but four of them
6
+ share a presentation treatment — vertical centering, staggered component
7
+ entry, enlarged tap targets, bolder type. That shared half is the
8
+ `"focused"` family; everything else is `"form"`.
9
+
10
+ The family is *derived*, never authored: no flow JSON carries it and no
11
+ author types it. FBRE emits it as `data-style-family` so the shared rules
12
+ have one selector instead of a repeated four-way list. Because it derives
13
+ from `theme.style`, every render path that carries the theme carries the
14
+ presentation with it — including the session protocol.
15
+ ========================================================================== */
16
+ /** The four styles whose presentation is the focused treatment. */
17
+ export const FOCUSED_STYLES = new Set([
18
+ "centered-minimal",
19
+ "stacked-cards",
20
+ "soft-float",
21
+ "bold-statement",
22
+ ]);
23
+ /** Which family a style belongs to. Unset styles are `"form"` (the `clean`
24
+ * default). */
25
+ export function styleFamily(style) {
26
+ return style && FOCUSED_STYLES.has(style) ? "focused" : "form";
27
+ }