@mittwald/flow-react-components 0.2.0-alpha.1003 → 0.2.0-alpha.1005
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 +21 -2
- package/CHANGELOG.md +12 -0
- package/MIGRATION.md +41 -0
- package/PATTERNS.md +21 -1
- package/dist/assets/doc-properties.json +2111 -966
- package/dist/css/all-layered.css +1 -1
- package/dist/js/default.mjs +2 -0
- package/dist/js/default.mjs.map +1 -1
- package/dist/js/flr-universal.mjs +1 -0
- package/dist/js/flr-universal.mjs.map +1 -1
- package/dist/js/packages/components/src/components/ComponentDefaultsProvider/ComponentDefaultsProvider.mjs +40 -0
- package/dist/js/packages/components/src/components/ComponentDefaultsProvider/ComponentDefaultsProvider.mjs.map +1 -0
- package/dist/js/packages/components/src/components/ComponentDefaultsProvider/defaults.mjs +13 -0
- package/dist/js/packages/components/src/components/ComponentDefaultsProvider/defaults.mjs.map +1 -0
- package/dist/js/packages/components/src/components/ComponentDefaultsProvider/deprecatedFlags.mjs +34 -0
- package/dist/js/packages/components/src/components/ComponentDefaultsProvider/deprecatedFlags.mjs.map +1 -0
- package/dist/js/packages/components/src/components/List/model/loading/IncrementalLoader.mjs +4 -2
- package/dist/js/packages/components/src/components/List/model/loading/IncrementalLoader.mjs.map +1 -1
- package/dist/js/packages/components/src/flags.mjs +18 -4
- package/dist/js/packages/components/src/flags.mjs.map +1 -1
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Form/Form.mjs +7 -5
- package/dist/js/packages/components/src/integrations/react-hook-form/components/Form/Form.mjs.map +1 -1
- package/dist/js/packages/components/src/status/component-status.json.mjs +1 -0
- package/dist/js/packages/components/src/status/component-status.json.mjs.map +1 -1
- package/dist/types/components/ComponentDefaultsProvider/ComponentDefaultsProvider.d.ts +24 -0
- package/dist/types/components/ComponentDefaultsProvider/ComponentDefaultsProvider.d.ts.map +1 -0
- package/dist/types/components/ComponentDefaultsProvider/ComponentDefaultsProvider.test.d.ts +2 -0
- package/dist/types/components/ComponentDefaultsProvider/ComponentDefaultsProvider.test.d.ts.map +1 -0
- package/dist/types/components/ComponentDefaultsProvider/defaults.d.ts +37 -0
- package/dist/types/components/ComponentDefaultsProvider/defaults.d.ts.map +1 -0
- package/dist/types/components/ComponentDefaultsProvider/deprecatedFlags.d.ts +8 -0
- package/dist/types/components/ComponentDefaultsProvider/deprecatedFlags.d.ts.map +1 -0
- package/dist/types/components/ComponentDefaultsProvider/index.d.ts +4 -0
- package/dist/types/components/ComponentDefaultsProvider/index.d.ts.map +1 -0
- package/dist/types/components/List/model/loading/IncrementalLoader.d.ts.map +1 -1
- package/dist/types/components/List/model/loading/types.d.ts +8 -0
- package/dist/types/components/List/model/loading/types.d.ts.map +1 -1
- package/dist/types/components/public.d.ts +1 -0
- package/dist/types/components/public.d.ts.map +1 -1
- package/dist/types/flags.d.ts +23 -2
- package/dist/types/flags.d.ts.map +1 -1
- package/dist/types/integrations/react-hook-form/components/Form/Form.d.ts.map +1 -1
- package/dist/types/status/component-status.json.d.ts +4 -0
- package/dist/types/tests/layered/CodeEditor.browser.test.d.ts +2 -0
- package/dist/types/tests/layered/CodeEditor.browser.test.d.ts.map +1 -0
- package/dist/types/tests/layered/Icon.browser.test.d.ts +2 -0
- package/dist/types/tests/layered/Icon.browser.test.d.ts.map +1 -0
- package/dist/types/tests/layered/ImageCropper.browser.test.d.ts +2 -0
- package/dist/types/tests/layered/ImageCropper.browser.test.d.ts.map +1 -0
- package/package.json +13 -11
package/AGENTS.md
CHANGED
|
@@ -196,6 +196,15 @@ if ("action" in props) {
|
|
|
196
196
|
Group repeated variants in local mixins.
|
|
197
197
|
- Structure sections with comments: `/* Elements */`, `/* States */`,
|
|
198
198
|
`/* Size */`, `/* Variants */`.
|
|
199
|
+
- **Overriding a dependency that injects its own stylesheet** (CodeMirror,
|
|
200
|
+
react-easy-crop, FontAwesome) needs `@layer flow.unlayered { … }`: their
|
|
201
|
+
`<style>` elements are unlayered, and unlayered CSS beats layered CSS
|
|
202
|
+
regardless of specificity, so a normal rule never applies in
|
|
203
|
+
`all-layered.css`. Only for the library's own `:global()` selectors — the
|
|
204
|
+
`flow/unlayered-third-party-only` lint rule enforces that, because the marker
|
|
205
|
+
costs consumers the layer-based overridability of the rule. New or changed
|
|
206
|
+
rendered behavior here gets a test in `src/tests/layered/`, which runs against
|
|
207
|
+
the layered variant; the default browser project cannot see this class of bug.
|
|
199
208
|
|
|
200
209
|
## Testing — the actual bar
|
|
201
210
|
|
|
@@ -255,8 +264,18 @@ props to hide.
|
|
|
255
264
|
|
|
256
265
|
## Misc
|
|
257
266
|
|
|
258
|
-
-
|
|
259
|
-
|
|
267
|
+
- Application-wide component defaults: `ComponentDefaultsProvider`
|
|
268
|
+
(`src/components/ComponentDefaultsProvider/`) is where a behavior default that
|
|
269
|
+
an application should be able to set **once** belongs. Add the setting to the
|
|
270
|
+
`ComponentDefaults` interface plus its built-in value in
|
|
271
|
+
`builtInComponentDefaults`, and read it with `useComponentDefaults("<Name>")`
|
|
272
|
+
at the place that decides. Resolution order: local prop → provider →
|
|
273
|
+
deprecated `flags` → built-in default. This is not a replacement for
|
|
274
|
+
`PropsContext`: a UI component clears the props context for its children, so
|
|
275
|
+
PropsContext cannot carry an app-wide default past the first UI ancestor.
|
|
276
|
+
- Feature flags: `src/flags.ts` is the deprecated predecessor of the
|
|
277
|
+
`ComponentDefaultsProvider`. Assigned flags still act as an application-wide
|
|
278
|
+
default (and warn via `useWarnDeprecation`); do not add new ones.
|
|
260
279
|
- `SettingsProvider` (`src/components/SettingsProvider/`) is the built-in
|
|
261
280
|
persistence for component settings (e.g. `List` remembering its view
|
|
262
281
|
settings), with pluggable backends (localStorage by default). Internal
|
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,18 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.2.0-alpha.1005](https://github.com/mittwald/flow/compare/0.2.0-alpha.1004...0.2.0-alpha.1005) (2026-08-06)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **components:** add ComponentDefaultsProvider for application-wide defaults ([#2796](https://github.com/mittwald/flow/issues/2796)) ([c043f6c](https://github.com/mittwald/flow/commit/c043f6c89b2aa2bb669355014698e57cd81ea796))
|
|
11
|
+
|
|
12
|
+
# [0.2.0-alpha.1004](https://github.com/mittwald/flow/compare/0.2.0-alpha.1003...0.2.0-alpha.1004) (2026-08-06)
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **components:** make third-party style overrides work in the layered stylesheet ([#2799](https://github.com/mittwald/flow/issues/2799)) ([ab20016](https://github.com/mittwald/flow/commit/ab2001688a279dc0194845f0da53342db12a574b))
|
|
17
|
+
|
|
6
18
|
# [0.2.0-alpha.1003](https://github.com/mittwald/flow/compare/0.2.0-alpha.1002...0.2.0-alpha.1003) (2026-08-06)
|
|
7
19
|
|
|
8
20
|
### Bug Fixes
|
package/MIGRATION.md
CHANGED
|
@@ -1,5 +1,46 @@
|
|
|
1
1
|
# Migrations
|
|
2
2
|
|
|
3
|
+
## From version `0.2.0-alpha.1004` to `>=0.2.0-alpha.1005`
|
|
4
|
+
|
|
5
|
+
### Closing a Modal with unsaved changes is confirmed by default
|
|
6
|
+
|
|
7
|
+
A `Modal` that contains a react-hook-form `<Form>` now asks for confirmation
|
|
8
|
+
before it closes while the form is _dirty_ — previously this required the
|
|
9
|
+
`requireCloseModalConfirmationOnUnsavedChanges` flag. After a successful submit
|
|
10
|
+
or a `form.reset()` the modal closes right away, and actions in the
|
|
11
|
+
`<ActionGroup />` as well as the close button in the heading still close it
|
|
12
|
+
immediately.
|
|
13
|
+
|
|
14
|
+
Nothing to do if you had the flag enabled. To keep the previous behavior, switch
|
|
15
|
+
the default off (see below).
|
|
16
|
+
|
|
17
|
+
### `flags` is replaced by the ComponentDefaultsProvider
|
|
18
|
+
|
|
19
|
+
The global `flags` object is deprecated. Application-wide defaults are defined
|
|
20
|
+
with the `<ComponentDefaultsProvider />` instead, which additionally works per
|
|
21
|
+
subtree:
|
|
22
|
+
|
|
23
|
+
```diff
|
|
24
|
+
- import { flags } from "@mittwald/flow-react-components";
|
|
25
|
+
-
|
|
26
|
+
- flags.requireCloseModalConfirmationOnUnsavedChanges = false;
|
|
27
|
+
- flags.disableInitialListSuspenseBoundaries = true;
|
|
28
|
+
+ import { ComponentDefaultsProvider } from "@mittwald/flow-react-components";
|
|
29
|
+
+
|
|
30
|
+
+ <ComponentDefaultsProvider
|
|
31
|
+
+ defaults={{
|
|
32
|
+
+ Form: { confirmModalCloseOnUnsavedChanges: false },
|
|
33
|
+
+ List: { disableInitialSuspenseBoundary: true },
|
|
34
|
+
+ }}
|
|
35
|
+
+ >
|
|
36
|
+
+ <App />
|
|
37
|
+
+ </ComponentDefaultsProvider>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Assigning a flag keeps working — it acts as the application-wide default below
|
|
41
|
+
the provider and logs a deprecation warning — but the flags will be removed in a
|
|
42
|
+
future release.
|
|
43
|
+
|
|
3
44
|
## From version `0.2.0-alpha.779` to `>=0.2.0-alpha.780`
|
|
4
45
|
|
|
5
46
|
### CartesianChart
|
package/PATTERNS.md
CHANGED
|
@@ -503,9 +503,29 @@ and consistency enforced by tooling, not maintained by hand.
|
|
|
503
503
|
- ✓ styling genuinely depends on rendered composition.
|
|
504
504
|
- ✗ the condition exists as state/props → apply a class.
|
|
505
505
|
- **Global `:global()` third-party** — target embedded third-party DOM under the
|
|
506
|
-
root. `src/components/CodeEditor/CodeEditor.module.scss:
|
|
506
|
+
root. `src/components/CodeEditor/CodeEditor.module.scss:47`
|
|
507
507
|
- ✓ scoped styles must reach third-party widget classes.
|
|
508
508
|
- ✗ Flow-owned elements → module classes/contextual styling.
|
|
509
|
+
- **Unlayered escape hatch (`@layer flow.unlayered`)** — take a third-party
|
|
510
|
+
override out of every cascade layer.
|
|
511
|
+
`src/components/CodeEditor/CodeEditor.module.scss:44`
|
|
512
|
+
- ✓ the library injects its own stylesheet at runtime and its declarations
|
|
513
|
+
would otherwise win: unlayered CSS beats layered CSS regardless of
|
|
514
|
+
specificity, so a layered override never applies in `all-layered.css`.
|
|
515
|
+
Confirmed injectors: CodeMirror, react-easy-crop, FontAwesome
|
|
516
|
+
(`autoAddCss`).
|
|
517
|
+
- ✗ the library sets **inline styles** → no layer helps; ✗ it only sets SVG
|
|
518
|
+
presentation attributes → author CSS already wins, no hatch needed
|
|
519
|
+
(`recharts` ships no CSS at all); ✗ Flow-owned classes → the
|
|
520
|
+
`flow/unlayered-third-party-only` lint rule rejects it, because the marker
|
|
521
|
+
costs consumers the layer-based overridability of that rule.
|
|
522
|
+
- Prefer one block per component at the end of the file; mark at the leaf only
|
|
523
|
+
where a block would duplicate scaffolding, e.g. rules inside a Sass mixin
|
|
524
|
+
(`src/components/Icon/Icon.module.scss:24`).
|
|
525
|
+
- Mark the whole override block, not single declarations — a dependency can
|
|
526
|
+
add a colliding declaration in any patch release.
|
|
527
|
+
- Rationale and build mechanics:
|
|
528
|
+
[ADR 0001, Amendment 2026-08-05](../../docs/adr/0001-css-cascade-layers-in-the-stylesheet.md#amendment-2026-08-05--unlayered-escape-hatch-for-third-party-css).
|
|
509
529
|
- **Global `.flow--…` descendant selectors** `[undocumented]` — coordinate
|
|
510
530
|
independently rendered descendants.
|
|
511
531
|
`src/components/LayoutCard/LayoutCard.module.scss:16`
|