@helvetia-design/skills 0.1.0 → 0.2.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/package.json +4 -4
- package/sbom.cdx.json +14894 -16749
- package/skills/ds-migrate-from-baloise/SKILL.md +7 -5
- package/skills/ds-migrate-from-baloise/components/badge/migration.md +3 -3
- package/skills/ds-migrate-from-baloise/components/button/migration.md +20 -5
- package/skills/ds-migrate-from-baloise/components/carousel/migration.md +36 -24
- package/skills/ds-migrate-from-baloise/components/checkbox/migration.md +40 -28
- package/skills/ds-migrate-from-baloise/components/close/migration.md +3 -3
- package/skills/ds-migrate-from-baloise/components/content/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/date/migration.md +3 -2
- package/skills/ds-migrate-from-baloise/components/divider/migration.md +2 -2
- package/skills/ds-migrate-from-baloise/components/dropdown/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/field/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/form/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/input/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/input-slider/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/input-stepper/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/logo/migration.md +3 -1
- package/skills/ds-migrate-from-baloise/components/nav/migration.md +94 -0
- package/skills/ds-migrate-from-baloise/components/number-input/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/popover/migration.md +167 -0
- package/skills/ds-migrate-from-baloise/components/popup/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/radio/migration.md +38 -25
- package/skills/ds-migrate-from-baloise/components/segment/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/select/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/snackbar/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/stage/migration.md +90 -0
- package/skills/ds-migrate-from-baloise/components/steps/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/table/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/tabs/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/tag/migration.md +4 -3
- package/skills/ds-migrate-from-baloise/components/text/migration.md +3 -3
- package/skills/ds-migrate-from-baloise/components/textarea/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/components/time-input/migration.md +1 -1
- package/skills/ds-migrate-from-baloise/scripts/detect-baloise.mjs +2 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-accordion.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-app.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-badge.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-button.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-card.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-carousel.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-checkbox.mjs +10 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-close.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-content.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-data.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-date.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-divider.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-dropdown.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-field.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-file-upload.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-footer.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-form.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-heading.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-hint.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-icon.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-input-slider.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-input-stepper.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-input.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-label.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-list.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-logo.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-modal.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-nav.mjs +72 -0
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-navbar.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-notification.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-number-input.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-pagination.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-popover.mjs +72 -0
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-popup.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-progress-bar.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-radio.mjs +10 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-segment.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-select.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-shape.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-sheet.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-snackbar.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-spinner.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-stack.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-stage.mjs +72 -0
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-steps.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-table.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-tabs.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-tag.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-text.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-textarea.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-time-input.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-toast.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-bal-tooltip.mjs +3 -2
- package/skills/ds-migrate-from-baloise/scripts/scan-cleanup.mjs +18 -6
- package/skills/ds-migrate-from-baloise/scripts/scan-css-utils.mjs +61 -5
- package/skills/ds-migrate-from-baloise/scripts/scan-migratable.mjs +35 -8
- package/skills/ds-migrate-from-baloise/scripts/source-scan.mjs +34 -15
- package/skills/ds-migrate-from-baloise/shared/batch.md +2 -2
- package/skills/ds-migrate-from-baloise/shared/cleanup.md +6 -5
- package/skills/ds-migrate-from-baloise/shared/css-utils-map.json +2 -1
- package/skills/ds-migrate-from-baloise/shared/css-utils.md +8 -8
- package/skills/ds-migrate-from-baloise/shared/field.md +2 -2
- package/skills/ds-migrate-from-baloise/shared/legacy-config.md +1 -1
|
@@ -115,7 +115,7 @@ Both tags emit the same five events, and both new components add `dsClick`.
|
|
|
115
115
|
|
|
116
116
|
Rewrite only handlers that are attached to the element being migrated. `balChange`, `balInput`, `balBlur`, and `balFocus` are emitted by many other legacy components, so never rewrite a handler on another element, and never rename them by search and replace across the file.
|
|
117
117
|
|
|
118
|
-
Retype handler parameters and refs as `SKILL.md` "Legacy types and bundles" describes. On a `ds-input`, `BalEvents.BalInput*` and `BalInputCustomEvent` become `DsInputCustomEvent`. On a `ds-datepicker`, `BalEvents.BalInputDate*` and `BalInputDateCustomEvent` become `DsDatepickerCustomEvent`. Write a detail alias such as `BalEvents.BalInputChangeDetail` out as the new detail type, `string | null` for `dsChange` and `dsInput`. `HTMLBalInputElement` becomes `HTMLDsInputElement`, and `HTMLBalInputDateElement` becomes `HTMLDsDatepickerElement`. `HTMLBalInputGroupElement` and `BalProps.BalInputGroup*` have no target. Leave them in place. The scan lists the `BalEvents.*` and `Bal*CustomEvent` types. It does not list `BalProps
|
|
118
|
+
Retype handler parameters and refs as `SKILL.md` "Legacy types and bundles" describes. On a `ds-input`, `BalEvents.BalInput*` and `BalInputCustomEvent` become `DsInputCustomEvent`. On a `ds-datepicker`, `BalEvents.BalInputDate*` and `BalInputDateCustomEvent` become `DsDatepickerCustomEvent`. Write a detail alias such as `BalEvents.BalInputChangeDetail` out as the new detail type, `string | null` for `dsChange` and `dsInput`. `HTMLBalInputElement` becomes `HTMLDsInputElement`, and `HTMLBalInputDateElement` becomes `HTMLDsDatepickerElement`. `HTMLBalInputGroupElement` and `BalProps.BalInputGroup*` have no target. Leave them in place. The scan lists the `BalEvents.*` and `Bal*CustomEvent` types. It lists the `HTMLBal*Element` types too. It does not list `BalProps.*`, so search for them yourself in each file with a finding.
|
|
119
119
|
|
|
120
120
|
When the value in `balChange` or `balInput` is read, note that it is `string | undefined` in legacy and `string | null` in the new components. A cleared field now yields `null`. Do not edit the handler, report it.
|
|
121
121
|
|
|
@@ -65,7 +65,7 @@ Edit each finding yourself, using the mapping below. Read the whole element when
|
|
|
65
65
|
|
|
66
66
|
Rewrite only handlers that are attached to the element being migrated. `balChange`, `balInput`, `balBlur`, and `balFocus` are emitted by many other legacy components, so never rewrite a handler on another element, and never rename them by search and replace across the file.
|
|
67
67
|
|
|
68
|
-
Retype handler parameters and refs as `SKILL.md` "Legacy types and bundles" describes. `BalEvents.BalInputSlider*` and `BalInputSliderCustomEvent` become `DsSliderCustomEvent`, because the type follows the new tag `ds-slider`. Write a detail alias such as `BalEvents.BalInputSliderChangeDetail` out as the new detail type, `number` for `dsChange` and `dsInput`. `HTMLBalInputSliderElement` becomes `HTMLDsSliderElement`. The scan lists the `BalEvents.*` and `Bal*CustomEvent` types. It does not list `BalProps
|
|
68
|
+
Retype handler parameters and refs as `SKILL.md` "Legacy types and bundles" describes. `BalEvents.BalInputSlider*` and `BalInputSliderCustomEvent` become `DsSliderCustomEvent`, because the type follows the new tag `ds-slider`. Write a detail alias such as `BalEvents.BalInputSliderChangeDetail` out as the new detail type, `number` for `dsChange` and `dsInput`. `HTMLBalInputSliderElement` becomes `HTMLDsSliderElement`. The scan lists the `BalEvents.*` and `Bal*CustomEvent` types. It lists the `HTMLBal*Element` types too. It does not list `BalProps.*`, so search for them yourself in each file with a finding.
|
|
69
69
|
|
|
70
70
|
When the value in `balChange` or `balInput` is read, note that it was `string | number | null` in legacy and is always a `number` in `ds-slider`. Do not edit the handler, report it.
|
|
71
71
|
|
|
@@ -59,7 +59,7 @@ Edit each finding yourself, using the mapping below. Read the whole element when
|
|
|
59
59
|
|
|
60
60
|
Rewrite only handlers that are attached to the element being migrated. `balChange`, `balInput`, `balBlur`, and `balFocus` are emitted by many other legacy components, so never rewrite a handler on another element, and never rename them by search and replace across the file.
|
|
61
61
|
|
|
62
|
-
Retype handler parameters and refs as `SKILL.md` "Legacy types and bundles" describes. `BalEvents.BalInputStepper*` and `BalInputStepperCustomEvent` become `DsCounterCustomEvent`, because the type follows the new tag `ds-counter`. Write a detail alias such as `BalEvents.BalInputStepperChangeDetail` out as the new detail type, `number` for `dsChange`, `dsInput`, `dsIncrease` and `dsDecrease`. `HTMLBalInputStepperElement` becomes `HTMLDsCounterElement`. The scan lists the `BalEvents.*` and `Bal*CustomEvent` types. It does not list `BalProps
|
|
62
|
+
Retype handler parameters and refs as `SKILL.md` "Legacy types and bundles" describes. `BalEvents.BalInputStepper*` and `BalInputStepperCustomEvent` become `DsCounterCustomEvent`, because the type follows the new tag `ds-counter`. Write a detail alias such as `BalEvents.BalInputStepperChangeDetail` out as the new detail type, `number` for `dsChange`, `dsInput`, `dsIncrease` and `dsDecrease`. `HTMLBalInputStepperElement` becomes `HTMLDsCounterElement`. The scan lists the `BalEvents.*` and `Bal*CustomEvent` types. It lists the `HTMLBal*Element` types too. It does not list `BalProps.*`, so search for them yourself in each file with a finding.
|
|
63
63
|
|
|
64
64
|
Do not edit handler bodies. Report these detail changes so the consumer can check them:
|
|
65
65
|
|
|
@@ -36,7 +36,9 @@ Edit each finding yourself, using the mapping below. Read the whole element when
|
|
|
36
36
|
|
|
37
37
|
| old (`bal-logo`) | new (`ds-logo`) | handling |
|
|
38
38
|
| --- | --- | --- |
|
|
39
|
-
| `color="
|
|
39
|
+
| `color` omitted, `color=""`, `color="blue"` | omit `color` | Drop `color`. `ds-logo` has no `color` prop and renders `primary` by default. Also drop `color='blue'`, `color={"blue"}`, and `color={'blue'}`. |
|
|
40
|
+
| `color="white"` | `inverted` | HTML and Angular: write `inverted="true"`. React: write `inverted`. Also rewrite `color='white'`, `color={"white"}`, and `color={'white'}`. When `inverted` is already present, drop `color` and keep a single `inverted`. Do **not** write `color="inverted"`: `ds-logo` has no `color` prop. |
|
|
41
|
+
| `[color]="x"`, `[attr.color]="x"`, `color={x}` | `inverted` | Dynamic value. Do not generate a comparison expression. `inverted` is a boolean, so the value type differs. HTML: leave the binding unchanged and list the file and line for manual review. React and Angular: apply Unmapped props and handlers (`SKILL.md`). The report says that `color="white"` is now `inverted` set to true. |
|
|
40
42
|
| `size="small"` | `size="sm"` | Rewrite the static value `small` to `sm`. Drop `size=""`, since an omitted `size` is the responsive default on both sides. A binding (`[size]`, `size={x}`): HTML keeps it and flags it, because the value set is different. React and Angular keep it when the expression's type only admits `sm` or `lg`. Otherwise apply Unmapped props and handlers (`SKILL.md`). |
|
|
41
43
|
| `brand` | `brand` | Copy `baloise`, `helvetia` and bindings as-is. Drop `brand=""`, since an omitted `brand` follows the app config on both sides. |
|
|
42
44
|
| `animated` | `animated` | Copy as-is, including bindings. |
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# nav (report only)
|
|
2
|
+
|
|
3
|
+
Report every `bal-nav` usage. This migration rewrites nothing. It lists every usage in `ds-migration-report.md` with the reason and the suggested replacement, so the consumer can rebuild the header by hand.
|
|
4
|
+
|
|
5
|
+
`bal-nav` is configured by JSON props: `options` (`BalProps.BalNavOptions`), `logo` (`BalProps.BalNavLogoLink`) and `buttons` (`BalProps.BalNavMetaButtons`). From them it renders a meta bar, a menu bar and flyouts with link grids. `ds-app-navbar` has only the slots `brand`, `title`, `menu-start`, `menu-end` and `actions`. It has no meta bar, no flyout and no link grid. An automatic rewrite would lose the whole navigation, so the skill only reports it.
|
|
6
|
+
|
|
7
|
+
The legacy folder has seven child tags that `bal-nav` renders itself: `bal-nav-link`, `bal-nav-link-grid`, `bal-nav-link-grid-col`, `bal-nav-link-group`, `bal-nav-menu-bar`, `bal-nav-menu-flyout` and `bal-nav-meta-bar`. An app rarely writes them, but the scan lists them when it does.
|
|
8
|
+
|
|
9
|
+
The scan lists the root, the seven child tags, and the React and Angular symbols `BalNav`, `BalNavLink`, `BalNavLinkGrid`, `BalNavLinkGridCol`, `BalNavLinkGroup`, `BalNavMenuBar`, `BalNavMenuFlyout` and `BalNavMetaBar`. It lists `HTMLBalNav*Element` types too. It does not match `bal-navbar`, `BalNavbar*` or the `balNavigate` event. Those belong to the `navbar` migration and other components. It does not match the ambient `BalProps.BalNav*` and `BalEvents.BalNav*` types. Search for them yourself in each file with a finding.
|
|
10
|
+
|
|
11
|
+
This migration edits no source file. `SKILL.md` says how the icon and legacy config rules apply to a report-only migration.
|
|
12
|
+
|
|
13
|
+
## 1. Scan
|
|
14
|
+
|
|
15
|
+
`<project-root>` is the consumer project root that contains the app lockfile. When the skill is invoked from that root, use the current directory.
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
node <this-skill-directory>/scripts/scan-bal-nav.mjs <project-root>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The script prints one JSON object. `total` is the number of findings. `files` groups them by path. Each finding has `line` and `snippet`.
|
|
22
|
+
|
|
23
|
+
Show that list to the user grouped by file (path, line, snippet) and end with the total count. Say that no `ds-*` component replaces `bal-nav`, and that the next step only writes report entries.
|
|
24
|
+
|
|
25
|
+
Done when the user has seen every finding and the total. If `total` is 0, say there are no `bal-nav` usages to report and stop.
|
|
26
|
+
|
|
27
|
+
## 2. Confirm
|
|
28
|
+
|
|
29
|
+
Ask for one yes/no: write a report entry for every listed usage? No source file is edited.
|
|
30
|
+
|
|
31
|
+
On no, stop with the files unchanged.
|
|
32
|
+
|
|
33
|
+
On yes, continue.
|
|
34
|
+
|
|
35
|
+
Done when the user has answered.
|
|
36
|
+
|
|
37
|
+
## 3. Rewrite
|
|
38
|
+
|
|
39
|
+
Nothing is rewritten. Every `bal-nav`, its child tags, its imports and its types stay as they are. For every finding, read the whole element and collect what the report needs: the file and line, where the `options`, `logo` and `buttons` values come from, and every `balNavItemClick` handler.
|
|
40
|
+
|
|
41
|
+
Angular splits a component across `x.component.html` and `x.component.ts`, and the class file often calls `configChanged()` through `@ViewChild` or `viewChild`, or holds the `balNavItemClick` handler, without ever naming the tag, so the scan cannot see it. For every `.html` finding, open the same-basename `.ts` file beside it and check it for `configChanged()` calls and for a `balNavItemClick` handler. React and plain HTML callers hold the element in a ref or a query result, so look for calls on that variable in the same file.
|
|
42
|
+
|
|
43
|
+
### Suggested replacement
|
|
44
|
+
|
|
45
|
+
Rebuild the header by hand with `ds-app-navbar`:
|
|
46
|
+
|
|
47
|
+
- Put the logo link into the `brand` slot, as `<a slot="brand" href="…">` around a `ds-logo`.
|
|
48
|
+
- Put the top-level links from `options` into `<div slot="menu-start">` or `<div slot="menu-end">`, as plain `<a>` links.
|
|
49
|
+
- Put the meta buttons from `buttons` into the `actions` slot.
|
|
50
|
+
- Flyouts and link grids have no `ds-*` equivalent. Link to an overview page instead, or build the flyout as an app component.
|
|
51
|
+
- Move tracking from `balNavItemClick` to `click` listeners on the rebuilt links.
|
|
52
|
+
|
|
53
|
+
`components/navbar/migration.md` shows the `ds-app-navbar` markup, the imports and the slot names.
|
|
54
|
+
|
|
55
|
+
### Props, children and events
|
|
56
|
+
|
|
57
|
+
| old (`bal-nav`) | suggested `ds-*` building block | handling |
|
|
58
|
+
| --- | --- | --- |
|
|
59
|
+
| `logo` | `<a slot="brand">` with `ds-logo` | Report it. Take `href`, `target` and `ariaLabel` from the object. |
|
|
60
|
+
| `options` | `<div slot="menu-start">` with plain `<a>` links | Report it. Each top-level item becomes one link. `mainLinkItems`, `sectionLinkItems` and `serviceLinkItems` have no target. |
|
|
61
|
+
| `buttons` | `actions` slot with `ds-button` elements | Report it. A button with `popupId` opened a `bal-popup`. Name that popup in the report. |
|
|
62
|
+
| `bal-nav-meta-bar` | `ds-app-navbar` | Report it. The meta bar and the menu bar collapse into one bar. |
|
|
63
|
+
| `bal-nav-menu-bar` | `menu-start` / `menu-end` slots | Report it. |
|
|
64
|
+
| `bal-nav-menu-flyout`, `bal-nav-link-grid`, `bal-nav-link-grid-col`, `bal-nav-link-group` | _(none)_ | Report it. The consumer builds the flyout or links to an overview page. |
|
|
65
|
+
| `bal-nav-link` | plain `<a>` | Report it. |
|
|
66
|
+
| `balNavItemClick` | `click` listener on each rebuilt link | Report it with its handler. The detail held `label`, `value`, `href`, `rel`, `data` and `target` of the clicked item. |
|
|
67
|
+
| `configChanged()` | _(none)_ | Report it. `ds-app-navbar` reads the `ds-root` config itself. |
|
|
68
|
+
|
|
69
|
+
### Tags and imports
|
|
70
|
+
|
|
71
|
+
- **HTML**: `<bal-nav>` stays.
|
|
72
|
+
- **Angular**: `<bal-nav>` stays in the template, and `BalNav` stays in the `@baloise/ds-angular` import and in `imports: [...]`.
|
|
73
|
+
- **React**: `<BalNav>` stays, and `BalNav` stays in the `@baloise/ds-react` import.
|
|
74
|
+
|
|
75
|
+
While a `bal-nav` is left, **Detect** keeps suggesting `nav`, the legacy config call stays, and **Cleanup** stays `incomplete`. They clear once the consumer has rebuilt the header and removed `bal-nav`.
|
|
76
|
+
|
|
77
|
+
## 4. Report
|
|
78
|
+
|
|
79
|
+
Write the report as `shared/report.md` describes, with the per-file summary under Files changed. Files changed lists no file, because this migration edits none. Every item below gets its own line in the coverage checklist, found or none found.
|
|
80
|
+
|
|
81
|
+
Needs your attention when found:
|
|
82
|
+
|
|
83
|
+
1. Every `bal-nav`, not migrated. Name file and line, say that `ds-app-navbar` has no meta bar, flyout or link grid, and give the suggested replacement from the Rewrite step.
|
|
84
|
+
2. Every `options`, `logo` and `buttons` value, with the file and line of the object or binding it comes from, as the input for the rebuild.
|
|
85
|
+
3. Every `buttons` entry with `popupId`, with the popup it opens.
|
|
86
|
+
4. Every `balNavItemClick` handler, with the suggestion to move the tracking to `click` listeners on the rebuilt links.
|
|
87
|
+
5. Every child tag written by the app, not migrated, with its suggested building block from the table.
|
|
88
|
+
6. Every `BalNav*` symbol, `HTMLBalNav*Element` type and `BalProps.BalNav*` or `BalEvents.BalNav*` type. They stay until the rebuild and keep **Detect** and **Cleanup** listing `nav`.
|
|
89
|
+
7. Every selector in the project's own styles that targets `bal-nav` or a `bal-nav__*` class. It stops matching once the header is rebuilt.
|
|
90
|
+
8. One-time note, when at least one `bal-nav` is left: **Cleanup** stays `incomplete` and the legacy config call stays until the consumer has rebuilt the header by hand.
|
|
91
|
+
|
|
92
|
+
Leave every change unstaged for the consumer to review, including `ds-migration-report.md`. Stop. Do not run `git add` or `git commit`.
|
|
93
|
+
|
|
94
|
+
Done when every numbered item has its line in `ds-migration-report.md`, the chat shows only the attention items and the pointer line, and the working tree is still unstaged.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Migrate every `bal-number-input` usage to `ds-number-input`. Init has already added the `@helvetia-design/*` packages. This task rewrites usages only.
|
|
4
4
|
|
|
5
|
-
The scan lists the `bal-number-input` tag, the React and Angular symbol `BalNumberInput`, and the `BalEvents.BalNumberInput*` and `BalNumberInputCustomEvent` types. It
|
|
5
|
+
The scan lists the `bal-number-input` tag, the React and Angular symbol `BalNumberInput`, and the `BalEvents.BalNumberInput*` and `BalNumberInputCustomEvent` types. It lists the `HTMLBalNumberInputElement` type too. It does not match `BalProps.BalNumberInputInterface`. Search for it yourself in each file with a finding. `SKILL.md` "Legacy types and bundles" says how to rewrite all of them.
|
|
6
6
|
|
|
7
7
|
The legacy component has no slots. `ds-number-input` adds a default slot and an `invalid-text` slot. Nothing to migrate, leave them unused.
|
|
8
8
|
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# popover → popup
|
|
2
|
+
|
|
3
|
+
Migrate every `bal-popover` usage to `ds-popup`. Init has already added the `@helvetia-design/*` packages. This task rewrites usages only.
|
|
4
|
+
|
|
5
|
+
`bal-popover` wraps its trigger and its content. The trigger is any child element with the attribute `bal-popover-trigger`, and the content is the child tag `bal-popover-content`. `ds-popup` is the content panel alone. It sits next to its trigger, and the trigger names it with `data-popup="<id>"`. So the migration unwraps `bal-popover`, keeps the trigger where it is, and turns `bal-popover-content` into the `ds-popup`.
|
|
6
|
+
|
|
7
|
+
The scan lists the tags `bal-popover` and `bal-popover-content`, the `bal-popover-trigger` attribute, the React and Angular symbols `BalPopover` and `BalPopoverContent`, and the `HTMLBalPopoverElement` and `HTMLBalPopoverContentElement` types. It does not match `bal-popup` or `BalPopup`, which belong to the `popup` migration. It does not match the ambient `BalProps.BalPopover*` and `BalEvents.BalPopover*` types or the bare `BalPopoverCustomEvent`. Those are Report items, not rewrites. Search for them yourself in each file with a finding.
|
|
8
|
+
|
|
9
|
+
The legacy `@baloise/ds-angular` has no `BalPopoverBundle`. The multi-family `BalComponentBundle` holds `BalPopover` and follows the shared bundle rule in `SKILL.md` "Legacy types and bundles".
|
|
10
|
+
|
|
11
|
+
## 1. Scan
|
|
12
|
+
|
|
13
|
+
`<project-root>` is the consumer project root that contains the app lockfile. When the skill is invoked from that root, use the current directory.
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
node <this-skill-directory>/scripts/scan-bal-popover.mjs <project-root>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The script prints one JSON object. `total` is the number of findings. `files` groups them by path. Each finding has `line` and `snippet`.
|
|
20
|
+
|
|
21
|
+
Show that list to the user grouped by file (path, line, snippet) and end with the total count. Read every `bal-popover` before you show the list, and mark each one that stays legacy because of `tooltip` (see "Popovers left legacy").
|
|
22
|
+
|
|
23
|
+
Done when the user has seen every finding and the total. If `total` is 0, say there are no `bal-popover` usages to migrate and stop.
|
|
24
|
+
|
|
25
|
+
## 2. Confirm
|
|
26
|
+
|
|
27
|
+
Ask for one yes/no: rewrite every listed usage?
|
|
28
|
+
|
|
29
|
+
On no, stop with the files unchanged.
|
|
30
|
+
|
|
31
|
+
On yes, continue. Editing starts only after that answer.
|
|
32
|
+
|
|
33
|
+
Done when the user has answered.
|
|
34
|
+
|
|
35
|
+
## 3. Rewrite
|
|
36
|
+
|
|
37
|
+
Edit each finding yourself, using the mapping below. Read the whole `bal-popover` with its trigger and its content when the snippet does not show them. This step is finished when every finding matches the mapping or is reported as not migrated.
|
|
38
|
+
|
|
39
|
+
### Popovers left legacy
|
|
40
|
+
|
|
41
|
+
Before rewriting a `bal-popover`, read `tooltip`. A popover with `tooltip` set, statically to any value other than `false` or through a binding, is **not migrated**. Leave the `bal-popover`, its trigger, its `bal-popover-content`, its children and its imports as they are, and report it. Legacy opened it on hover and focus, and `ds-popup` opens on click only. Suggest `ds-tooltip`. This follows the popup `variant="drawer"` rule.
|
|
42
|
+
|
|
43
|
+
### Structure
|
|
44
|
+
|
|
45
|
+
| old | new | handling |
|
|
46
|
+
| --- | --- | --- |
|
|
47
|
+
| `<bal-popover>` wrapper | _(removed)_ | Remove the opening and closing tag. Keep the trigger and the content in its place, in this order: trigger, then `ds-popup`. When the wrapper has other children, keep them after the `ds-popup`. When the wrapper carries `class`, `style` or `data-*` attributes, replace it with a `<div>` that keeps them instead of removing it, and report it. |
|
|
48
|
+
| element with `bal-popover-trigger` | the same element with `data-popup="<id>"` | Remove `bal-popover-trigger` and add `data-popup="<id>"`. Keep the element and its children. Legacy set `aria-haspopup="true"` on the trigger, and `ds-popup` does not for a `data-popup` trigger. When the trigger is a `bal-button` or `ds-button`, or wraps exactly one of them, add `a11yHaspopup="true"` to that button in the form the file uses. On any other trigger element, add `aria-haspopup="true"`. |
|
|
49
|
+
| `<bal-popover-content>` | `<ds-popup id="<id>">` | Rename the tag and keep its children. Place it as the next sibling of the trigger. |
|
|
50
|
+
| `id` on `bal-popover` | `id` on `ds-popup` | Move it. It is the `<id>` for `data-popup`. |
|
|
51
|
+
| `bal-popover` inside a loop (`*ngFor`, `@for`, `.map(...)`) | a bound `id` and `data-popup` per item | `ds-popup` toggles every popup whose `id` matches the clicked `data-popup`, so a static id in a loop opens all rows at once and `group` closes them again. Bind the same expression to both, built from the base id plus the item key or index: React ``id={`portfolio-summary-popover-${item.id}`}`` and the same expression for `data-popup`, Angular `[id]="'portfolio-summary-popover-' + i"` and `[attr.data-popup]="'portfolio-summary-popover-' + i"`. A static legacy `id` inside a loop gets the same suffix. |
|
|
52
|
+
| no `id` on `bal-popover` | a new `id` on `ds-popup` | Derive a unique kebab-case id from the file name plus a counter per file, such as `portfolio-summary-popover-1` for `PortfolioSummary.tsx`. Check that no other element in the project uses it. |
|
|
53
|
+
| several elements with `bal-popover-trigger` | every one gets `data-popup="<id>"` | Legacy used only the first one. Give each of them the attribute and report the popover, because the others now open it too. |
|
|
54
|
+
| no element with `bal-popover-trigger` | `trigger` prop | The popover opened only through code. Rewrite the content as above. Set the `trigger` prop to the element the code opened it from (see the `present()` row). When no such element exists, report it. |
|
|
55
|
+
|
|
56
|
+
`ds-popup` toggles on any click inside `[data-popup="<id>"]`. It reads nothing else from the trigger.
|
|
57
|
+
|
|
58
|
+
### Props: `bal-popover`
|
|
59
|
+
|
|
60
|
+
Copy as-is, in every form: `arrow`. It keeps its name and its default. `backdrop` follows its row below.
|
|
61
|
+
|
|
62
|
+
| old (`bal-popover`) | new (`ds-popup`) | handling |
|
|
63
|
+
| --- | --- | --- |
|
|
64
|
+
| `position` set | `placement` | Rename and keep the value. `ds-popup` takes `top`, `right`, `bottom` or `left`, each alone or with `-start` or `-end`. |
|
|
65
|
+
| `position` omitted | `placement="bottom-start"` | Write the legacy default, because the `ds-popup` default is `bottom`. |
|
|
66
|
+
| `position="auto"`, `"auto-start"`, `"auto-end"` | _(no equivalent)_ | Drop it and report it. `ds-popup` flips the panel to stay on screen, so the panel stays visible. |
|
|
67
|
+
| bound `position` | bound `placement` | HTML: copy the binding as `placement` and list the file and line in the report. React and Angular: rename the binding when the expression's type only admits the twelve `ds-popup` values. Otherwise apply Unmapped props and handlers (`SKILL.md`). |
|
|
68
|
+
| `active` | `open` | Rename and keep the value. Also rewrite `[active]="x"` to `[open]="x"` and `active={x}` to `open={x}`. |
|
|
69
|
+
| `backdrop` | `backdrop` plus `backdropDismiss` | Copy `backdrop`. Report that `ds-popup` traps focus inside the panel, because `trapFocus` follows `backdrop`. |
|
|
70
|
+
| _(every popover)_ | `backdropDismiss` | Write it on every migrated popover. Legacy dismissed the popover on every click outside it, and `ds-popup` does that only with `backdropDismiss`. |
|
|
71
|
+
| _(every popover)_ | `group="popover"` | Write it on every migrated popover. Legacy dismissed every other popover when one opened, and `ds-popup` does that only within one `group`. |
|
|
72
|
+
| `offsetY` set | `offset` | Copy the value. Legacy added 8 px to it when `arrow` was set. With `arrow`, write the value plus 8. |
|
|
73
|
+
| `offsetY` omitted | omit `offset` | The `ds-popup` default is 8 px. Legacy sat flush, or 8 px away with `arrow`. Report it when `arrow` is not set. |
|
|
74
|
+
| `offsetX` | _(no equivalent)_ | Drop it and report it. `ds-popup` has no skidding offset. |
|
|
75
|
+
| `autoTrigger` | _(removed)_ | Drop it in every form. `data-popup` toggles the popup on click. See "Trigger handlers" for a popover where it was false or unset. |
|
|
76
|
+
| `hint` | _(no equivalent)_ | Apply Unmapped props and handlers (`SKILL.md`). Suggest a `max-width` style on the popup content. |
|
|
77
|
+
| `mobileTop` | _(no equivalent)_ | Apply Unmapped props and handlers (`SKILL.md`). |
|
|
78
|
+
| `padding` | _(no equivalent)_ | Apply Unmapped props and handlers (`SKILL.md`). |
|
|
79
|
+
| `tooltip` | _(not migrated)_ | See "Popovers left legacy". `tooltip={false}` and `tooltip="false"` are dropped, and the popover migrates. |
|
|
80
|
+
| `hover` | _(removed)_ | Drop it in every form. Legacy 19.11.0 declares it but never reads it, so the popover never opened on hover. |
|
|
81
|
+
| _(none)_ | `label` | `ds-popup` has no visible title. When the trigger holds a short text and nothing else, or exactly one button or link whose content is a short text, set `label` to that text. Otherwise report the missing accessible name. |
|
|
82
|
+
| _(none)_ | `closable`, `panelRole`, `trapFocus` | New props. Leave them unset. `closable` would add a visible close button. |
|
|
83
|
+
|
|
84
|
+
### Props: `bal-popover-content`
|
|
85
|
+
|
|
86
|
+
| old (`bal-popover-content`) | new | handling |
|
|
87
|
+
| --- | --- | --- |
|
|
88
|
+
| `contentWidth`, `contentMinWidth` | _(no equivalent)_ | Apply Unmapped props and handlers (`SKILL.md`). Suggest an inline `width` or `min-width` style, or a class, on a wrapper inside the popup. |
|
|
89
|
+
| `color`, `expanded`, `mobileTop`, `noShadow`, `radius`, `scrollable`, `spaceless` | _(no equivalent)_ | Apply Unmapped props and handlers (`SKILL.md`). |
|
|
90
|
+
|
|
91
|
+
### Trigger handlers
|
|
92
|
+
|
|
93
|
+
Legacy `bal-popover` with `autoTrigger` false or unset did not open on a click. The app opened it from code, usually a click handler on the trigger that calls `toggle()` or `present()` on a popover ref. `data-popup` now toggles the popup on every click inside the trigger.
|
|
94
|
+
|
|
95
|
+
A click handler is any click binding on the trigger or on an element inside it: `onClick`, `(click)`, `addEventListener('click', ...)`, and the `balClick` or `dsClick` binding of a button inside the trigger, such as `onBalClick={...}` or `(balClick)="..."`.
|
|
96
|
+
|
|
97
|
+
- A click handler whose whole body is a `toggle()` or `present()` call on the popover ref: delete the binding (`onClick={...}`, `(click)="..."`, `addEventListener('click', ...)`). Delete the handler function too when nothing else uses it, following the two cleanup bullets of Unmapped props and handlers (`SKILL.md`). Report each deletion.
|
|
98
|
+
- A click handler that does more than that: keep it and remove only the `toggle()` or `present()` call. Report that the trigger now toggles on click. When the rest of the handler tracks the open state, such as `setOpen(!open)` or `this.isOpen = !this.isOpen`, move that update to `dsDidPresent` (`true`) and `dsDidDismiss` (`false`) on the `ds-popup` and delete it from the handler, because `backdropDismiss` and `group` now close the popup without a click on the trigger.
|
|
99
|
+
- When the popover ref is no longer read after these deletions, remove the `ref` binding and its declaration, following the cleanup bullets of Unmapped props and handlers (`SKILL.md`).
|
|
100
|
+
- No click handler on the trigger: report that the trigger now also toggles the popup on click.
|
|
101
|
+
|
|
102
|
+
### Methods
|
|
103
|
+
|
|
104
|
+
| old | new | handling |
|
|
105
|
+
| --- | --- | --- |
|
|
106
|
+
| `present(options)`, `dismiss(options)`, `toggle(options)` | `present()`, `dismiss()`, `toggle()` | Keep the call and drop the options argument. The ref type follows "Legacy types and bundles" in `SKILL.md`: `HTMLBalPopoverElement` becomes `HTMLDsPopupElement`, and a React `ComponentRef<typeof BalPopover>` or `ElementRef<typeof BalPopover>` becomes `ComponentRef<typeof DsPopup>` or `ElementRef<typeof DsPopup>`. Move a ref from the `bal-popover` onto the `ds-popup`. |
|
|
107
|
+
| `present()` or `toggle()` that runs before any click on the trigger, such as in `ngAfterViewInit`, `useEffect` or a handler on another element | the same call plus the `trigger` prop | `ds-popup` anchors to the clicked `data-popup` element or to `trigger`. Without either it has no anchor. Set `trigger` to the trigger element right before the call, never from a value read during render. React: `popupRef.current.trigger = triggerRef.current` inside the effect or handler, because `ref.current` is still empty on the first render. Angular: `this.popup.nativeElement.trigger = this.triggerEl.nativeElement`, with both refs read as `ElementRef` (`@ViewChild('t', { read: ElementRef })`), because a template ref on a `ds-button` returns the component, not the element. HTML: `popup.trigger = el`. Report it. |
|
|
108
|
+
|
|
109
|
+
Angular splits a component across `x.component.html` and `x.component.ts`, and the class file often calls these methods through `@ViewChild` or `viewChild`, or holds the event handler, without naming the tag, so the scan cannot see it. For every `.html` finding, open the same-basename `.ts` file beside it and check it for `present(`, `dismiss(` and `toggle(` calls and for `balChange`, `balWillAnimate` and `balDidAnimate` handlers. React and plain HTML callers hold the element in a ref or a query result, so look for calls on that variable in the same file.
|
|
110
|
+
|
|
111
|
+
### Events
|
|
112
|
+
|
|
113
|
+
The three legacy events follow the rules of `components/popup/migration.md` exactly. Read its Events table and apply it to the `ds-popup` that replaces the `bal-popover`.
|
|
114
|
+
|
|
115
|
+
| old | new | handling |
|
|
116
|
+
| --- | --- | --- |
|
|
117
|
+
| `balWillAnimate` | `dsWillPresent` + `dsWillDismiss` | Apply the `balWillAnimate` row of `components/popup/migration.md`. The legacy detail was the open state before the change. |
|
|
118
|
+
| `balDidAnimate` | `dsDidPresent` + `dsDidDismiss` | Apply the `balDidAnimate` row of `components/popup/migration.md`. The legacy detail was the open state after the change. Replace every read of `detail` with `true` (present) or `false` (dismiss). |
|
|
119
|
+
| `balChange` | `dsDidPresent` + `dsDidDismiss` | Apply the `balChange` row of `components/popup/migration.md`, including the `detail` replacement and the merge rule with `balDidAnimate`. |
|
|
120
|
+
|
|
121
|
+
Move every binding from the `bal-popover` onto the `ds-popup`. Rewrite only handlers that are attached to the `bal-popover` being migrated. `balChange` is emitted by many other legacy components, so never rewrite a handler on another element, and never rename it by search and replace across the file.
|
|
122
|
+
|
|
123
|
+
### Tags and imports
|
|
124
|
+
|
|
125
|
+
- **HTML**: `<bal-popover>` goes, and `<bal-popover-content>` becomes `<ds-popup>`, including the closing tag.
|
|
126
|
+
- **Angular**: the same rewrite in `.html` templates and in inline `template:` strings. When a file imports `BalPopover` or `BalPopoverContent` from `@baloise/ds-angular`, remove both and add `import { DsPopup } from '@helvetia-design/angular'`. Leave the other symbols on the `@baloise` import. In `imports: [...]`, replace them with one `DsPopup`. A multi-family bundle such as `BalComponentBundle` stays, and `DsPopup` goes next to it.
|
|
127
|
+
- **React**: `<BalPopover>` goes, and `<BalPopoverContent>` becomes `<DsPopup>`, including the closing tag. Import `DsPopup` from `@helvetia-design/react`. Remove `BalPopover` and `BalPopoverContent` from the `@baloise/ds-react` import, and delete the import line when it binds nothing else. If the file already imports from `@helvetia-design/react`, add to that import.
|
|
128
|
+
|
|
129
|
+
Apply these rules per file. A file that still holds a popover left legacy keeps the symbols that popover uses.
|
|
130
|
+
|
|
131
|
+
## 4. Report
|
|
132
|
+
|
|
133
|
+
Write the report as `shared/report.md` describes, with the per-file summary under Files changed. Every item below gets its own line in the coverage checklist, found or none found.
|
|
134
|
+
|
|
135
|
+
Needs your attention when found:
|
|
136
|
+
|
|
137
|
+
1. Every popover with `tooltip`, left as legacy `bal-popover` and not migrated. Name file and line, and suggest `ds-tooltip`.
|
|
138
|
+
2. Every popover inside a loop, with the bound `id` and `data-popup` expression it got.
|
|
139
|
+
3. Every wrapper replaced by a `<div>` because it carried attributes, with the attributes.
|
|
140
|
+
4. Every popover with more than one `bal-popover-trigger` element, because every trigger now opens it.
|
|
141
|
+
5. Every popover without a `bal-popover-trigger` element, with the `trigger` prop set or the missing anchor.
|
|
142
|
+
6. Every generated `id`, with file and line.
|
|
143
|
+
7. Every dropped `position="auto"`, `"auto-start"` or `"auto-end"`.
|
|
144
|
+
8. Every dynamic `position` binding, with the framework outcome (copied in HTML, copied or removed (Unmapped) in React and Angular).
|
|
145
|
+
9. Every dropped `offsetX`.
|
|
146
|
+
10. Every popover without `offsetY` and without `arrow`. It now sits 8 px from its trigger, where legacy sat flush.
|
|
147
|
+
11. Every popover with `backdrop`. `ds-popup` traps focus inside the panel. Legacy did not trap focus.
|
|
148
|
+
12. Every `hint`, `mobileTop` and `padding` on `bal-popover`, and every prop on `bal-popover-content`, with its Unmapped props and handlers outcome. Suggest a `width` or `min-width` style for `contentWidth` and `contentMinWidth`.
|
|
149
|
+
13. Every trigger click handler deleted or changed, and every trigger that now also toggles on click.
|
|
150
|
+
14. Every `present()` or `toggle()` call that needed the `trigger` prop.
|
|
151
|
+
15. Every popover without `label`, because the trigger holds more than a short text. The panel has no accessible name.
|
|
152
|
+
16. Every `balChange`, `balWillAnimate` and `balDidAnimate` handler, split into its pair as `components/popup/migration.md` describes, or with its Unmapped props and handlers outcome.
|
|
153
|
+
17. Every type reference that the scan cannot see, such as `BalProps.BalPopoverPlacement`, `BalEvents.BalPopoverChangeDetail` or `BalPopoverCustomEvent`, and every multi-family bundle kept, as `SKILL.md` "Legacy types and bundles" describes.
|
|
154
|
+
18. One-time note, when at least one popover was migrated: Escape no longer closes the popup unless `closable` is set, which also shows a close button, and tabbing out of the panel no longer closes it.
|
|
155
|
+
19. Every lost selector. `ds-popup` uses shadow DOM. Selectors in the project's own styles that target `bal-popover`, `bal-popover-content` or a `bal-popover__*` or `bal-popover-content__*` class no longer match. Do not rewrite them. Report them.
|
|
156
|
+
|
|
157
|
+
Coverage only, written to the file:
|
|
158
|
+
|
|
159
|
+
20. Every `bal-popover` unwrapped and its `bal-popover-content` rewritten to `ds-popup`.
|
|
160
|
+
21. Every `bal-popover-trigger` rewritten to `data-popup`, and every `a11yHaspopup="true"` or `aria-haspopup="true"` added.
|
|
161
|
+
22. Every `position` renamed to `placement`, and every `placement="bottom-start"` added.
|
|
162
|
+
23. Every `active` renamed to `open`.
|
|
163
|
+
24. Every `backdropDismiss` and `group="popover"` added.
|
|
164
|
+
|
|
165
|
+
Leave every change unstaged for the consumer to review, including `ds-migration-report.md`. Stop. Do not run `git add` or `git commit`.
|
|
166
|
+
|
|
167
|
+
Done when every numbered item has its line in `ds-migration-report.md`, the chat shows only the attention items and the pointer line, and the working tree is still unstaged.
|
|
@@ -77,7 +77,7 @@ Copy as-is, in every form: `label`, `placement`, `arrow`, `backdrop`, `closable`
|
|
|
77
77
|
| `variant` bound dynamically | _(not migrated)_ | The value is unknown at migration time and may be `drawer` or `fullscreen`. Leave the element as legacy and report it. |
|
|
78
78
|
| `reference` | _(no equivalent)_ | Drop it in every form. `ds-popup` anchors to its trigger. Report each one. |
|
|
79
79
|
| `contentWidth` | _(no equivalent)_ | Drop it in every form. Legacy set `--bal-popup-variant-popover-max-width` from it. Report each one. |
|
|
80
|
-
| _(none)_ | `
|
|
80
|
+
| _(none)_ | `panelRole`, `group`, `trapFocus` | New props. Nothing to migrate from. Leave them unset. |
|
|
81
81
|
| `[placement]="x"`, `[attr.offset]="x"`, `closable={x}`, and the same for every other copied prop | same | Dynamic value. Do not guess the mapping. `active`, `reference` and `contentWidth` follow their own rows. Every other prop keeps its name. HTML: copy the binding unchanged and list the file and line in the report. React and Angular: copy it when the expression's type only admits values the `ds-popup` prop accepts. `placement` takes `top`, `right`, `bottom` or `left`, each alone or with `-start` or `-end`. `offset` takes a number and `label` a string. `arrow`, `backdrop`, `closable` and `backdropDismiss` take a boolean. Otherwise apply Unmapped props and handlers (`SKILL.md`). |
|
|
82
82
|
|
|
83
83
|
### Tags and imports
|
|
@@ -4,9 +4,9 @@ Migrate every `bal-radio` usage to `ds-radio`, and every `bal-radio-group` usage
|
|
|
4
4
|
|
|
5
5
|
Both legacy tags are migrated together, not separately. `bal-radio-group` drives its children with `this.el.querySelectorAll('bal-radio')`; rewriting the children to `ds-radio` while leaving a `bal-radio-group` parent untouched would silently break that cascade, because the old group would stop finding its own children. `ds-radio-group` has the matching `querySelectorAll('ds-radio')` wiring, so the parent and its children are always rewritten in the same pass.
|
|
6
6
|
|
|
7
|
-
`bal-radio-icon` is the third tag in the legacy folder. It is the legacy indicator that a consumer places inside a tile body, and `ds-radio` has no equivalent because the ds tile draws its own indicator.
|
|
7
|
+
`bal-radio-icon` is the third tag in the legacy folder. It is the legacy indicator that a consumer places inside a tile body, and `ds-radio` has no equivalent because the ds tile draws its own indicator. Decide `hideTrigger` first, as Shape: round icon and `hideTrigger` describes, because the decision reads those tags. Then, inside a migrated `ds-radio`, delete every `<bal-radio-icon>` (React `<BalRadioIcon />`) and its import when it becomes unused. Leave the rest of the tile body (`bal-stack`, `bal-icon`, `bal-content`, `bal-label`, `bal-text` and so on) unchanged for its own migration, and list those tags in the report as children of the tile. A `bal-radio-icon` outside any radio is rare. It stays in place and is reported as "no `ds-*` equivalent, needs manual rework". Do not add a comment to the consumer's code. `scan-migratable.mjs` counts every `bal-radio-icon` under `byHand` as `radio-icon`, not under `suggested`, so a standalone one keeps showing there until someone replaces it by hand.
|
|
8
8
|
|
|
9
|
-
The scan also lists `newBalRadioOption`, the helper that builds the dropped `options` array (see Props below), because a file can call it without ever naming a tag. The scan also lists `BalRadioBundle` and the `BalEvents.BalRadio*` and `BalRadio*CustomEvent` types. It does not match the ambient `
|
|
9
|
+
The scan also lists `newBalRadioOption`, the helper that builds the dropped `options` array (see Props below), because a file can call it without ever naming a tag. The scan also lists `BalRadioBundle` and the `BalEvents.BalRadio*` and `BalRadio*CustomEvent` types. It lists `HTMLBalRadioElement` too. It does not match the ambient `BalProps.BalRadio*` types. Search for them yourself in each file with a finding. `SKILL.md` "Legacy types and bundles" says how to rewrite all of them.
|
|
10
10
|
|
|
11
11
|
Apply `shared/field.md` in the Rewrite step to every migrated `ds-radio-group` that sits inside a `bal-field`, in the same pass. It moves the label, description and message of the wrapper onto the control and removes the wrapper tags. A `bal-field` around a control that is still a legacy `bal-*` tag stays unchanged. `components/field/migration.md` migrates `bal-form-grid`, `bal-form-col` and every `bal-field` that is left.
|
|
12
12
|
|
|
@@ -47,16 +47,28 @@ Legacy `interface` (`'radio' | 'button' | 'tile'`) lived on `bal-radio` and, whe
|
|
|
47
47
|
| old `interface` | new | handling |
|
|
48
48
|
| --- | --- | --- |
|
|
49
49
|
| omitted, `"radio"` | omit `tile` | Default on both sides. Copy every other prop as-is. |
|
|
50
|
-
| `"tile"` | `tile` on `ds-radio-group` | Boolean attribute, same meaning: a bordered card layout. See the `color` row below for the tile colour. |
|
|
51
|
-
| `"button"` | `tile`
|
|
50
|
+
| `"tile"` | `tile` on `ds-radio-group`, plus `hideTrigger` when no child tile body has a `bal-radio-icon` | Boolean attribute, same meaning: a bordered card layout. See Shape: round icon and `hideTrigger` below for when to add `hideTrigger`, and the `color` row below for the tile colour. |
|
|
51
|
+
| `"button"` | `tile` on `ds-radio-group` | See Shape: button below. This is a visual approximation, not an exact match. |
|
|
52
52
|
|
|
53
53
|
`ds-radio-group` overwrites `tile`, `hideTrigger`, `cols`, `colsTablet` and `colsMobile` on every child, also on children added later through `slotchange`, so `*ngFor` children are covered. A value written on a child inside a group is lost. Write these props on the group only and drop `interface` from every child inside a group. A child-level `interface="tile"` or `"button"` inside a group whose own `interface` is unset moves to the group. When the children of one group carry different `interface` values, or values that differ from the group, report it. A group renders all children the same way. A standalone `bal-radio` outside any group keeps `tile` and `hideTrigger` on itself, because no group overwrites it.
|
|
54
54
|
|
|
55
|
-
### Shape:
|
|
55
|
+
### Shape: round icon and `hideTrigger`
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
Legacy `bal-radio` draws its round `bal-radio-icon` for every `interface` except `tile`. `ds-radio` shows the icon in every mode and hides it only when `tile` and `hideTrigger` are both set. Decide `hideTrigger` before you delete any `bal-radio-icon`, because the decision reads those tags.
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
This decision applies only to a group or standalone radio that ends up with `interface="tile"`. Never add `hideTrigger` for `"button"`, `"radio"` or an omitted `interface`. A child showed the round icon when its tile body holds a `bal-radio-icon` (`<BalRadioIcon />` in React), or when its own `interface` is not `tile` inside a group whose own `interface` is unset. Then:
|
|
60
|
+
|
|
61
|
+
- No child showed the icon: add `hideTrigger` to the group.
|
|
62
|
+
- Every child showed the icon: write no `hideTrigger`. The ds tile draws its own icon in place of the deleted `bal-radio-icon`.
|
|
63
|
+
- Only some children showed the icon: a group renders all children the same way, so write no `hideTrigger` and report the group.
|
|
64
|
+
|
|
65
|
+
A `"tile"` group built from `options` gets `hideTrigger`, unless an option's `html` contains `bal-radio-icon`. A standalone `bal-radio` follows the same rule with its own tile body.
|
|
66
|
+
|
|
67
|
+
### Shape: `interface="button"` becomes `tile`
|
|
68
|
+
|
|
69
|
+
The legacy `button` look (set on `bal-radio-group`, cascading to children) is an auto-width, inline-flowing row of bordered buttons, with the selected one filled solid dark-navy with white text. `tile` does not reproduce that: tile mode is always a block-level card, either full width (no `cols`) or an equal-width grid cell (`cols` set) — never auto-width to its own label text — and its selected state is a border plus a soft color tint, never a solid fill.
|
|
70
|
+
|
|
71
|
+
Rewrite anyway, as the closest available approximation: add `tile` to the group only. Do not add `hideTrigger`, because legacy `button` kept its round icon. Carry over `color` on individual children as the `tile-color` attribute (see the `color` row below). Flag every occurrence with a **"slight design deviation"** note: sizing behavior changed from auto-width/inline to fixed/grid-width block, and the selected-state fill changed from solid to border-plus-tint.
|
|
60
72
|
|
|
61
73
|
### Props: `bal-radio` → `ds-radio`
|
|
62
74
|
|
|
@@ -83,12 +95,12 @@ Rewrite anyway, as the closest available approximation: add `tile` and `hideTrig
|
|
|
83
95
|
| `expanded` | _(no equivalent)_ | Drop it. Mention each dropped occurrence. |
|
|
84
96
|
| _(none — new prop)_ | `required` (defaults `true`) | Do not set this on a group without a label. Its only effect is an "(optional)" suffix next to the group's own `label` prop. When the group sits inside a `bal-field` with a label, `shared/field.md` sets `label` and `required` on the group. Outside a `bal-field`, leave the new default alone. `ds-radio-group` is excluded from the required default rule in `SKILL.md`. Mention once, not per-occurrence, that this new prop exists. |
|
|
85
97
|
| _(none — new props)_ | `label`, `description`, `invalidText`, `loading`, `labelPosition`, `color` | New capabilities, nothing to migrate from legacy. Leave unset. `color` here is the group's input colour, not the tile colour: do not carry a child's `color` onto the group. |
|
|
86
|
-
| `interface` (`"tile"`, `"button"`) | `tile`, `hideTrigger` | Set on the group only, as Shape describes. The group overwrites both on every child. |
|
|
98
|
+
| `interface` (`"tile"`, `"button"`) | `"tile"`: `tile`, plus `hideTrigger` as Shape: round icon and `hideTrigger` describes. `"button"`: `tile` | Set on the group only, as Shape describes. The group overwrites both on every child. |
|
|
87
99
|
| _(none — new prop)_ | `tileColor` | A fallback for children without a `tile-color` attribute. It does not override a child's `tile-color`. |
|
|
88
100
|
|
|
89
101
|
### Tags and imports
|
|
90
102
|
|
|
91
|
-
- **HTML**: `<bal-radio>` becomes `<ds-radio>`, including the closing tag. `<bal-radio-group>` becomes `<ds-radio-group>`, including the closing tag. Delete every `<bal-radio-icon>` inside a migrated `<ds-radio
|
|
103
|
+
- **HTML**: `<bal-radio>` becomes `<ds-radio>`, including the closing tag. `<bal-radio-group>` becomes `<ds-radio-group>`, including the closing tag. Delete every `<bal-radio-icon>` inside a migrated `<ds-radio>`, after the `hideTrigger` decision. Leave a `<bal-radio-icon>` outside any radio alone.
|
|
92
104
|
- **Angular**: the same tag rewrites in `.html` templates and in inline `template:` strings. When a file imports `BalRadio` and/or `BalRadioGroup` from `@baloise/ds-angular`, replace only the ones used with `DsRadio`/`DsRadioGroup` from `@helvetia-design/angular`, keeping the rest on the `@baloise` import. A `...BalRadioBundle` spread in `imports: [...]` becomes `DsRadio` and `DsRadioGroup`. Keep the spread, and add the `Ds*` symbols next to it, while the template still has a group left in place or a `bal-radio-icon` outside a radio. A multi-family bundle such as `BalFormBundle` stays, and the `Ds*` symbols are added next to it. `SKILL.md` "Legacy types and bundles" has the full bundle rule.
|
|
93
105
|
- **React**: `<BalRadio>`/`</BalRadio>` becomes `<DsRadio>`/`</DsRadio>`, `<BalRadioGroup>`/`</BalRadioGroup>` becomes `<DsRadioGroup>`/`</DsRadioGroup>`. Import the renamed symbols from `@helvetia-design/react`, keeping only the ones actually used. Remove `BalRadioIcon` from the `@baloise/ds-react` import when no `<BalRadioIcon />` is left. When the existing `@baloise/ds-react` import also binds other symbols, move only `BalRadio` and `BalRadioGroup` and leave the rest on the `@baloise` import.
|
|
94
106
|
|
|
@@ -134,25 +146,26 @@ Write the report as `shared/report.md` describes, with the per-file summary unde
|
|
|
134
146
|
|
|
135
147
|
Needs your attention when found:
|
|
136
148
|
|
|
137
|
-
1. Every `interface="button"` rewritten to `tile
|
|
138
|
-
2. Every
|
|
139
|
-
3. Every
|
|
140
|
-
4. Every dropped `
|
|
141
|
-
5. Every dropped `
|
|
142
|
-
6. Every dropped `
|
|
143
|
-
7. Every dropped `
|
|
144
|
-
8. Every dropped `
|
|
145
|
-
9. Every `
|
|
146
|
-
10. Every `
|
|
147
|
-
11. Every `bal-radio-
|
|
148
|
-
12. Every
|
|
149
|
-
13.
|
|
150
|
-
14. One-time note:
|
|
149
|
+
1. Every `interface="button"` rewritten to `tile`, with its "slight design deviation" note.
|
|
150
|
+
2. Every `interface="tile"` group or standalone radio that got `hideTrigger`, because no child showed the legacy round icon. Every group where only some children showed it, which got no `hideTrigger`.
|
|
151
|
+
3. Every child `interface`, `colSize*` or `col-size*` value that differs from its siblings or from the group, with what was written on the group (`tile`, `hideTrigger`, `cols*`). Every group whose children had `colSize*` and no group `columns*`, with the `cols*` written or the reason none was.
|
|
152
|
+
4. Every dropped `labelHidden`. `ds-radio` always renders its label slot.
|
|
153
|
+
5. Every dropped `flat`.
|
|
154
|
+
6. Every dropped `nonSubmit`. `ds-radio` is always submitted with the form.
|
|
155
|
+
7. Every dropped `verticalOnMobile`.
|
|
156
|
+
8. Every dropped `expanded`.
|
|
157
|
+
9. Every dropped `options` or `newBalRadioOption`, flagged for manual conversion to slotted children, together with any `getOptionByValue()` call site tied to it and its Unmapped props and handlers outcome.
|
|
158
|
+
10. Every `getInputElement()` or `getOption()` call, with its Unmapped props and handlers outcome.
|
|
159
|
+
11. Every `setValue()` call on a `bal-radio-group` ref, with the rewrite it got: the form control, the model property, or `el.value`. For `el.value`, note that no `dsChange` fires, so `dsChange` handlers do not run.
|
|
160
|
+
12. Every `bal-radio-icon` or `BalRadioIcon` removed from a tile, with file and line, and the legacy tags left in that tile body (for example `bal-stack`, `bal-icon`, `bal-content`) as children of the tile for their own migrations. Every `bal-radio-icon` outside a radio left in place.
|
|
161
|
+
13. Every legacy type left or written out and every bundle kept, as `SKILL.md` "Legacy types and bundles" describes: each `BalProps.BalRadio*` type such as `BalProps.BalRadioInterface` left in place, each detail alias such as `BalEvents.BalRadioChangeDetail` written out, each `BalRadioBundle` spread kept because a group or a `bal-radio-icon` outside a radio is left, and each multi-family bundle kept.
|
|
162
|
+
14. One-time note: files which only listen or only call a method, and have no scanned `.html` of the same name beside them, were not scanned.
|
|
163
|
+
15. One-time note: the scan reports `setValue()` on a ref typed `HTMLBalRadioGroupElement` in every scanned file. It does not report other method calls or listeners in a file that has no finding and no scanned `.html` of the same name beside it.
|
|
151
164
|
|
|
152
165
|
Coverage only, written to the file:
|
|
153
166
|
|
|
154
|
-
|
|
155
|
-
|
|
167
|
+
16. Every empty `color` dropped.
|
|
168
|
+
17. One-time note, for groups outside a `bal-field` only: `ds-radio-group` has a new `required` prop that defaults to `true`, and the migration left it unset. It is inert unless the consumer later adopts the group's own `label` prop.
|
|
156
169
|
|
|
157
170
|
Leave every change unstaged for the consumer to review, including `ds-migration-report.md`. Stop. Do not run `git add` or `git commit`.
|
|
158
171
|
|
|
@@ -6,7 +6,7 @@ Both legacy tags are migrated together, not separately. `bal-segment-item` finds
|
|
|
6
6
|
|
|
7
7
|
Apply `shared/field.md` in the Rewrite step to every migrated `ds-segment` that sits inside a `bal-field`, in the same pass. It moves the label, description and message of the wrapper onto the control and removes the wrapper tags. A `bal-field` around a control that is still a legacy `bal-*` tag stays unchanged. `components/field/migration.md` migrates `bal-form-grid`, `bal-form-col` and every `bal-field` that is left.
|
|
8
8
|
|
|
9
|
-
The scan also lists `BalSegmentBundle` and the `BalEvents.BalSegment*` and `BalSegment*CustomEvent` types. It
|
|
9
|
+
The scan also lists `BalSegmentBundle` and the `BalEvents.BalSegment*` and `BalSegment*CustomEvent` types. It lists the `HTMLBalSegmentElement` and `HTMLBalSegmentItemElement` types too. It does not match `BalProps.BalSegment*`. Search for them yourself in each file with a finding. `SKILL.md` "Legacy types and bundles" says how to rewrite all of them.
|
|
10
10
|
|
|
11
11
|
## 1. Scan
|
|
12
12
|
|
|
@@ -6,7 +6,7 @@ Both legacy tags are migrated together, not separately. A legacy `bal-select` re
|
|
|
6
6
|
|
|
7
7
|
Apply `shared/field.md` in the Rewrite step to every migrated `ds-select` that sits inside a `bal-field`, in the same pass. It moves the label, description and message of the wrapper onto the control and removes the wrapper tags. A `bal-field` around a control that is still a legacy `bal-*` tag stays unchanged. `components/field/migration.md` migrates `bal-form-grid`, `bal-form-col` and every `bal-field` that is left.
|
|
8
8
|
|
|
9
|
-
The scan also lists `BalSelectBundle` and the `BalEvents.BalSelect*` and `BalSelect*CustomEvent` types. It
|
|
9
|
+
The scan also lists `BalSelectBundle` and the `BalEvents.BalSelect*` and `BalSelect*CustomEvent` types. It lists the `HTMLBalSelectElement` and `HTMLBalSelectOptionElement` types too. It does not match `BalProps.BalSelect*`. Search for them yourself in each file with a finding. `SKILL.md` "Legacy types and bundles" says how to rewrite all of them.
|
|
10
10
|
|
|
11
11
|
## 1. Scan
|
|
12
12
|
|
|
@@ -181,7 +181,7 @@ Needs your attention when found:
|
|
|
181
181
|
9. Every `create` that now returns an id.
|
|
182
182
|
10. Every dropped `icon` on `create`. The icon now comes from `color`.
|
|
183
183
|
11. Every dropped `setQueue`. There is no queue-limit API. Also name every method left empty, flagged "now does nothing", with its callers.
|
|
184
|
-
12. Every ambient type reference `BalProps.BalSnackbar
|
|
184
|
+
12. Every ambient type reference `BalProps.BalSnackbar*` and `BalEvents.BalSnackbar*`. The scan cannot see them. Grep for them and rename by hand. It does list `HTMLBalSnackbarElement`. The scan does list `Components.BalSnackbar`, because it matches the bare `BalSnackbar` symbol. Treat it as a type reference too.
|
|
185
185
|
13. One-time note: the role changed from `alertdialog` to `status`.
|
|
186
186
|
14. Every legacy `bal-snackbar__*` class and `data-testid="bal-snackbar-close"` and `"bal-snackbar-action"` selector. They no longer match, because `ds-snackbar` uses shadow DOM.
|
|
187
187
|
15. Every `create` that got `heading: ''`.
|