@mittwald/flow-react-components 1.2.0-next.0 → 1.2.0-next.2

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
@@ -358,7 +358,7 @@ Easy-to-miss conventions not spelled out above. Full details and examples in
358
358
  on `:has(.icon)`; eleven components set `Icon` defaults through
359
359
  `PropsContext`) never gets the `flow--icon` class, so icon sizing and
360
360
  icon-only padding silently do not apply. Wrap it — `<Icon><IconFoo /></Icon>`
361
- — as the [Icon page](https://flow.mittwald.de/04-components/content/icon)
361
+ — as the [Icon page](https://flow.mittwald.de/components/content/icon)
362
362
  documents. Nothing errors: types, lint and the console stay clean.
363
363
  - **Universal exports are deliberately explicit** — remote-safe values and their
364
364
  types are curated in `flr-universal.ts` independently of the main public
package/MIGRATION.md CHANGED
@@ -635,11 +635,11 @@ whose callbacks are typed from your own data shape.
635
635
  We've replaced the `react-syntax-highlighter` library, which means many
636
636
  properties have been removed and the remaining ones have been simplified. See
637
637
  the
638
- [CodeBlock documentation](https://flow.mittwald.de/04-components/content/code-block/overview)
638
+ [CodeBlock documentation](https://flow.mittwald.de/components/content/code-block)
639
639
  for details on what's now supported.
640
640
 
641
641
  **Apply:** Check every `CodeBlock` usage against the current props (see the
642
- [CodeBlock documentation](https://flow.mittwald.de/04-components/content/code-block/overview))
642
+ [CodeBlock documentation](https://flow.mittwald.de/components/content/code-block))
643
643
  and remove or replace props the new implementation does not support.
644
644
 
645
645
  ---
@@ -774,9 +774,41 @@ prop. At runtime the old prop still works: `Action` maps it to `onAction` and
774
774
  logs a deprecation warning, and an explicit `onAction` wins. The fallback will
775
775
  be removed in a future major version.
776
776
 
777
- A codemod renames the prop on `Action`.
777
+ #### The type changed too
778
778
 
779
- **Apply:** Rename the `action` prop on `Action` to `onAction`.
779
+ `onAction` is typed `ActionFn`, which is `(...args: unknown[]) => unknown`. A
780
+ function that declares a parameter of any narrower type is not assignable to it,
781
+ because the parameter would receive `unknown`:
782
+
783
+ ```
784
+ Type '(options?: CloseOptions | undefined) => void' is not assignable to type 'ActionFn'.
785
+ Types of parameters 'options' and 'args' are incompatible.
786
+ Type 'unknown' is not assignable to type 'CloseOptions | undefined'.
787
+ ```
788
+
789
+ Wrap the call instead of passing the reference:
790
+
791
+ ```diff
792
+ - <Action onAction={controller.close}>
793
+ + <Action onAction={() => controller.close()}>
794
+ ```
795
+
796
+ Only function **references** are affected. An inline arrow
797
+ (`onAction={() => …}`), a zero-parameter function, and anything already
798
+ accepting `unknown` are all fine.
799
+
800
+ A codemod renames the prop. It deliberately does not wrap: whether the
801
+ referenced function declares a parameter cannot be decided from the source —
802
+ that needs type information — and wrapping everything would silently drop the
803
+ arguments `Action` passes to handlers that do accept them.
804
+
805
+ **Apply:** Rename the `action` prop on `Action` to `onAction`. Not only a
806
+ rename: the new prop is typed `ActionFn` (`(...args: unknown[]) => unknown`), so
807
+ a function _reference_ that declares a parameter no longer type-checks and needs
808
+ wrapping — `onAction={() => controller.close()}` rather than
809
+ `onAction={controller.close}`. Check every site where you passed a reference
810
+ rather than an inline arrow; the codemod renames the prop but cannot decide this
811
+ one from the source.
780
812
 
781
813
  ```shell
782
814
  npx @mittwald/flow-codemods@latest action-prop-to-on-action src
package/USAGE.md CHANGED
@@ -11,12 +11,12 @@ The prose that decides most questions — which component covers a use case, how
11
11
  spacing is composed, which pattern applies — lives on the docs site and is
12
12
  published for machine consumption:
13
13
 
14
- | URL | What it is |
15
- | ---------------------------------------- | ----------------------------------------------------------------- |
16
- | `https://flow.mittwald.de/llms.txt` | Index of every page, grouped by section |
17
- | `https://flow.mittwald.de/llms.json` | Manifest: title, description, page URL, Markdown URL per page |
18
- | `https://flow.mittwald.de/raw/<path>.md` | One page as Markdown, e.g. `/raw/04-components/actions/button.md` |
19
- | `https://flow.mittwald.de/llms-full.txt` | Every page in one file (~1.7 MB) |
14
+ | URL | What it is |
15
+ | ---------------------------------------- | -------------------------------------------------------------- |
16
+ | `https://flow.mittwald.de/llms.txt` | Index of every page, grouped by section |
17
+ | `https://flow.mittwald.de/llms.json` | Manifest: title, description, page URL, Markdown URL per page |
18
+ | `https://flow.mittwald.de/raw/<path>.md` | One page as Markdown, e.g. `/raw/components/actions/button.md` |
19
+ | `https://flow.mittwald.de/llms-full.txt` | Every page in one file (~1.7 MB) |
20
20
 
21
21
  **Fetch a page before answering a design question.** The pages are **written in
22
22
  German**; component names and design-system terms (Variants, Colors, Sizes,
@@ -24,12 +24,12 @@ States, Props) are not translated.
24
24
 
25
25
  Start with these:
26
26
 
27
- - `/raw/02-foundations/02-structure/01-layout.md` and `02-spacing.md` — how
28
- layout and spacing are meant to be composed
29
- - `/raw/03-patterns/01-patterns/forms.md`, `detail-page.md`, `errorhandling.md`,
27
+ - `/raw/foundations/structure/layout.md` and `spacing.md` — how layout and
28
+ spacing are meant to be composed
29
+ - `/raw/patterns/patterns/forms.md`, `detail-page.md`, `errorhandling.md`,
30
30
  `list-tile-table.md` — the recurring flows
31
- - `/raw/02-foundations/03-content-guidelines/01-sprach-guide.md` — UI wording
32
- - `/raw/01-get-started/versioning.md` — what you may depend on
31
+ - `/raw/foundations/content-guidelines/sprach-guide.md` — UI wording
32
+ - `/raw/get-started/versioning.md` — what you may depend on
33
33
 
34
34
  ## Setup
35
35
 
@@ -148,7 +148,7 @@ not a value to hard-code.
148
148
 
149
149
  The version contract deliberately leaves several surfaces unguaranteed. They can
150
150
  change in **any** release (see
151
- `https://flow.mittwald.de/raw/01-get-started/versioning.md`):
151
+ `https://flow.mittwald.de/raw/get-started/versioning.md`):
152
152
 
153
153
  - **CSS class names** (`.flow--button`, …) — never write selectors against them.
154
154
  - **Design-token names and values** (`--size-px--m`, `--color--gray--500`) —