@mittwald/flow-react-components 1.2.0-next.2 → 1.2.0-next.20
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/MIGRATION.md +160 -8
- package/dist/assets/component-index.json +1 -1
- package/dist/assets/doc-properties.json +1 -1
- package/dist/css/all-layered.css +1 -1
- package/dist/css/all.css +1 -1
- package/dist/js/_virtual/_10.locale.mjs +3 -9
- package/dist/js/_virtual/_11.locale.mjs +9 -3
- package/dist/js/_virtual/_12.locale.mjs +3 -9
- package/dist/js/_virtual/_4.locale.mjs +9 -3
- package/dist/js/_virtual/_5.locale.mjs +3 -21
- package/dist/js/_virtual/_6.locale.mjs +21 -3
- package/dist/js/_virtual/_7.locale.mjs +3 -3
- package/dist/js/_virtual/_8.locale.mjs +3 -3
- package/dist/js/_virtual/_9.locale.mjs +3 -3
- package/dist/js/default.mjs +6 -5
- package/dist/js/packages/components/src/components/Badge/Badge.mjs +21 -2
- package/dist/js/packages/components/src/components/Badge/Badge.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Badge/Badge.module.mjs +3 -1
- package/dist/js/packages/components/src/components/Badge/Badge.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Badge/components/ContextualHelpButton/ContextualHelpButton.mjs +25 -0
- package/dist/js/packages/components/src/components/Badge/components/ContextualHelpButton/ContextualHelpButton.mjs.map +1 -0
- package/dist/js/packages/components/src/components/Calendar/components/RangeCalendar/helpers/useCalendarDateRangePresets.mjs +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs +34 -26
- package/dist/js/packages/components/src/components/CartesianChart/CartesianChart.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs +40 -0
- package/dist/js/packages/components/src/components/CartesianChart/components/Bar/Bar.mjs.map +1 -0
- package/dist/js/packages/components/src/components/CartesianChart/components/ChartTooltip/TooltipProgressBar.mjs +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/XAxis/XAxis.mjs +3 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/XAxis/XAxis.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs +2 -1
- package/dist/js/packages/components/src/components/CartesianChart/components/YAxis/YAxis.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CartesianChart/context.mjs +11 -0
- package/dist/js/packages/components/src/components/CartesianChart/context.mjs.map +1 -0
- package/dist/js/packages/components/src/components/CartesianChart/types.mjs.map +1 -1
- package/dist/js/packages/components/src/components/CodeBlock/CodeBlock.mjs +1 -1
- package/dist/js/packages/components/src/components/ComboBox/ComboBox.mjs +1 -1
- package/dist/js/packages/components/src/components/ContextualHelp/components/ContextualHelpTrigger/ContextualHelpTrigger.mjs +1 -1
- package/dist/js/packages/components/src/components/CopyButton/CopyButton.mjs +1 -1
- package/dist/js/packages/components/src/components/Heading/Heading.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Label/Label.mjs +1 -1
- package/dist/js/packages/components/src/components/LightBox/LightBox.mjs +1 -1
- package/dist/js/packages/components/src/components/Link/Link.module.mjs +2 -2
- package/dist/js/packages/components/src/components/Link/Link.module.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Footer/components/ShowNextBatchButton/ShowNextBatchButton.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/ActiveFilters/ActiveFilters.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/AllFiltersModal.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionDateRange.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/AllFiltersModal/FilterAccordionRadioGroup.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/FilterContextMenu/DateRangeFilterPopover.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/SortingContextMenu/SortingContextMenu.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Header/components/ViewModeContextMenu/ViewModeContextMenu.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/Item.mjs.map +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/components/AccordionButton.mjs +1 -1
- package/dist/js/packages/components/src/components/List/components/Items/components/Item/components/OptionsButton/OptionsButton.mjs +1 -1
- package/dist/js/packages/components/src/components/List/model/item/ItemView.mjs +7 -0
- package/dist/js/packages/components/src/components/List/model/item/ItemView.mjs.map +1 -1
- package/dist/js/packages/components/src/components/Modal/Modal.mjs +1 -1
- package/dist/js/packages/components/src/components/PasswordCreationField/components/ValidationResultButton/ValidationResultButton.mjs +1 -1
- package/dist/js/packages/components/src/components/ProgressBar/components/ProgressBarValue.mjs +1 -1
- package/dist/js/packages/components/src/components/SegmentedControl/components/Segment/Segment.mjs +2 -1
- package/dist/js/packages/components/src/components/SegmentedControl/components/Segment/Segment.mjs.map +1 -1
- package/dist/js/packages/components/src/views/ContextualHelpTriggerView.mjs +16 -0
- package/dist/js/packages/components/src/views/ContextualHelpTriggerView.mjs.map +1 -0
- package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs +6 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-dark.mjs.map +1 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs +6 -1
- package/dist/js/packages/design-tokens/dist/json-runtime/all-light.mjs.map +1 -1
- package/dist/types/components/Badge/Badge.browser.test.d.ts +2 -0
- package/dist/types/components/Badge/Badge.browser.test.d.ts.map +1 -0
- package/dist/types/components/Badge/Badge.d.ts.map +1 -1
- package/dist/types/components/Badge/components/ContextualHelpButton/ContextualHelpButton.d.ts +14 -0
- package/dist/types/components/Badge/components/ContextualHelpButton/ContextualHelpButton.d.ts.map +1 -0
- package/dist/types/components/Badge/components/ContextualHelpButton/index.d.ts +3 -0
- package/dist/types/components/Badge/components/ContextualHelpButton/index.d.ts.map +1 -0
- package/dist/types/components/Badge/stories/Default.stories.d.ts +1 -0
- package/dist/types/components/Badge/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/CartesianChart/CartesianChart.d.ts +12 -1
- package/dist/types/components/CartesianChart/CartesianChart.d.ts.map +1 -1
- package/dist/types/components/CartesianChart/components/Bar/Bar.d.ts +19 -0
- package/dist/types/components/CartesianChart/components/Bar/Bar.d.ts.map +1 -0
- package/dist/types/components/CartesianChart/components/Bar/index.d.ts +3 -0
- package/dist/types/components/CartesianChart/components/Bar/index.d.ts.map +1 -0
- package/dist/types/components/CartesianChart/components/Bar/view.d.ts +8 -0
- package/dist/types/components/CartesianChart/components/Bar/view.d.ts.map +1 -0
- package/dist/types/components/CartesianChart/components/XAxis/XAxis.d.ts.map +1 -1
- package/dist/types/components/CartesianChart/components/YAxis/YAxis.d.ts.map +1 -1
- package/dist/types/components/CartesianChart/context.d.ts +8 -0
- package/dist/types/components/CartesianChart/context.d.ts.map +1 -0
- package/dist/types/components/CartesianChart/index.d.ts +1 -0
- package/dist/types/components/CartesianChart/index.d.ts.map +1 -1
- package/dist/types/components/CartesianChart/stories/Default.stories.d.ts +4 -0
- package/dist/types/components/CartesianChart/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/CartesianChart/types.d.ts +6 -0
- package/dist/types/components/CartesianChart/types.d.ts.map +1 -1
- package/dist/types/components/DonutChart/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/List/components/Items/components/Item/Item.d.ts.map +1 -1
- package/dist/types/components/List/model/item/ItemView.d.ts +5 -0
- package/dist/types/components/List/model/item/ItemView.d.ts.map +1 -1
- package/dist/types/components/List/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/Modal/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/components/SegmentedControl/components/Segment/Segment.d.ts +2 -1
- package/dist/types/components/SegmentedControl/components/Segment/Segment.d.ts.map +1 -1
- package/dist/types/components/Select/stories/Default.stories.d.ts.map +1 -1
- package/dist/types/lib/theming/hooks/useDesignTokens.d.ts +6 -0
- package/dist/types/lib/theming/hooks/useDesignTokens.d.ts.map +1 -1
- package/dist/types/views/BarView.d.ts +5 -0
- package/dist/types/views/BarView.d.ts.map +1 -0
- package/package.json +9 -9
package/MIGRATION.md
CHANGED
|
@@ -21,6 +21,11 @@ performed, and re-running a codemod is a no-op.
|
|
|
21
21
|
It refuses to run on a dirty working tree (`--allow-dirty` overrides that) and
|
|
22
22
|
rewrites files in place, so review the diff afterwards.
|
|
23
23
|
|
|
24
|
+
Every command on this page is written with `npx`, because a generated file
|
|
25
|
+
cannot know your package manager. Substitute the equivalent if yours differs:
|
|
26
|
+
`pnpm dlx`, `yarn dlx` (Yarn Classic has no `dlx` — it uses `npx`), or `bun x`.
|
|
27
|
+
The CLI's own output does detect it and prints the right form.
|
|
28
|
+
|
|
24
29
|
---
|
|
25
30
|
|
|
26
31
|
<a id="use-design-tokens-build-metadata-removed"></a>
|
|
@@ -99,8 +104,16 @@ tracked the selection both go away.
|
|
|
99
104
|
```
|
|
100
105
|
|
|
101
106
|
**Setting a value.** The selection feeds a form or a setting. Use a
|
|
102
|
-
`RadioGroup`: each `Segment` becomes a `
|
|
103
|
-
`FieldDescription`, `FieldError`, the React
|
|
107
|
+
`RadioGroup`: each `Segment` becomes a `RadioButton`, everything else — `Label`,
|
|
108
|
+
`FieldDescription`, `FieldError`, `value`/`defaultValue`/`onChange`, the React
|
|
109
|
+
Hook Form binding — stays as it is.
|
|
110
|
+
|
|
111
|
+
This direction is a rename, not a restructure. The types line up:
|
|
112
|
+
`SegmentedControlProps` and `RadioGroupProps` both extend
|
|
113
|
+
`Omit<Aria.RadioGroupProps, "children">`, and `SegmentProps` and
|
|
114
|
+
`RadioButtonProps` are the same type (`RadioButtonProps` is declared as
|
|
115
|
+
`RadioProps`, which is identical to `SegmentProps`). Only
|
|
116
|
+
`containerBreakpointSize` has no counterpart — see the note at the end.
|
|
104
117
|
|
|
105
118
|
```diff
|
|
106
119
|
- <SegmentedControl defaultValue="debit">
|
|
@@ -108,15 +121,56 @@ tracked the selection both go away.
|
|
|
108
121
|
<Label>Zahlungsart</Label>
|
|
109
122
|
- <Segment value="debit">Lastschrift</Segment>
|
|
110
123
|
- <Segment value="invoice">Rechnung</Segment>
|
|
111
|
-
+ <
|
|
112
|
-
+ <
|
|
124
|
+
+ <RadioButton value="debit">Lastschrift</RadioButton>
|
|
125
|
+
+ <RadioButton value="invoice">Rechnung</RadioButton>
|
|
113
126
|
<FieldDescription>Jederzeit änderbar</FieldDescription>
|
|
114
127
|
- </SegmentedControl>
|
|
115
128
|
+ </RadioGroup>
|
|
116
129
|
```
|
|
117
130
|
|
|
118
|
-
|
|
119
|
-
|
|
131
|
+
**Always `RadioButton`, not `Radio`.** A `RadioGroup` also accepts a plain
|
|
132
|
+
`Radio`, and it takes the same props, so both would compile — but `RadioButton`
|
|
133
|
+
is the replacement for a `Segment`. The appearance still changes: `RadioButton`
|
|
134
|
+
does not reproduce the segmented control's joined row, which came from
|
|
135
|
+
`Segment`'s own `flex: 1` and collapsed borders. See the
|
|
136
|
+
[RadioGroup docs](https://flow.mittwald.de/components/form-controls/radio-group).
|
|
137
|
+
|
|
138
|
+
#### Three things the Tabs direction changes
|
|
139
|
+
|
|
140
|
+
**The controlled-state props are named differently.** `SegmentedControl` takes
|
|
141
|
+
`value` / `defaultValue` / `onChange` (it is a radio group); `Tabs` takes
|
|
142
|
+
`selectedKey` / `defaultSelectedKey` / `onSelectionChange`. Nothing carries over
|
|
143
|
+
by name here, unlike the `RadioGroup` direction.
|
|
144
|
+
|
|
145
|
+
**The group `Label`.** `SegmentedControl` is a form field — it wraps
|
|
146
|
+
react-aria's `RadioGroup` — so a `<Label>` inside it is a field label. `Tabs`
|
|
147
|
+
has no equivalent slot, and a tab list labels itself through its tab titles. The
|
|
148
|
+
`Label` therefore cannot move into `Tabs`, but its text has somewhere to go:
|
|
149
|
+
|
|
150
|
+
- into the surrounding `Section`'s `Heading`, when the group wants a visible
|
|
151
|
+
title
|
|
152
|
+
- into `aria-label` on `Tabs`, when it does not — that names the tab list for
|
|
153
|
+
screen readers without showing the name
|
|
154
|
+
- nowhere, when the surrounding heading already names the group
|
|
155
|
+
|
|
156
|
+
A `Label` on its own is **not** a signal that the usage was a `RadioGroup` case
|
|
157
|
+
— plenty of content switchers were authored with one, because the component
|
|
158
|
+
required a field label.
|
|
159
|
+
|
|
160
|
+
**Panels that register form fields.** Moving the switched-in content into a
|
|
161
|
+
`Tab` does not change when it mounts. `Tab` renders its panel with
|
|
162
|
+
`shouldForceMount` and wraps `Content` and `Section` in
|
|
163
|
+
`<Activity isActive={…}>`, so every tab's subtree is mounted and keeps its state
|
|
164
|
+
— an inactive tab is hidden, not unmounted. React Hook Form fields inside a tab
|
|
165
|
+
stay registered across a tab switch, exactly as they did as siblings below a
|
|
166
|
+
`SegmentedControl`.
|
|
167
|
+
|
|
168
|
+
There is no codemod, and the reason is the choice rather than the edit. Which
|
|
169
|
+
replacement is right cannot be decided from the source: a value-setting usage
|
|
170
|
+
and a content switcher look alike at the call site, and only the surrounding
|
|
171
|
+
intention separates them. The `RadioGroup` direction would be mechanical **once
|
|
172
|
+
that decision is made** — if you have many usages that all go that way, a
|
|
173
|
+
find-and-replace of `SegmentedControl`/`Segment` gets you most of it.
|
|
120
174
|
|
|
121
175
|
`SegmentedControl` and `Segment` (and the `flr-segmented-control` /
|
|
122
176
|
`flr-segment` remote elements) keep working unchanged and will be removed in a
|
|
@@ -128,8 +182,18 @@ their own when the available width runs out, and a `RadioGroup` stacks its
|
|
|
128
182
|
options anyway.
|
|
129
183
|
|
|
130
184
|
**Apply:** Replace `SegmentedControl` with `Tabs` when the selection switches
|
|
131
|
-
displayed content, or with `RadioGroup` when it sets a value. Pick per usage
|
|
132
|
-
|
|
185
|
+
displayed content, or with `RadioGroup` when it sets a value. Pick per usage.
|
|
186
|
+
The two directions cost very different amounts of work. Towards `RadioGroup` it
|
|
187
|
+
is a prop-compatible rename: `SegmentedControl` → `RadioGroup` and `Segment` →
|
|
188
|
+
`RadioButton` (always `RadioButton`, not `Radio`; it takes exactly `Segment`'s
|
|
189
|
+
props), with `value`/`defaultValue`/`onChange` and a `Label` child all carrying
|
|
190
|
+
over. Only `containerBreakpointSize` has no counterpart, and the joined row is
|
|
191
|
+
not reproduced. Towards `Tabs` it is structural: the state props are
|
|
192
|
+
`selectedKey`/`defaultSelectedKey` rather than `value`/`defaultValue`, there is
|
|
193
|
+
no `Label` slot (the group label moves to the surrounding `Heading`, or to
|
|
194
|
+
`aria-label` on `Tabs` when it should not be visible, or goes away), and the
|
|
195
|
+
switched panels move inside the tabs — where they stay mounted, so form fields
|
|
196
|
+
in them keep their registration.
|
|
133
197
|
|
|
134
198
|
---
|
|
135
199
|
|
|
@@ -353,6 +417,94 @@ npx @mittwald/flow-codemods@latest password-tools-subpath-renamed src
|
|
|
353
417
|
|
|
354
418
|
---
|
|
355
419
|
|
|
420
|
+
<a id="tabs-navigation-usage-to-tab-navigation"></a>
|
|
421
|
+
|
|
422
|
+
## Tabs restyled; navigation usage moves to TabNavigation
|
|
423
|
+
|
|
424
|
+
**Since `0.2.0-alpha.977`** · migration · manual change · also applies to
|
|
425
|
+
`@mittwald/flow-remote-react-components`
|
|
426
|
+
|
|
427
|
+
`Tabs` restyled: the tab list now fills the available width with equal-size tabs
|
|
428
|
+
and a shared, animated indicator that slides between them, instead of the
|
|
429
|
+
previous fit-content tabs that each carried their own hover/pressed/selected
|
|
430
|
+
background. Nothing else about `Tabs` changed — same props, same panels, same
|
|
431
|
+
collapsing behavior. If `Tabs` switches content within a page, there is nothing
|
|
432
|
+
to do; the new look applies on upgrade.
|
|
433
|
+
|
|
434
|
+
**Real navigation has a proper home now.** React Aria's `Tab` (which `TabTitle`
|
|
435
|
+
extends) accepts the same routing props as a plain link — `href`, `target`,
|
|
436
|
+
`routerOptions`, … — so a `Tabs` could always double as a navigation control:
|
|
437
|
+
give a `TabTitle` an `href` and selecting it pushed a real route change while
|
|
438
|
+
the row still looked and behaved like tabs otherwise. That usage only reached
|
|
439
|
+
for `Tabs` because nothing else looked right for it. Now there is
|
|
440
|
+
`TabNavigation`, introduced in the same version specifically for this case — and
|
|
441
|
+
it keeps the visual language the old `Tabs` used to have.
|
|
442
|
+
|
|
443
|
+
```diff
|
|
444
|
+
- <Tabs selectedKey={pathname}>
|
|
445
|
+
- <Tab id="/apps">
|
|
446
|
+
- <TabTitle href="/apps">Apps</TabTitle>
|
|
447
|
+
- </Tab>
|
|
448
|
+
- <Tab id="/container">
|
|
449
|
+
- <TabTitle href="/container">Container</TabTitle>
|
|
450
|
+
- </Tab>
|
|
451
|
+
- </Tabs>
|
|
452
|
+
+ <TabNavigation aria-label="Projekt-Navigation">
|
|
453
|
+
+ <Link href="/apps" aria-current={pathname === "/apps" ? "page" : undefined}>
|
|
454
|
+
+ Apps
|
|
455
|
+
+ </Link>
|
|
456
|
+
+ <Link
|
|
457
|
+
+ href="/container"
|
|
458
|
+
+ aria-current={pathname === "/container" ? "page" : undefined}
|
|
459
|
+
+ >
|
|
460
|
+
+ Container
|
|
461
|
+
+ </Link>
|
|
462
|
+
+ </TabNavigation>
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
#### What moves and what doesn't
|
|
466
|
+
|
|
467
|
+
**The children.** `Tab` / `TabTitle` / the panel disappear; `TabNavigation`
|
|
468
|
+
takes plain `Link` children directly. There is no panel, because the destination
|
|
469
|
+
page's content lives on that route, not inside the component.
|
|
470
|
+
|
|
471
|
+
**The active state.** `selectedKey` / `defaultSelectedKey` / `onSelectionChange`
|
|
472
|
+
have no counterpart — `TabNavigation` does not track selection itself. Each
|
|
473
|
+
`Link` marks itself current with `aria-current="page"`, which the app's router
|
|
474
|
+
already knows how to derive (e.g. from the current pathname), the same way it
|
|
475
|
+
would for any other navigation link.
|
|
476
|
+
|
|
477
|
+
**Status icons.** An `AlertIcon` moves from inside `TabTitle` to inside the
|
|
478
|
+
`Link`.
|
|
479
|
+
|
|
480
|
+
**Collapsing.** The two do this differently. `Tabs` collapses all at once: as
|
|
481
|
+
soon as any tab stops fitting, the whole tab list turns into a single button
|
|
482
|
+
showing the active tab, which opens every tab in a context menu. `TabNavigation`
|
|
483
|
+
collapses incrementally: links are hidden one by one as space runs out, and only
|
|
484
|
+
those that no longer fit move into the "More" button's menu — the rest stay
|
|
485
|
+
visible as ordinary links.
|
|
486
|
+
|
|
487
|
+
There is no codemod: only the surrounding code knows whether a given `Tabs`
|
|
488
|
+
usage was real navigation (an `href` on `TabTitle`, or a route push from
|
|
489
|
+
`onSelectionChange`) or a genuine content switcher that merely looked similar
|
|
490
|
+
before this change — the two are indistinguishable from the source alone.
|
|
491
|
+
|
|
492
|
+
**Apply:** Tabs' rendering changed: the tab list now fills the available width
|
|
493
|
+
with equal-size tabs and a shared, animated indicator that slides between them,
|
|
494
|
+
replacing the previous fit-content tabs that each carried their own
|
|
495
|
+
hover/pressed/selected background. Nothing else about `Tabs` changed, and a
|
|
496
|
+
`Tabs` that switches content within a page needs no code change — the new look
|
|
497
|
+
applies on upgrade. Where `Tabs` was used to fake real navigation instead — a
|
|
498
|
+
`TabTitle` given an `href` (`Aria.Tab`'s routing props: `href`, `target`,
|
|
499
|
+
`routerOptions`, …) so selecting it pushed a real route change — replace it with
|
|
500
|
+
`TabNavigation`: plain `Link` children instead of `Tab`/`TabTitle`/panels,
|
|
501
|
+
`aria-current="page"` on the active `Link` instead of
|
|
502
|
+
`selectedKey`/`defaultSelectedKey`/`onSelectionChange`. `TabNavigation` keeps
|
|
503
|
+
the visual language the old `Tabs` used to have, because it now owns that use
|
|
504
|
+
case.
|
|
505
|
+
|
|
506
|
+
---
|
|
507
|
+
|
|
356
508
|
<a id="table-column-width-props"></a>
|
|
357
509
|
|
|
358
510
|
## TableColumn: `maxWidth` removed, `width` and `minWidth` retyped
|