@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
|
@@ -154,6 +154,8 @@ Every component migration also decides about the legacy config call. Follow `sha
|
|
|
154
154
|
|
|
155
155
|
Inside a batch (see `shared/batch.md`), a `migration.md` runs only its Rewrite step, on the batch file list. It skips its Scan display, its Confirm step and its stop. It still applies `shared/field.md`. It skips the icon import and Registration rules and `shared/legacy-config.md`, which the batch runs once at the end. It hands the outcome of its Report items back to the batch instead of writing its own report section.
|
|
156
156
|
|
|
157
|
+
A report-only migration is a `migration.md` whose first heading ends with `(report only)`, such as `nav` and `stage`. It covers a legacy component with no `ds-*` target. It edits no source file and only writes report entries with a suggested replacement. Skip the icon scan and the icon rules of `shared/icons.md`, and write each `I` item as `not applicable, report-only migration`. Run `shared/legacy-config.md` as usual: the component stays, so the legacy config call stays. Inside a batch, such a file adds its report entries and no edits.
|
|
158
|
+
|
|
157
159
|
Vue is not a supported target. The scanners read `.vue` files only so that `shared/legacy-config.md` and **Cleanup** see every `bal-*` tag that is left. A component migration or a batch never rewrites a `.vue` file. Show its findings with the others, marked as not migrated, and leave the file unchanged. In the Report step, list each such file under "Needs your attention" as a Vue file that this skill does not migrate, with its findings. The legacy config call and the legacy imports stay until the consumer migrates those files by hand.
|
|
158
160
|
|
|
159
161
|
#### Unmapped props and handlers
|
|
@@ -221,15 +223,15 @@ If that list is empty, report that no component migrations are available yet, th
|
|
|
221
223
|
node <this-skill-directory>/scripts/scan-migratable.mjs <project-root>
|
|
222
224
|
```
|
|
223
225
|
|
|
224
|
-
The script prints one JSON object. `suggested` contains used `bal-*` components that have a migration, with their usage total. `notYet` contains used components for which this skill has no migration. A total counts usages: opening tags, JSX elements and `Bal*` symbols, not closing tags. A component scanner's `total` also counts closing tags, so it is usually higher than the Detect total for the same component. Do not compare the two. `types` contains legacy type namespaces such as `BalEvents`, `BalProps` and `BalLanguage`. A member such as `BalEvents.BalSegmentCustomEvent` also counts for its component when that component has a migration. They are not components, are never offered, and do not count as left.
|
|
226
|
+
The script prints one JSON object. `suggested` contains used `bal-*` components that have a migration, with their usage total. `notYet` contains used components for which this skill has no migration. A total counts usages: opening tags, JSX elements and `Bal*` symbols, not closing tags. A component scanner's `total` also counts closing tags, so it is usually higher than the Detect total for the same component. Do not compare the two. `types` contains legacy type namespaces such as `BalEvents`, `BalProps` and `BalLanguage`. A member such as `BalEvents.BalSegmentCustomEvent` also counts for its component when that component has a migration. They are not components, are never offered, and do not count as left. `byHand`, present only when it is not empty, contains used legacy tags that no migration rewrites (`check`, `switch`, `radio-icon`), by legacy slug.
|
|
225
227
|
|
|
226
|
-
Show `notYet`, if it is not empty, as used components that cannot be migrated by this version of the skill. Do not offer
|
|
228
|
+
Show `notYet`, if it is not empty, as used components that cannot be migrated by this version of the skill. Show `byHand`, if present, as legacy tags that the consumer must replace by hand. Do not offer either as choices.
|
|
227
229
|
|
|
228
230
|
If `types` is not empty, show it as a note: a component migration rewrites the legacy types of the components it migrates (see Legacy types and bundles), and the other legacy types stay until their code is rewritten by hand.
|
|
229
231
|
|
|
230
232
|
If `suggested` is empty, report that none of the used components has an available migration, then stop.
|
|
231
233
|
|
|
232
|
-
Build a picker from every entry in `suggested`, showing its `name` and `total`. Wait for one choice, then ask the cascade question below.
|
|
234
|
+
Build a picker from every entry in `suggested`, showing its `name` and `total`. Mark a report-only entry (`nav`, `stage`) as "report only", because choosing it writes report entries and rewrites nothing. Wait for one choice, then ask the cascade question below.
|
|
233
235
|
|
|
234
236
|
#### Cascade question
|
|
235
237
|
|
|
@@ -288,9 +290,9 @@ Migrate every legacy icon left in the project, following `shared/icons.md`. Comp
|
|
|
288
290
|
Delete what Init kept for the transition, once the migration is complete, following `shared/cleanup.md`. Run this step last, after **Components**, **CSS utils** and **Assets**.
|
|
289
291
|
|
|
290
292
|
1. Run `scan-cleanup.mjs` from the Scan section of `shared/cleanup.md`. It runs `scan-migratable.mjs` first. It also runs the **CSS utils** scan and keeps the `css/core` line while a `css/core` class is left.
|
|
291
|
-
- When `status` is `incomplete`, do not edit files. List every entry in `outstanding.suggested` with its `total` and say to migrate it with **Components** first. List every entry in `outstanding.notYet` with its `total` as a component that this version of the skill cannot migrate, which the consumer must replace by hand. List every entry in `outstanding.types` with its `total` as legacy types that the consumer must replace by hand, because removing the `@baloise/ds-*` dependency breaks every file that still imports them. List every line in `outstanding.hidden` (path, line, snippet) as a `bal-*` tag that the scan cannot attribute to a component, which the consumer must migrate by hand. Stop.
|
|
293
|
+
- When `status` is `incomplete`, do not edit files. List every entry in `outstanding.suggested` with its `total` and say to migrate it with **Components** first. For a report-only entry (`nav`, `stage`), say instead that the consumer must rebuild it by hand, following its entry in `ds-migration-report.md`. List every entry in `outstanding.notYet` with its `total` as a component that this version of the skill cannot migrate, which the consumer must replace by hand. List every entry in `outstanding.byHand` with its `total` as a legacy tag without a `ds-*` equivalent, which the consumer must replace by hand. No **Components** migration removes it. List every entry in `outstanding.types` with its `total` as legacy types that the consumer must replace by hand, because removing the `@baloise/ds-*` dependency breaks every file that still imports them. List every line in `outstanding.hidden` (path, line, snippet) as a `bal-*` tag that the scan cannot attribute to a component, which the consumer must migrate by hand. Stop.
|
|
292
294
|
- When `status` is `nothing-to-clean-up`, do not edit files. Say there is nothing to clean up. List every line in `keep.lines`, every entry in `keep.dependencies` and every file in `unreadable` as in step 2. Stop.
|
|
293
|
-
2. When `status` is `ready`, show what the step deletes: every line in `remove.lines` (path, line, snippet) and every entry in `remove.dependencies` (manifest, field, name). Then show what stays: every line in `keep.lines` and every entry in `keep.dependencies` with the pointer that the Scan section of `shared/cleanup.md` gives for its `reason`, and every file in `unreadable`. Say that the scan skips build output such as `dist` and `build`, and ask the consumer to check build tooling outside the scanned files for legacy references. Ask one yes/no: delete every listed line and dependency? On no, stop with the files unchanged.
|
|
295
|
+
2. When `status` is `ready`, show what the step deletes: every line in `remove.lines` (path, line, snippet) and every entry in `remove.dependencies` (manifest, field, name). Then show what stays: every line in `keep.lines` and every entry in `keep.dependencies` with the pointer that the Scan section of `shared/cleanup.md` gives for its `reason`, and every file in `unreadable`. For a `legacy-config` line, point to **Assets**, which carries the config values over and deletes the call with its import, never to a deletion by hand. Say that the scan skips build output such as `dist` and `build`, and ask the consumer to check build tooling outside the scanned files for legacy references. Ask one yes/no: delete every listed line and dependency? On no, stop with the files unchanged.
|
|
294
296
|
3. Apply the Lines section of `shared/cleanup.md`.
|
|
295
297
|
4. Apply the Dependencies section of `shared/cleanup.md`. It runs `installCommand` only when it deleted a dependency.
|
|
296
298
|
5. Append a `cleanup` section to `ds-migration-report.md` as `shared/report.md` describes. Its checklist holds the `C1.`, `C2.`, ... items from the Report section of `shared/cleanup.md`. Under `### Files changed`, list every file this step edited.
|
|
@@ -45,8 +45,8 @@ Edit each finding yourself, using the mapping below. Read the whole element when
|
|
|
45
45
|
| `color="danger"` / `color="red"` | `color="danger"` | Both were aliases for the same background token in the legacy component. Collapse either spelling to `danger`. |
|
|
46
46
|
| `color="warning"` / `color="yellow"` | `color="warning"` | Same as above: `yellow` was an alias for `warning`. Collapse to `warning`. |
|
|
47
47
|
| `color="success"` / `color="green"` | `color="success"` | Same as above: `green` was an alias for `success`. Collapse to `success`. |
|
|
48
|
-
| `color="purple"` | _(no equivalent)_ | Legacy used `purple` as its only "info"-like accent. `ds-badge` has no purple
|
|
49
|
-
| `color` not a string literal | see handling | Do not guess a runtime color. HTML: leave the expression. React and Angular: keep it when the expression's type only admits `disabled`, `danger`, `warning` or `success`. Otherwise apply Unmapped props and handlers (`SKILL.md`). Say in the report that these are the only styled colors now. |
|
|
48
|
+
| `color="purple"` | _(no equivalent)_ | Legacy used `purple` as its only "info"-like accent. `ds-badge` has no `purple`. It has an `info` color, but whether `purple` maps to it is not decided. Drop the attribute and mention each one in the report. |
|
|
49
|
+
| `color` not a string literal | see handling | Do not guess a runtime color. HTML: leave the expression. React and Angular: keep it when the expression's type only admits `disabled`, `info`, `danger`, `warning` or `success`. Otherwise apply Unmapped props and handlers (`SKILL.md`). Say in the report that these are the only styled colors now. |
|
|
50
50
|
| `position="card"` / `position="button"` / `position="tabs"` | same | Copy as-is, including the `'...'`, `{"..."}`, and `{'...'}` forms. All three values are unchanged. |
|
|
51
51
|
| _(none)_ | `pulse` | New prop. Nothing to migrate from. Leave it unset. |
|
|
52
52
|
|
|
@@ -78,7 +78,7 @@ Needs your attention when found:
|
|
|
78
78
|
|
|
79
79
|
1. Every dropped `color="purple"`.
|
|
80
80
|
2. Every badge with an `icon` whose slotted text now renders next to the icon, where only the icon showed before. The consumer decides whether to remove the now visible text.
|
|
81
|
-
3. Every `color` left as a non-literal expression, with the framework outcome (left in HTML, kept or removed (Unmapped) in React and Angular) and the note that `disabled`, `danger`, `warning`, and `success` are the only styled colors now.
|
|
81
|
+
3. Every `color` left as a non-literal expression, with the framework outcome (left in HTML, kept or removed (Unmapped) in React and Angular) and the note that `disabled`, `info`, `danger`, `warning`, and `success` are the only styled colors now.
|
|
82
82
|
|
|
83
83
|
Coverage only, written to the file:
|
|
84
84
|
|
|
@@ -59,6 +59,21 @@ The evidence, resolving both sides down to their token values:
|
|
|
59
59
|
|
|
60
60
|
Rewrite the `color='…'`, `color={"…"}`, and `color={'…'}` forms as well as `color="…"`. When `color` is bound to a non-literal expression, do not guess the mapping. HTML: leave the expression alone. React and Angular: keep it when the expression's type only admits `primary`, `secondary`, `link`, `success`, `warning` or `danger`, the names that keep their meaning in this table. A type that admits `tertiary` or `info` compiles but changes the look, so it does not fit. Otherwise apply Unmapped props and handlers (`SKILL.md`). Say in the report that its values must be remapped by hand against this table.
|
|
61
61
|
|
|
62
|
+
### Shape: the current navigation entry keeps its highlight through `color`
|
|
63
|
+
|
|
64
|
+
Legacy `is-active` forced the pressed look of the button's own colour. A navbar used it to show the current page. `ds-button` has no style for `aria-current`, so the `a11yCurrent` rewrite in the `isActive` row alone leaves every navigation entry looking the same. On a navigation entry with `isActive`, bind `color` to the same condition as `a11yCurrent`, so the current entry gets a different colour than the others.
|
|
65
|
+
|
|
66
|
+
The other entries keep `<mapped>`, the colour the colour table above gives the button. An omitted `color` maps to `primary`, because `primary` is the default on both sides. The current entry gets `<current>`, which is `primary`. When `<mapped>` is `primary`, `<current>` is `secondary` instead.
|
|
67
|
+
|
|
68
|
+
Leave `inverted` as it is. An inverted button only has four looks of its own: `secondary`, `tertiary`, `ghost` and `link`. Every other colour (`primary`, `success`, `warning`, `danger`, `info`, every `brand-*`) shares one filled inverted look. So on an inverted button, `<current>` is `primary` when `<mapped>` is `secondary`, `tertiary`, `ghost` or `link`, and `secondary` otherwise.
|
|
69
|
+
|
|
70
|
+
- React: `color={cond ? '<current>' : '<mapped>'}`.
|
|
71
|
+
- Angular: `[color]="cond ? '<current>' : '<mapped>'"`.
|
|
72
|
+
- HTML with JavaScript: `el.color = cond ? '<current>' : '<mapped>'`.
|
|
73
|
+
- A true literal sets `color="<current>"`. A static navbar entry without `color` becomes `color="secondary"`.
|
|
74
|
+
|
|
75
|
+
The binding replaces the button's existing `color`. It never adds a second one. It uses only names of the new side, so the non-literal rule above does not apply to it. When the legacy `color` is itself a non-literal expression, there is no `<mapped>` to write. Apply the non-literal rule above to it, add no binding, and report the entry as a highlight to restore by hand.
|
|
76
|
+
|
|
62
77
|
### Shape: a named submit button stops submitting its name and value
|
|
63
78
|
|
|
64
79
|
In plain HTML a submit button's `name` and `value` are sent with the form, so the server can tell which button was pressed. `bal-button` rendered a real `<button type="submit" name="…" value="…">` in the page, so this worked.
|
|
@@ -85,9 +100,9 @@ Still rewrite the tag — the button keeps working, and a `(dsClick)` or `onDsCl
|
|
|
85
100
|
| `size="small"` | `size="sm"` | 32px on both sides. Also rewrite `size='small'`, `size={"small"}`, and `size={'small'}`. |
|
|
86
101
|
| `expanded` | `wide` | Rename. Same meaning: the button fills the available width. |
|
|
87
102
|
| `loading` | `loading` | Copy as-is. Behaviour change: `ds-button` also disables the native button while loading, where `bal-button` only hid the label and stayed clickable. Mention once, not per occurrence. |
|
|
88
|
-
| `outlined` | `outlined`
|
|
103
|
+
| `outlined` | _(no equivalent)_ | Drop it in every form (`outlined`, `outlined="true"`, `outlined={x}`, `[outlined]="x"`). `ds-button` has no `outlined` prop. Legacy `is-outlined` had no CSS, so nothing changes visually. Mention once that it was dropped. |
|
|
89
104
|
| `rounded` | _(no equivalent)_ | Drop it. Legacy `is-rounded` was real styling (a pill-shaped button); nothing replaces it. Mention each dropped occurrence. |
|
|
90
|
-
| `isActive` | `a11yCurrent` on a navigation entry, otherwise _(no equivalent)_ | Rewrite it only when the button is a navigation entry. It is one when it has `href`, its click handler navigates, or it sits in a navbar or nav menu. A static `is-active` or `isActive` (true literal) becomes `aria-current="page"` in HTML and `a11yCurrent="page"` in React and Angular. `ds-button` reads the HTML `aria-current` once on load and moves it to the native element. A bound value becomes `a11yCurrent={cond ? 'page' : undefined}` in React and `[a11yCurrent]="cond ? 'page' : ''"` in Angular. In HTML with JavaScript, a value that changes becomes `el.a11yCurrent = cond ? 'page' : ''`. Do not use `setAttribute('aria-current', …)`, because `ds-button` reads it only on load. Remove a false literal. `ds-button` forwards `a11yCurrent` as `aria-current` to the native element. The forced pressed look of legacy `is-active` is gone,
|
|
105
|
+
| `isActive` | `a11yCurrent` on a navigation entry, otherwise _(no equivalent)_ | Rewrite it only when the button is a navigation entry. It is one when it has `href`, its click handler navigates, or it sits in a navbar or nav menu. A static `is-active` or `isActive` (true literal) becomes `aria-current="page"` in HTML and `a11yCurrent="page"` in React and Angular. `ds-button` reads the HTML `aria-current` once on load and moves it to the native element. A bound value becomes `a11yCurrent={cond ? 'page' : undefined}` in React and `[a11yCurrent]="cond ? 'page' : ''"` in Angular. In HTML with JavaScript, a value that changes becomes `el.a11yCurrent = cond ? 'page' : ''`. Do not use `setAttribute('aria-current', …)`, because `ds-button` reads it only on load. Remove a false literal. `ds-button` forwards `a11yCurrent` as `aria-current` to the native element. The forced pressed look of legacy `is-active` is gone. On a navigation entry, also rewrite `color` as the current-navigation-entry section above describes. When the button is not a navigation entry, drop `isActive`. Its pressed look is lost. Mention each occurrence. |
|
|
91
106
|
| `balPopup` / the `bal-popup` attribute | leave the attribute | Leave the `bal-popup` attribute in every form (bare, `bal-popup="<id>"`, `[attr.bal-popup]`, `setAttribute('bal-popup', …)`) unchanged. The popup migration rewrites it to `data-popup`, because `ds-popup` finds its trigger through `data-popup="<id>"`. Report each one. Drop `[balPopup]` and `balPopup={…}` property bindings. The legacy prop was never reflected to the attribute, so those bindings did nothing on either side. |
|
|
92
107
|
| `icon`, `iconRight` | same | Copy the value, then apply the icon name rule from `shared/icons.md`. |
|
|
93
108
|
| `name`, `value` | same | Copy as-is. `ds-button`'s `value` is `string` where the legacy prop was `string \| number`. An HTML attribute is already a string and needs nothing; rewrite only the bound numeric forms, so React `value={7}` becomes `value="7"` and Angular `[value]="7"` becomes `value="7"`. A non-literal `value` binding: HTML copies it unchanged. React and Angular copy it when the expression's type only admits strings. Otherwise apply Unmapped props and handlers (`SKILL.md`). Flag per the named-submit-button section above. |
|
|
@@ -126,7 +141,7 @@ Leave the slotted label content in place. Both components project their children
|
|
|
126
141
|
|
|
127
142
|
No handler body needs rewriting beyond the event name — every detail shape is unchanged.
|
|
128
143
|
|
|
129
|
-
Retype handler parameters and refs as `SKILL.md` "Legacy types and bundles" describes. `BalEvents.BalButtonCustomEvent` and the bare `BalButtonCustomEvent` become `DsButtonCustomEvent`, and `HTMLBalButtonElement` becomes `HTMLDsButtonElement`. The scan lists the `BalEvents.BalButton*` and `BalButton*CustomEvent` types. It does not list `BalProps
|
|
144
|
+
Retype handler parameters and refs as `SKILL.md` "Legacy types and bundles" describes. `BalEvents.BalButtonCustomEvent` and the bare `BalButtonCustomEvent` become `DsButtonCustomEvent`, and `HTMLBalButtonElement` becomes `HTMLDsButtonElement`. The scan lists the `BalEvents.BalButton*` and `BalButton*CustomEvent` types. It lists `HTMLBalButtonElement` too. It does not list `BalProps.*`, so search for them yourself in each file with a finding.
|
|
130
145
|
|
|
131
146
|
In each file that has a finding, also rewrite these five listeners where they are not on the element itself, including `addEventListener`. For every finding in a `.html` file, also open the same-basename `.ts` file beside it and apply these rules there — the Angular case where the template holds the tag and the class file handles the event without ever naming `bal-button`.
|
|
132
147
|
|
|
@@ -149,7 +164,7 @@ Needs your attention when found:
|
|
|
149
164
|
5. Every `color` left as a non-literal expression for manual remapping, with the framework outcome (left in HTML, kept or removed (Unmapped) in React and Angular).
|
|
150
165
|
6. Every `element-type="submit"` with `name` or `value`, flagged "name/value no longer reach the submitted form data".
|
|
151
166
|
7. Every dropped `rounded`.
|
|
152
|
-
8. Every `isActive` on a navigation entry rewritten to `a11yCurrent`, flagged "the forced pressed look is gone",
|
|
167
|
+
8. Every `isActive` on a navigation entry rewritten to `a11yCurrent`, flagged "the forced pressed look is gone", with the `color` binding that now marks the current entry, or "highlight not restored, non-literal `color`" when no binding was added. Every other `isActive` dropped, flagged "pressed look lost, check whether it was a toggle".
|
|
153
168
|
9. Every `href=""` that is now a `<button>` instead of an `<a>`.
|
|
154
169
|
10. One-time note: `loading` now also disables the button.
|
|
155
170
|
11. One-time note: files which only listen, and have no scanned `.html` of the same name beside them, were not scanned.
|
|
@@ -161,7 +176,7 @@ Coverage only, written to the file:
|
|
|
161
176
|
14. Every dropped `[balPopup]` or `balPopup={…}` binding.
|
|
162
177
|
15. Every numeric `value` written as a string, and every non-literal `value` binding with its outcome: copied, or removed (Unmapped).
|
|
163
178
|
16. Every `BalButtonBundle` expanded into `DsButton` and `DsButtonGroup`.
|
|
164
|
-
17. One-time note: `outlined`
|
|
179
|
+
17. One-time note: every `outlined` was dropped. It had no visual effect, and `ds-button` has no such prop.
|
|
165
180
|
|
|
166
181
|
Leave every change unstaged for the consumer to review, including `ds-migration-report.md`. Stop. Do not run `git add` or `git commit`.
|
|
167
182
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Migrate every `bal-carousel` usage to `ds-carousel`. Init has already added the `@helvetia-design/*` packages. This task rewrites usages only.
|
|
4
4
|
|
|
5
|
-
The legacy folder has one child element: `bal-carousel-item` becomes `ds-carousel-item`. Legacy items had no identifier; `ds-carousel-item` requires a unique `name`, so the rewrite synthesizes one. Legacy
|
|
5
|
+
The legacy folder has one child element: `bal-carousel-item` becomes `ds-carousel-item`. Legacy items had no identifier; `ds-carousel-item` requires a unique `name`, so the rewrite synthesizes one. Legacy product tiles (`color` and `label` both set on the item) rendered their own link or button; `ds-carousel-item` renders neither, so the rewrite moves that markup into the slot. `controls` and `interface` both shrink to a smaller set of values on the new side, described under Shape and under Props below.
|
|
6
6
|
|
|
7
7
|
## 1. Scan
|
|
8
8
|
|
|
@@ -60,25 +60,35 @@ Legacy `value` on `bal-carousel` is a 0-based slide **index**. `ds-carousel`'s `
|
|
|
60
60
|
|
|
61
61
|
### Shape: `bal-carousel-item` link and button rewrite
|
|
62
62
|
|
|
63
|
-
Legacy `bal-carousel-item` rendered its own `<a>`
|
|
63
|
+
Legacy `bal-carousel-item` rendered its own `<a>` or `<button>` only when the item had both `color` and `label`. The compiled render logic in `@baloise/ds-core` (`bal-carousel-item.js`) reads `const isProduct = !!this.color && !!this.label;`. The gate is read statically, before any `color="white"` drop: a literal attribute with a non-empty value counts as set, and so does an attribute bound to an expression, because the migration cannot read its runtime value. Legacy read it at runtime, and `label` defaults to `''`, so an expression that is empty rendered a plain host. Treat an expression-bound `color` or `label` as set, and report the item, so the consumer confirms the wrapper belongs there. `ds-carousel-item` renders neither element and is always a plain host, so the rewrite slots the interactive element itself, and only for product tiles.
|
|
64
64
|
|
|
65
|
-
When `
|
|
65
|
+
When the item does not have both `color` and `label`, add no wrapper. Legacy rendered a plain host with the slot and ignored `href`, `target`, `rel`, `download`, `elementType`, the form `name` and `value`. Rewrite the item as plain slot content and drop those attributes in every framework, HTML included, because a form `name` would clash with the synthesized `name`. This is a row-prescribed drop, so the cleanup bullets of Unmapped props and handlers (`SKILL.md`) apply to declarations that become unused.
|
|
66
66
|
|
|
67
67
|
```html
|
|
68
68
|
<!-- before -->
|
|
69
|
-
<bal-carousel-item
|
|
70
|
-
<
|
|
69
|
+
<bal-carousel-item value="3" label="Car">
|
|
70
|
+
<ds-card>...</ds-card>
|
|
71
71
|
</bal-carousel-item>
|
|
72
72
|
|
|
73
|
+
<!-- after -->
|
|
74
|
+
<ds-carousel-item name="item-1">
|
|
75
|
+
<ds-card>...</ds-card>
|
|
76
|
+
</ds-carousel-item>
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
When the item has both `color` and `label` and an `href`: wrap the item's slot content in a literal `<a>`, carrying over `href`, `target`, `rel`, and `download` unchanged, and add the new `navigation` prop to `ds-carousel-item` (it marks the item as "a consumer-provided `<a>` makes this tile interactive"). The `label` moves into the slot per the `label` row, here inside the `<a>` before any existing slot content.
|
|
80
|
+
|
|
81
|
+
```html
|
|
82
|
+
<!-- before -->
|
|
83
|
+
<bal-carousel-item color="green" label="Auto" href="/auto" target="_self"></bal-carousel-item>
|
|
84
|
+
|
|
73
85
|
<!-- after -->
|
|
74
86
|
<ds-carousel-item name="item-1" color="green" navigation>
|
|
75
|
-
<a href="/auto" target="_self">
|
|
76
|
-
<span>Auto</span>
|
|
77
|
-
</a>
|
|
87
|
+
<a href="/auto" target="_self">Auto</a>
|
|
78
88
|
</ds-carousel-item>
|
|
79
89
|
```
|
|
80
90
|
|
|
81
|
-
When
|
|
91
|
+
When the item has both `color` and `label` but no `href`: wrap the slot content in a literal `<button>` instead, with the `label` moved in the same way. Legacy rendered this button for every such item, because `elementType` defaults to `button`. Set `type` to the item's `elementType`, or to `button` when it has none. Carry over `name` (the button's form name, distinct from the `name` synthesized above for `ds-carousel-item` itself) and `value` (the button's form value) only when they are set. Do not add `navigation` in this case. The new component's documentation never shows a button-wrapped tile, so flag every occurrence for manual visual and behavior review.
|
|
82
92
|
|
|
83
93
|
### `controls`
|
|
84
94
|
|
|
@@ -123,9 +133,9 @@ When there is no `href` but `elementType`, `name` (the button's form name — di
|
|
|
123
133
|
| `color="green"` / `"yellow"` / `"red"` / `"purple"` | same value | Copy as-is. |
|
|
124
134
|
| `color="white"` | _(no equivalent)_ | Drop it. `ds-carousel-item`'s `color` has no `white` value. Mention each dropped occurrence. |
|
|
125
135
|
| `svg` | _(no equivalent prop)_ | Drop it. The new pattern is slotting a `<ds-brand-icon src="...">` component instead of inline SVG markup. Do not attempt to auto-generate that markup from the raw SVG string — flag every occurrence for manual rewrite. |
|
|
126
|
-
| `label` | slot text, or dropped |
|
|
136
|
+
| `label` | slot text, or dropped | On a product tile (`color` and `label` both set), legacy showed the label as visible text before the slot. Move the `label` value into the slot as plain text, inside the wrapper and before any existing slot content, and drop the attribute. On every other item, legacy used `label` only as the host's aria-label. Drop `label` and report the lost custom aria-label. These items now get an automatic `aria-label="Slide N"` instead. |
|
|
127
137
|
| `htmlRole` / `html-role` | _(no equivalent)_ | Drop it. Already `@deprecated`. Mention each dropped occurrence. |
|
|
128
|
-
| `elementType`, item `name` (form name), `value` (form value), `href`, `target`, `rel`, `download` | — | Handled under Shape above, not here
|
|
138
|
+
| `elementType`, item `name` (form name), `value` (form value), `href`, `target`, `rel`, `download` | — | Handled under Shape above, not here. They determine the wrapper only on product tiles (`color` and `label` both set) and are dropped on every other item. |
|
|
129
139
|
|
|
130
140
|
### Tags and imports
|
|
131
141
|
|
|
@@ -139,9 +149,9 @@ When there is no `href` but `elementType`, `name` (the button's form name — di
|
|
|
139
149
|
| --- | --- | --- |
|
|
140
150
|
| `balChange` | `dsChange` | Rewrite `addEventListener('balChange'` to `addEventListener('dsChange'`. Angular: `(balChange)` becomes `(dsChange)`. React: `onBalChange` becomes `onDsChange`. |
|
|
141
151
|
| event `detail` | `{ value: string }` | Legacy sent the new slide index as a number. `ds-carousel` sends the active item's name (`item-N`). When the handler body is in the same file (inline arrow, named function, Angular class method bound by `(balChange)`, `addEventListener` callback), rewrite every `.detail` read to `.detail.value`, for example `({ detail }) => f(detail)` becomes `({ detail }) => f(detail.value)`. When the handler uses the read as a number (`Number(...)`, arithmetic, a numeric state setter), `.detail.value` alone gives `'item-2'` or `NaN`. Convert the synthesized name back to the 0-based index instead: `setSlide(event.detail)` becomes `setSlide(Number(event.detail.value.slice('item-'.length)) - 1)`. A parameter typed `CustomEvent<number>` becomes `CustomEvent<{ value: string }>`. Report each rewritten handler, because the bound `value` must now hold the name, not the index. A handler in another file, one whose body you cannot see, or one also bound to an element you did not migrate stays as it is and is reported. |
|
|
142
|
-
| `balNavigate` | `click` |
|
|
143
|
-
| `balFocus` | `focus` |
|
|
144
|
-
| `balBlur` | `blur` | Same rule as `
|
|
152
|
+
| `balNavigate` | `click` | Legacy fired it only on product tiles with an `href`. On those tiles, rewritten into a wrapped `<a>` per the Shape section, move the listener onto that element. On every other item, a button-wrapped product tile included, legacy never fired the event, so remove the binding and apply the cleanup bullets of Unmapped props and handlers. Rewrites for the `<a>`: `addEventListener('balNavigate'` → `addEventListener('click'`, Angular `(balNavigate)` → `(click)`, React `onBalNavigate` → `onClick`. |
|
|
153
|
+
| `balFocus` | `focus` | Legacy fired it on every product tile. Move the listener onto the wrapped `<a>` or `<button>`, targeting `focus`. On every other item, remove the binding as for `balNavigate`. |
|
|
154
|
+
| `balBlur` | `blur` | Same rule as `balFocus`, targeting `blur`. |
|
|
145
155
|
|
|
146
156
|
### Methods
|
|
147
157
|
|
|
@@ -176,23 +186,25 @@ Needs your attention when found:
|
|
|
176
186
|
11. Every dropped `scrollY` that was `false`.
|
|
177
187
|
12. Every dropped `border`.
|
|
178
188
|
13. Every dropped `space`, with a pointer to the `--carousel-gap` CSS custom property.
|
|
179
|
-
14. Every
|
|
189
|
+
14. Every product tile rewritten into a wrapped `<button>`, flagged for visual and behaviour review.
|
|
180
190
|
15. Every dropped `color="white"`.
|
|
181
191
|
16. Every dropped `svg`, with the guidance to slot a `ds-brand-icon` instead.
|
|
182
|
-
17. Every `label` dropped
|
|
183
|
-
18. Every `balNavigate`, `balFocus` or `balBlur` rewritten to a native event on the wrapped element.
|
|
192
|
+
17. Every `label` dropped from an item that is not a product tile. The custom aria-label is lost.
|
|
193
|
+
18. Every `balNavigate`, `balFocus` or `balBlur` rewritten to a native event on the wrapped element, and every such binding removed from an item where legacy never fired it.
|
|
184
194
|
19. Every handler whose `detail` read was rewritten to `detail.value`. The value is now the item name (`item-N`), not a 0-based index, so state that stores an index must change. Also every handler left as it is because its body is in another file, named by file and line.
|
|
185
195
|
20. Every `previous()`, `next()` or `setFocus()` call, with its Unmapped props and handlers outcome. For `previous()` and `next()`, name the `el.value = 'item-N'` option, which moves the active dot but does not scroll.
|
|
186
|
-
21.
|
|
196
|
+
21. Every item treated as a product tile because its `color` or `label` is bound to an expression, whose runtime value the migration cannot read. When that expression is empty at runtime, legacy rendered a plain host, so the wrapper does not belong.
|
|
197
|
+
22. 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.
|
|
187
198
|
|
|
188
199
|
Coverage only, written to the file:
|
|
189
200
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
201
|
+
23. Every synthesized `ds-carousel-item` name.
|
|
202
|
+
24. Every `value` rewritten from an index to a name.
|
|
203
|
+
25. Every dropped `controlsSticky`.
|
|
204
|
+
26. Every dropped `htmlRole`.
|
|
205
|
+
27. Every product tile rewritten into a wrapped `<a>`, with `navigation` added.
|
|
206
|
+
28. Every `label` moved into a product tile's slot as plain text.
|
|
207
|
+
29. Every `href`, `target`, `rel`, `download`, `elementType`, form `name` or `value` dropped from an item without both `color` and `label`, which legacy ignored.
|
|
196
208
|
|
|
197
209
|
Leave every change unstaged for the consumer to review, including `ds-migration-report.md`. Stop. Do not run `git add` or `git commit`.
|
|
198
210
|
|
|
@@ -4,7 +4,7 @@ Migrate every `bal-checkbox` usage to `ds-checkbox`, and every `bal-checkbox-gro
|
|
|
4
4
|
|
|
5
5
|
Both legacy tags are migrated together, not separately. `bal-checkbox-group` drives its children with `this.el.querySelectorAll('bal-checkbox')`; rewriting the children to `ds-checkbox` while leaving a `bal-checkbox-group` parent untouched would silently break that cascade, because the old group would stop finding its own children. `ds-checkbox-group` has the matching `querySelectorAll('ds-checkbox')` wiring, so the parent and its children are always rewritten in the same pass.
|
|
6
6
|
|
|
7
|
-
`bal-check` and `bal-switch` are two more tags in the legacy folder. They are display-only indicators, not form controls, and `ds-*` has no equivalent. The scan lists them so they are not missed, but they are never rewritten. See "Legacy indicators: `bal-check` and `bal-switch`" below.
|
|
7
|
+
`bal-check` and `bal-switch` are two more tags in the legacy folder. They are display-only indicators, not form controls, and `ds-*` has no equivalent. The scan lists them so they are not missed, but they are never rewritten. `scan-migratable.mjs` counts them under `byHand` as `check` and `switch`, not under `suggested`, so they must be replaced by hand. See "Legacy indicators: `bal-check` and `bal-switch`" below.
|
|
8
8
|
|
|
9
9
|
Apply `shared/field.md` in the Rewrite step to every migrated `ds-checkbox`, `ds-checkbox-group` or `ds-toggle` (a `bal-checkbox` with `interface="switch"` becomes `ds-toggle`) 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.
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ Apply `shared/field.md` in the Rewrite step to every migrated `ds-checkbox`, `ds
|
|
|
16
16
|
node <this-skill-directory>/scripts/scan-bal-checkbox.mjs <project-root>
|
|
17
17
|
```
|
|
18
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`. The scan also matches bare `newBalCheckboxOption` calls, since a file can build the dropped `options` array (see Props below) without ever naming a tag. It also matches `bal-check`, `bal-switch`, `BalCheck` and `BalSwitch`. It lists `BalCheckboxBundle` and the `BalEvents.BalCheckbox*` and `BalCheckbox*CustomEvent` types too. It does not match the ambient `
|
|
19
|
+
The script prints one JSON object. `total` is the number of findings. `files` groups them by path. Each finding has `line` and `snippet`. The scan also matches bare `newBalCheckboxOption` calls, since a file can build the dropped `options` array (see Props below) without ever naming a tag. It also matches `bal-check`, `bal-switch`, `BalCheck` and `BalSwitch`. It lists `BalCheckboxBundle` and the `BalEvents.BalCheckbox*` and `BalCheckbox*CustomEvent` types too. It lists `HTMLBalCheckboxElement` too. It does not match the ambient `BalProps.BalCheckbox*` types, so search for them yourself in each file with a finding. `SKILL.md` "Legacy types and bundles" says how to rewrite all of them.
|
|
20
20
|
|
|
21
21
|
Some findings carry one extra flag. A flag is only present when it is true, so most findings have only `line` and `snippet`. A forms binding below means `formControlName`, `formControl` or `ngModel` in any binding form, such as `[formControl]` or `[(ngModel)]`. A bound `value` means Angular `[value]` or React `value={…}`.
|
|
22
22
|
|
|
@@ -43,7 +43,7 @@ Done when the user has answered.
|
|
|
43
43
|
|
|
44
44
|
## 3. Rewrite
|
|
45
45
|
|
|
46
|
-
Edit each finding yourself, using the mapping below. Read the whole element when attributes continue past the snippet's first line, and read the whole `bal-checkbox-group` (not just a scanned child tag) before deciding how to rewrite it
|
|
46
|
+
Edit each finding yourself, using the mapping below. Read the whole element when attributes continue past the snippet's first line, and read the whole `bal-checkbox-group` (not just a scanned child tag) before deciding how to rewrite it. `interface` cascades from the group down to its children, and the tile layout props (`tile`, `hideTrigger`, `cols*`) are decided at group level. This step is finished when every finding matches the mapping.
|
|
47
47
|
|
|
48
48
|
### Shape: `interface` no longer exists — it splits three ways
|
|
49
49
|
|
|
@@ -52,9 +52,11 @@ Legacy `interface` (`'checkbox' | 'switch' | 'button' | 'tile'`) lived on `bal-c
|
|
|
52
52
|
| old `interface` | new | handling |
|
|
53
53
|
| --- | --- | --- |
|
|
54
54
|
| omitted, `"checkbox"` | omit `tile` | Default on both sides. Copy every other prop as-is. |
|
|
55
|
-
| `"tile"` | `tile`
|
|
55
|
+
| `"tile"` | `tile` + `hideTrigger` on `ds-checkbox-group` | A bordered card layout. Legacy drew no indicator on a tile. See Shape: tile below. See the `color` row below for the tile colour. |
|
|
56
56
|
| `"switch"` | tag becomes `ds-toggle` | See Shape: switch below. This is a tag change, not a prop rewrite. |
|
|
57
|
-
| `"button"` | `tile`
|
|
57
|
+
| `"button"` | `tile` on `ds-checkbox-group` | See Shape: button below. This is a visual approximation, not an exact match. |
|
|
58
|
+
|
|
59
|
+
`ds-checkbox-group` overwrites `tile`, `hideTrigger`, `cols`, `colsTablet` and `colsMobile` on every `ds-checkbox` child, also on children added later through `slotchange`, so `*ngFor` and `.map` 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 every non-switch child carries the same value. When the children of one group carry different `interface` values, or values that differ from the group, write nothing on the group and report it. A group renders all children the same way. A child with `interface="switch"` still becomes a `ds-toggle` as Shape: switch describes, because the group does not touch a `ds-toggle`. A standalone `bal-checkbox` outside any group keeps `tile` and `hideTrigger` on itself, as the Shape sections below map them, because no group overwrites it. A wrapper `ds-checkbox-group` that the migration adds around a single checkbox (a forms binding, a `bal-field` label or a following `bal-field-message`) gets the checkbox's `name`, `tile` and `hideTrigger` instead of the checkbox, as the Shape sections below map them. The wrapper also overwrites `name` on its child, and without its own `name` it writes a generated id there, so the form would submit the checkbox under that id. It defaults `tile` to `false` and would overwrite that too.
|
|
58
60
|
|
|
59
61
|
### Shape: `interface="switch"` becomes a `ds-toggle`
|
|
60
62
|
|
|
@@ -72,7 +74,7 @@ Legacy `interface` (`'checkbox' | 'switch' | 'button' | 'tile'`) lived on `bal-c
|
|
|
72
74
|
</ds-checkbox-group>
|
|
73
75
|
```
|
|
74
76
|
|
|
75
|
-
Carry over `name`, `value`, `checked`, `disabled`, `readonly`, `required`, `invalid`, `autoInvalidOff`, and the label content unchanged — `ds-toggle` has all of them. Drop `interface`, `tile`, `
|
|
77
|
+
Carry over `name`, `value`, `checked`, `disabled`, `readonly`, `required`, `invalid`, `autoInvalidOff`, and the label content unchanged — `ds-toggle` has all of them. Drop `interface`, `tile`, `color`, `flat`, `labelHidden`, and `nonSubmit`, and write no `tile-color`: `ds-toggle` has no concept of any of them (it is never a tile, and it is always submitted with the form).
|
|
76
78
|
|
|
77
79
|
A switch inside a group needs one of three rules. Read the whole group first.
|
|
78
80
|
|
|
@@ -80,11 +82,17 @@ A switch inside a group needs one of three rules. Read the whole group first.
|
|
|
80
82
|
- The group has `control`, but no bound `value` and no forms binding. Examples are `control value="news"` or `control` with a `balChange` handler on the group. Still rewrite the tag to `ds-toggle`, and report it with exactly this note: **"visual benefit persists, but value binding breaks"**. `ds-checkbox-group` finds its children with `this.el.querySelectorAll('ds-checkbox')`, so it never sees a `ds-toggle`. The static `value` no longer checks the toggle, and the group's `dsChange` array no longer includes it.
|
|
81
83
|
- Any other group is used only for layout, label or fieldset. This is the common case, and the legacy `Switch` story is one. It needs no report, because nothing read the switch state through the group.
|
|
82
84
|
|
|
83
|
-
### Shape: `interface="
|
|
85
|
+
### Shape: `interface="tile"` becomes `tile` + `hideTrigger`
|
|
86
|
+
|
|
87
|
+
Legacy `bal-checkbox` drew no indicator on a tile. Its selected state was only the border color. A `bal-check` that the consumer put in the tile body was the only indicator such a tile showed. `ds-checkbox` shows its trigger in every mode and hides it only when both `tile` and `hideTrigger` are set.
|
|
88
|
+
|
|
89
|
+
So `"tile"` always becomes `tile` + `hideTrigger`. Never add `hideTrigger` for `"button"`. A plain tile then shows no indicator, as in legacy. A `bal-check` left in the tile body stays, and it is the tile's one indicator. Without `hideTrigger` that tile would show two. When the consumer later replaces that `bal-check` by hand, removing `hideTrigger` lets `ds-checkbox` draw its own trigger.
|
|
90
|
+
|
|
91
|
+
### Shape: `interface="button"` becomes `tile`
|
|
84
92
|
|
|
85
|
-
The legacy `button` look (set on `bal-checkbox-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.
|
|
93
|
+
The legacy `button` look (set on `bal-checkbox-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. Legacy drew a `bal-check` in each button, inverted when checked. `tile` does not reproduce the layout: `ds-checkbox-group`'s 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.
|
|
86
94
|
|
|
87
|
-
Rewrite anyway, as the closest available approximation: add `tile`
|
|
95
|
+
Rewrite anyway, as the closest available approximation: add `tile` to the group only. Do not add `hideTrigger`. The `ds-checkbox` trigger then draws the check mark that legacy drew. A standalone `bal-checkbox` outside any group keeps `tile` on itself. Carry over `color` on individual children as the `tile-color` attribute (see the `color` row below). `bal-checkbox-group` has no `color`, so only children carry it. 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. The check mark stays.
|
|
88
96
|
|
|
89
97
|
### Switch group with a bound value
|
|
90
98
|
|
|
@@ -96,7 +104,7 @@ Rewrite the group like this instead:
|
|
|
96
104
|
- When the group has a field label from a surrounding `bal-field`, put that text on the div as `aria-label`. `shared/field.md` removes the wrapper as usual.
|
|
97
105
|
- The label can also come from a label element right before the group, such as a `bal-label` or `BalLabel` with the group's heading text. Give that label an `id` and put `aria-labelledby` with that `id` on the div. Or put its text on the div as `aria-label`.
|
|
98
106
|
- Drop `interface`, `control`, `value` and the forms binding from the group, together with its `balChange` handler. Also drop `vertical`, because the div already stacks the toggles vertically. Move the group's `name` to every child that has none.
|
|
99
|
-
- Each switch child becomes a standalone `ds-toggle` with its own `checked` binding, derived from the array. A switch child is a child with its own `interface="switch"`, or any child of a group with `interface="switch"`, because the group's `interface` cascades. Only a child without its own `interface="switch"` in a group without `interface="switch"` becomes a standalone `ds-checkbox`, with the same bindings.
|
|
107
|
+
- Each switch child becomes a standalone `ds-toggle` with its own `checked` binding, derived from the array. A switch child is a child with its own `interface="switch"`, or any child of a group with `interface="switch"`, because the group's `interface` cascades. Only a child without its own `interface="switch"` in a group without `interface="switch"` becomes a standalone `ds-checkbox`, with the same bindings. It keeps its own `tile` and `hideTrigger`, and the group's `interface` moves onto it, because no group overwrites it. `"tile"` gives it `tile` and `hideTrigger`. `"button"` gives it `tile` only.
|
|
100
108
|
|
|
101
109
|
React:
|
|
102
110
|
|
|
@@ -163,7 +171,7 @@ So every `ds-checkbox-group` with `formControlName`, `formControl`, `ngModel` or
|
|
|
163
171
|
`@helvetia-design/angular` exports value accessors for `DsCheckboxGroup` and `DsToggle`, but not for `DsCheckbox`. `formControlName`, `formControl` or `ngModel` on a `ds-checkbox` throws "No value accessor" at runtime. Rewrite a `bal-checkbox` with a forms binding (scan flag `formsBinding`) one of two ways:
|
|
164
172
|
|
|
165
173
|
- With `interface="switch"`, rewrite it to `ds-toggle` and keep the binding on it. `DsToggle` has a value accessor, and the value stays a boolean.
|
|
166
|
-
- Otherwise, wrap it in `<ds-checkbox-group control>` and move the binding to the group. The checkbox keeps its `value`. The form value changes from a boolean to an array: unchecked is `[]`, checked is `[value]`. A checkbox without `value` puts `'on'` into the array. Change the form control's initial value from `false` to `[]` and from `true` to `[value]` in the same-basename `.ts`, and fix every place that reads it as a boolean. `Validators.requiredTrue` becomes `Validators.required`, which fails on an empty array. Report the type change.
|
|
174
|
+
- Otherwise, wrap it in `<ds-checkbox-group control>` and move the binding to the group. The checkbox keeps its `value`. Its `name` moves to the wrapper. With `interface="tile"`, `tile` and `hideTrigger` go on the wrapper, not on the checkbox. With `interface="button"`, only `tile` goes on the wrapper. The form value changes from a boolean to an array: unchecked is `[]`, checked is `[value]`. A checkbox without `value` puts `'on'` into the array. Change the form control's initial value from `false` to `[]` and from `true` to `[value]` in the same-basename `.ts`, and fix every place that reads it as a boolean. `Validators.requiredTrue` becomes `Validators.required`, which fails on an empty array. Report the type change.
|
|
167
175
|
|
|
168
176
|
```html
|
|
169
177
|
<!-- before -->
|
|
@@ -187,15 +195,15 @@ Until `DsCheckbox` has a value accessor, this is the only path that works. A sin
|
|
|
187
195
|
|
|
188
196
|
### Legacy indicators: `bal-check` and `bal-switch`
|
|
189
197
|
|
|
190
|
-
`bal-check` and `bal-switch` draw a check mark or a switch from `checked`, `disabled`, `invalid` and `inverted`. `hovered` and `pressed` are internal. They are not form controls, and `ds-*` has no equivalent. Leave every `bal-check`, `bal-switch`, `BalCheck` and `BalSwitch` exactly as it is, and keep their symbols on the `@baloise` import. Report each one by file and line as "no `ds-*` equivalent, needs manual rework". Do not add a comment to the consumer's code.
|
|
198
|
+
`bal-check` and `bal-switch` draw a check mark or a switch from `checked`, `disabled`, `invalid` and `inverted`. `hovered` and `pressed` are internal. They are not form controls, and `ds-*` has no equivalent. Leave every `bal-check`, `bal-switch`, `BalCheck` and `BalSwitch` exactly as it is, and keep their symbols on the `@baloise` import. Report each one by file and line as "no `ds-*` equivalent, needs manual rework". Do not add a comment to the consumer's code. `scan-migratable.mjs` keeps listing them under `byHand` until someone replaces them by hand, and while they are left the legacy config call stays (see `shared/legacy-config.md`). A `bal-check` in a migrated tile body also stays. It is the tile's only indicator, because the tile got `hideTrigger`. When you replace it by hand, delete it and remove `hideTrigger`.
|
|
191
199
|
|
|
192
200
|
### Props: `bal-checkbox` → `ds-checkbox`
|
|
193
201
|
|
|
194
202
|
| old | new (`ds-checkbox`) | handling |
|
|
195
203
|
| --- | --- | --- |
|
|
196
204
|
| `name`, `value`, `checked`, `disabled`, `readonly`, `required`, `autoInvalidOff`, `invalid` | same | Copy as-is. |
|
|
197
|
-
| `color` | `
|
|
198
|
-
| `colSize` / `colSizeTablet` / `colSizeMobile` (`@internal`) | `cols` / `colsTablet` / `colsMobile` (
|
|
205
|
+
| `color` | `tile-color` attribute | Write it as an attribute in every framework. Static `color="red"` becomes `tile-color="red"`. Angular `[color]="x"` becomes `[attr.tile-color]="x"`, or `[attr.tile-color]="x ? x : null"` when `x` can be `''`, so no empty attribute is set. React `color={x}` becomes `tile-color={x}`, with `undefined` for an empty value. Never write the `tileColor` property or a `[tileColor]` binding on a child. `tileColor` is not reflected, and the group reads only the `tile-color` attribute of a child, so a property is replaced by the group's value. Only meaningful when `tile` is set. Legacy also accepted `color=""`; `ds-checkbox` only knows `purple`, `green`, `yellow` and `red`, so drop an empty `color` instead of writing `tile-color=""`. A single static colour shared by every child of a group may move to the group's `tileColor` instead. |
|
|
206
|
+
| `colSize` / `colSizeTablet` / `colSizeMobile` (`@internal`), `col-size*` attributes, Angular `[attr.col-size*]` and `[colSize*]` bindings | _(none on the child)_ | Drop from the child. The group's `cols` / `colsTablet` / `colsMobile` (from `columns*`) decide the layout. When all children of a group agree and the group has no `columns*`, write that value as the group's `cols*`. Otherwise report each child value that differs from the group's columns or from its siblings. |
|
|
199
207
|
| `labelHidden` | _(no equivalent)_ | Drop it. `ds-checkbox` always renders its label slot. Mention each dropped occurrence. |
|
|
200
208
|
| `flat` | _(no equivalent)_ | Drop it. Mention each dropped occurrence. |
|
|
201
209
|
| `nonSubmit` | _(no equivalent)_ | Drop it. `ds-checkbox` is always `formAssociated` and always submitted with the form. Mention each dropped occurrence. |
|
|
@@ -206,12 +214,14 @@ Until `DsCheckbox` has a value accessor, this is the only path that works. A sin
|
|
|
206
214
|
| old | new (`ds-checkbox-group`) | handling |
|
|
207
215
|
| --- | --- | --- |
|
|
208
216
|
| `control`, `name`, `vertical`, `disabled`, `readonly`, `invalid`, `value`, `autoInvalidOff` | same | Copy as-is. Add `control` when the group has a forms binding or a bound `value`; see Bound groups need `control`. |
|
|
209
|
-
| `columns` / `columnsTablet` / `columnsMobile` | `cols` / `colsTablet` / `colsMobile` | Rename. |
|
|
217
|
+
| `columns` / `columnsTablet` / `columnsMobile` | `cols` / `colsTablet` / `colsMobile` | Rename. Set on the group only. The group overwrites `cols*` on every child. |
|
|
210
218
|
| `options` (array of `newBalCheckboxOption(...)`) | _(no equivalent)_ | Drop it. `ds-checkbox-group` only supports slotted `ds-checkbox`/`ds-toggle` children, not a declarative array. This cannot be auto-generated from an arbitrary JS array at scan time — flag every `options`/`newBalCheckboxOption` occurrence for manual conversion into slotted children. |
|
|
211
219
|
| `verticalOnMobile` | _(no equivalent)_ | Drop it. Mention each dropped occurrence. |
|
|
212
220
|
| `expanded` | _(no equivalent)_ | Drop it. Mention each dropped occurrence. |
|
|
213
221
|
| _(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-checkbox-group` is excluded from the required default rule in `SKILL.md`. Mention once, not per-occurrence, that this new prop exists. |
|
|
214
|
-
| _(none — new props)_ | `label`, `description`, `invalidText`, `loading`, `color` | New capabilities, nothing to migrate from legacy. `bal-checkbox-group` had neither `label` nor `color`. Leave them unset,
|
|
222
|
+
| _(none — new props)_ | `label`, `description`, `invalidText`, `loading`, `color` | New capabilities, nothing to migrate from legacy. `bal-checkbox-group` had neither `label` nor `color`. Leave them unset. `color` here is the group's input colour, not the tile colour. Do not carry a child's `color` onto the group's `color`. |
|
|
223
|
+
| `interface` (`"tile"`, `"button"`, `"switch"`) | `tile`, `hideTrigger` | Set on the group only, as Shape describes. `"tile"` becomes `tile` + `hideTrigger`. `"button"` becomes `tile` only. The group overwrites both on every child. `"switch"` follows Shape: switch. |
|
|
224
|
+
| _(none — new prop)_ | `tileColor` | A fallback for children without a `tile-color` attribute. It does not override a child's `tile-color`. |
|
|
215
225
|
|
|
216
226
|
### Tags and imports
|
|
217
227
|
|
|
@@ -264,21 +274,23 @@ Needs your attention when found:
|
|
|
264
274
|
4. Every `ds-checkbox-group` where the migration added `control` because it has a forms binding, a bound `value` or a rewritten `setValue()` call. Leave out the wrapper groups around a single checkbox, which item 3 already reports.
|
|
265
275
|
5. Every `setValue()` call on a `bal-checkbox-group` ref, with the rewrite it got: the form control, the model property, or `el.value` plus `control`. For `el.value`, note that no `dsChange` fires.
|
|
266
276
|
6. Every `bal-check`, `bal-switch`, `BalCheck` or `BalSwitch` left in place because it has no `ds-*` equivalent. Name file and line for each.
|
|
267
|
-
7. Every `interface="button"` rewritten to `tile
|
|
268
|
-
8. Every
|
|
269
|
-
9. Every
|
|
270
|
-
10. Every dropped `
|
|
271
|
-
11. Every dropped `
|
|
272
|
-
12. Every dropped `
|
|
273
|
-
13. Every dropped `
|
|
274
|
-
14. Every
|
|
275
|
-
15.
|
|
276
|
-
16. Every
|
|
277
|
+
7. Every `interface="button"` rewritten to `tile`, with its "slight design deviation" note.
|
|
278
|
+
8. Every `interface="tile"` group or standalone checkbox that got `hideTrigger`. Name each tile body that still holds a `bal-check`, which is now its only indicator.
|
|
279
|
+
9. 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.
|
|
280
|
+
10. Every dropped `labelHidden`. The label is now visible.
|
|
281
|
+
11. Every dropped `flat`.
|
|
282
|
+
12. Every dropped `nonSubmit`. The checkbox is now always submitted with the form.
|
|
283
|
+
13. Every dropped `verticalOnMobile`.
|
|
284
|
+
14. Every dropped `expanded`.
|
|
285
|
+
15. Every dropped `options` or `newBalCheckboxOption`, flagged for manual conversion to slotted children, together with every `getOptionByValue()` call tied to it and its Unmapped props and handlers outcome.
|
|
286
|
+
16. Every `setFocus()`, `setBlur()`, `getInputElement()` or `getOption()` call, with its Unmapped props and handlers outcome.
|
|
287
|
+
17. One-time note: the scan reports `setValue()` on a ref typed `HTMLBalCheckboxGroupElement` 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.
|
|
288
|
+
18. Every legacy type left or written out and every bundle kept, as `SKILL.md` "Legacy types and bundles" describes: each `BalProps.BalCheckbox*` type left in place, each detail alias such as `BalEvents.BalCheckboxChangeDetail` written out, each `BalCheckboxBundle` spread kept because a `bal-check` or `bal-switch` is left, and each multi-family bundle kept.
|
|
277
289
|
|
|
278
290
|
Coverage only, written to the file:
|
|
279
291
|
|
|
280
|
-
|
|
281
|
-
|
|
292
|
+
19. Every `interface="switch"` rewritten to `ds-toggle`.
|
|
293
|
+
20. One-time note, for groups outside a `bal-field` only: `ds-checkbox-group` defaults its new `required` prop to `true`, and the migration left it alone. It only shows once the group gets a `label`.
|
|
282
294
|
|
|
283
295
|
Leave every change unstaged for the consumer to review, including `ds-migration-report.md`. Stop. Do not run `git add` or `git commit`.
|
|
284
296
|
|
|
@@ -36,10 +36,10 @@ Edit each finding yourself, using the mapping below. Read the whole element when
|
|
|
36
36
|
|
|
37
37
|
| old (`bal-close`) | new (`ds-close`) | handling |
|
|
38
38
|
| --- | --- | --- |
|
|
39
|
-
| `size="small"` | `size="
|
|
39
|
+
| `size="small"` | `size="md"` | `md` is the only `ds-close` size and the closest to legacy small. Do not write `size="sm"`, `ds-close` rejects it. Also rewrite `size='small'`, `size={"small"}`, and `size={'small'}`. |
|
|
40
40
|
| `size="medium"` | `size="md"` | Rewrite to the short value. Also rewrite `size='medium'`, `size={"medium"}`, and `size={'medium'}`. |
|
|
41
41
|
| `size=""` or `size` omitted | omit `size` | Drop `size`. Leave it unset. |
|
|
42
|
-
| `[size]="x"`, `[attr.size]="x"`, `size={x}` | `size` | Dynamic value. Do not guess the mapping. HTML: copy the binding unchanged and list the file and line in the report for manual review. React and Angular: copy it when the expression's type only admits `
|
|
42
|
+
| `[size]="x"`, `[attr.size]="x"`, `size={x}` | `size` | Dynamic value. Do not guess the mapping. HTML: copy the binding unchanged and list the file and line in the report for manual review. React and Angular: copy it when the expression's type only admits `md`. Otherwise apply Unmapped props and handlers (`SKILL.md`). The report says that `small` and `medium` are now `md`. |
|
|
43
43
|
| `inverted` | `inverted` | Copy as-is, including `inverted="true"`, `inverted={true}`, and `[inverted]="x"`. |
|
|
44
44
|
| _(none)_ | `disabled` | New prop. Nothing to migrate from. Leave it unset. |
|
|
45
45
|
| _(none)_ | `button` | New prop. Nothing to migrate from. Leave it unset. |
|
|
@@ -70,7 +70,7 @@ Needs your attention when found:
|
|
|
70
70
|
|
|
71
71
|
Coverage only, written to the file:
|
|
72
72
|
|
|
73
|
-
3. Every `size="small"` or `"medium"` rewritten to `"
|
|
73
|
+
3. Every `size="small"` or `"medium"` rewritten to `"md"`. Legacy small has no size of its own in `ds-close`.
|
|
74
74
|
|
|
75
75
|
Leave every change unstaged for the consumer to review, including `ds-migration-report.md`. Stop. Do not run `git add` or `git commit`.
|
|
76
76
|
|
|
@@ -39,7 +39,7 @@ Edit each finding yourself, using the mapping below. Read the whole element when
|
|
|
39
39
|
| `layout="horizontal"` | `direction="row"` | Rename the prop and the value. Also rewrite `layout='horizontal'`, `layout={"horizontal"}`, and `layout={'horizontal'}`. |
|
|
40
40
|
| `layout="vertical"` | `direction="column"` | Rename the prop and the value. Also rewrite `layout='vertical'`, `layout={"vertical"}`, and `layout={'vertical'}`. |
|
|
41
41
|
| `layout=""` or `layout` omitted | omit `direction` | Drop `layout`. Leave `direction` unset. |
|
|
42
|
-
| `[layout]="x"`, `layout={x}` | `layout` (deprecated) | Dynamic value. Do not guess the mapping. `ds-content` still accepts the deprecated `layout` with `horizontal`, `vertical`, `horizontal-reverse` and `vertical-reverse`, so the binding keeps its name. HTML: copy the binding unchanged and list the file and line in the report for manual review. React and Angular: copy it when the expression's type only admits those four values. Otherwise apply Unmapped props and handlers (`SKILL.md`). The report says that `layout` is deprecated and that the consumer moves it to `direction` by hand: `horizontal` becomes `row` and `vertical` becomes `column`. |
|
|
42
|
+
| `[layout]="x"`, `layout={x}` | `layout` (deprecated) | Dynamic value. Do not guess the mapping. `ds-content` still accepts the deprecated `layout` with `horizontal`, `vertical`, `horizontal-reverse` and `vertical-reverse`, so the binding keeps its name. HTML: copy the binding unchanged and list the file and line in the report for manual review. React and Angular: copy it when the expression's type only admits those four values. Otherwise apply Unmapped props and handlers (`SKILL.md`). The report says that `layout` is deprecated and that the consumer moves it to `direction` by hand: `horizontal` becomes `row`, `vertical` becomes `column`, `horizontal-reverse` becomes `row-reverse`, and `vertical-reverse` becomes `column-reverse`. |
|
|
43
43
|
| `direction`, `alignment` | `direction`, `alignment` | Undocumented legacy props with the same name and values. Copy as-is. |
|
|
44
44
|
| `align="start"`, `"center"`, `"end"` | `align` | Copy as-is, including the `'...'`, `{"..."}`, and `{'...'}` forms. The value set is unchanged. See the text alignment note in the report step. |
|
|
45
45
|
| `[align]="x"`, `align={x}` | `align` | Copy as-is. |
|
|
@@ -40,7 +40,8 @@ Edit each finding yourself, using the mapping below. Read the whole element when
|
|
|
40
40
|
|
|
41
41
|
| old (`bal-date`) | new (`ds-datepicker`) | handling |
|
|
42
42
|
| --- | --- | --- |
|
|
43
|
-
| `name`, `invalid`, `disabled`, `readonly`, `freeSolo`, `placeholder`, `autocomplete`, `value`, `min`, `max`, `
|
|
43
|
+
| `name`, `invalid`, `disabled`, `readonly`, `freeSolo`, `placeholder`, `autocomplete`, `value`, `min`, `max`, `defaultDate`, `allowedDates`, `debounce`, `autoInvalidOff` | same | Copy as-is, in every form (`disabled`, `disabled="true"`, `[disabled]="x"`, `disabled={x}`). Keep form bindings such as `[(ngModel)]`, `formControlName`, and `[formControl]` unchanged. |
|
|
44
|
+
| `min-year`, `max-year` (`minYearProp`, `maxYearProp` in React and Angular) | same | Copy as-is, in every form (`min-year="1990"`, `[attr.min-year]="x"`, `minYearProp={x}`, `[minYearProp]="x"`). Legacy and `ds-datepicker` use the same attribute and property names. |
|
|
44
45
|
| `required` set | `required` | Copy as-is. |
|
|
45
46
|
| `required` omitted | `required` set to false | Follow the required default rule in `SKILL.md`. Report each file where this was added. |
|
|
46
47
|
| `triggerIcon`, `closeOnSelect` | _(no equivalent)_ | Drop it in every form (bare, `="true"`, `="false"`, `{true}`, `[closeOnSelect]="x"`). Report each dropped prop as a behaviour difference. `ds-datepicker` opens the popup only from the calendar button, which is what `triggerIcon` did, and always closes it after a selection, so only `closeOnSelect` set to false loses behaviour. |
|
|
@@ -69,7 +70,7 @@ Rewrite only handlers that are attached to the `bal-date` element being migrated
|
|
|
69
70
|
|
|
70
71
|
When the value in `balChange` or `balInput` is read, note that it is `string | undefined` in legacy and `string | null` in `ds-datepicker`. A cleared field now yields `null`. Do not edit the handler, report it.
|
|
71
72
|
|
|
72
|
-
Retype handler parameters and refs as `SKILL.md` "Legacy types and bundles" describes. `BalEvents.BalDate*` and `BalDateCustomEvent` become `DsDatepickerCustomEvent`. Write a detail alias such as `BalEvents.BalDateChangeDetail` out as the new detail type, `string | null` for `dsChange` and `dsInput`. `HTMLBalDateElement` becomes `HTMLDsDatepickerElement`. The scan lists the `BalEvents.BalDate*` and `BalDateCustomEvent` types, but not the `BalDateCalendar*` ones. It does not list `BalProps
|
|
73
|
+
Retype handler parameters and refs as `SKILL.md` "Legacy types and bundles" describes. `BalEvents.BalDate*` and `BalDateCustomEvent` become `DsDatepickerCustomEvent`. Write a detail alias such as `BalEvents.BalDateChangeDetail` out as the new detail type, `string | null` for `dsChange` and `dsInput`. `HTMLBalDateElement` becomes `HTMLDsDatepickerElement`. The scan lists the `BalEvents.BalDate*` and `BalDateCustomEvent` types, but not the `BalDateCalendar*` ones. It lists the `HTMLBal*Element` types too. It does not list `BalProps.*`, so search for them yourself in each file with a finding.
|
|
73
74
|
|
|
74
75
|
### Methods
|
|
75
76
|
|
|
@@ -54,9 +54,9 @@ Edit each finding yourself, using the mapping below. Read the whole element when
|
|
|
54
54
|
| `[space]="x"`, `[attr.space]="x"`, `space={x}` | `space` | Dynamic value. Do not guess the mapping. HTML: copy the binding unchanged and list the file and line in the report for manual review. React and Angular: copy it when the expression's type only admits `none`, `2xs`, `xs`, `sm`, `base`, `md`, `lg`, `xl`, `2xl` or `3xl`. Otherwise apply Unmapped props and handlers (`SKILL.md`). The report names the value mapping from the rows above. |
|
|
55
55
|
| `color="grey"` | omit `color` | Drop `color`. The default `default` already matches. Also drop the single-quoted and `{"grey"}` / `{'grey'}` forms. |
|
|
56
56
|
| `color="primary"` | `color="primary"` | Copy as-is. |
|
|
57
|
-
| `color="white"` | `
|
|
57
|
+
| `color="white"` | `inverted` | HTML and Angular: write `inverted="true"`. React: write `inverted`. Drop `color`. Also rewrite the single-quoted and `{"white"}` / `{'white'}` forms. When `inverted` is already present, keep a single `inverted`. Do **not** write `color="inverted"`: `inverted` is not a `ds-divider` color. |
|
|
58
58
|
| `color="primary-light"`, `primary-dark`, `grey-light`, `grey-dark`, `warning`, `success`, `danger`, `danger-dark`, `danger-darker`, `light-blue` | _(no equivalent value)_ | Drop `color`. The divider renders in the default color. Do not pick a near match. Record the file, line, and the old value for the report. |
|
|
59
|
-
| `[color]="x"`, `[attr.color]="x"`, `color={x}` | `color` | Dynamic value. Do not guess the mapping. HTML: copy the binding unchanged and list the file and line for manual review. React and Angular: copy it when the expression's type only admits `primary`, `secondary
|
|
59
|
+
| `[color]="x"`, `[attr.color]="x"`, `color={x}` | `color` | Dynamic value. Do not guess the mapping. HTML: copy the binding unchanged and list the file and line for manual review. React and Angular: copy it when the expression's type only admits `primary`, `secondary` or `default`. Otherwise apply Unmapped props and handlers (`SKILL.md`). The report says that `grey` is now `default` and `white` is now `inverted` set to true. |
|
|
60
60
|
| `borderStyle="dashed"` | `dashed` | HTML and Angular: write `dashed="true"`. React: write `dashed`. Also rewrite the single-quoted and `{"dashed"}` / `{'dashed'}` forms. |
|
|
61
61
|
| `borderStyle="solid"`, `borderStyle=""` | omit `dashed` | Drop `borderStyle`. The default is `dashed=false`. |
|
|
62
62
|
| `[borderStyle]="x"`, `[attr.borderStyle]="x"`, `borderStyle={x}` | `dashed` | Dynamic value. Do not generate a comparison expression. `dashed` 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 `borderStyle="dashed"` is now `dashed` set to true. |
|
|
@@ -6,7 +6,7 @@ The three legacy tags are migrated together, not separately. A legacy `bal-dropd
|
|
|
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 `newBalOption`, `BalDropdownBundle`, the `BalEvents.BalDropdown*` and `BalEvents.BalOption*` types and the bare `BalDropdownCustomEvent`, `BalOptionCustomEvent` and `BalOptionListCustomEvent` types. It
|
|
9
|
+
The scan also lists `newBalOption`, `BalDropdownBundle`, the `BalEvents.BalDropdown*` and `BalEvents.BalOption*` types and the bare `BalDropdownCustomEvent`, `BalOptionCustomEvent` and `BalOptionListCustomEvent` types. It lists the `HTMLBalDropdownElement`, `HTMLBalOptionElement` and `HTMLBalOptionListElement` types too. It does not match `BalProps.BalDropdown*` and `BalProps.BalOptionListFilter`. 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
|
|
|
@@ -61,7 +61,7 @@ Apply every rule in `shared/field.md` to each remaining `bal-field`. That file c
|
|
|
61
61
|
|
|
62
62
|
### Types
|
|
63
63
|
|
|
64
|
-
`ds-form` and `ds-form-col` are CSS classes, so they have no event or element types. A handler typed `BalEvents.BalField*` or `BalFieldCustomEvent` has no target type, and neither has a ref typed `HTMLBalField*Element` or `HTMLBalFormGridElement` or `HTMLBalFormColElement`. Leave them in place and report them. The scan lists the `BalEvents.*` and `Bal*CustomEvent` types. It does not list `BalProps
|
|
64
|
+
`ds-form` and `ds-form-col` are CSS classes, so they have no event or element types. A handler typed `BalEvents.BalField*` or `BalFieldCustomEvent` has no target type, and neither has a ref typed `HTMLBalField*Element` or `HTMLBalFormGridElement` or `HTMLBalFormColElement`. Leave them in place and report them. 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.
|
|
65
65
|
|
|
66
66
|
## 4. Report
|
|
67
67
|
|
|
@@ -16,7 +16,7 @@ node <this-skill-directory>/scripts/scan-bal-form.mjs <project-root>
|
|
|
16
16
|
|
|
17
17
|
The script prints one JSON object. `total` is the number of findings. `files` groups them by path. Each finding has `line` and `snippet`.
|
|
18
18
|
|
|
19
|
-
The scan finds the tag and the `BalForm` binding. It does not list `BalFormBundle`, which is a multi-family bundle and stays. It
|
|
19
|
+
The scan finds the tag and the `BalForm` binding. It does not list `BalFormBundle`, which is a multi-family bundle and stays. It lists the `HTMLBalFormElement` type too. It does not find calls of `scrollToFirstInvalidField()`. Search for them yourself in each file with a finding and in the same-basename `.ts` beside every `.html` finding.
|
|
20
20
|
|
|
21
21
|
Show that list to the user grouped by file (path, line, snippet) and end with the total count.
|
|
22
22
|
|