Skip to content

Commit 0d652a5

Browse files
feat(scripts, eslint, stylelint): DLT-3359 add success-to-positive migration tooling (#1231)
1 parent 54d2a84 commit 0d652a5

21 files changed

Lines changed: 1846 additions & 55 deletions

File tree

apps/dialtone-documentation/docs/_data/site-nav.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,10 @@
247247
"text": "Layout & Spacing Tokens",
248248
"link": "/guides/migration/layout-and-spacing-tokens/"
249249
},
250+
{
251+
"text": "Success to Positive",
252+
"link": "/guides/migration/success-to-positive/"
253+
},
250254
{
251255
"text": "Flex to DtStack",
252256
"link": "/guides/migration/flex-to-stack/"

apps/dialtone-documentation/docs/guides/migration/component-props/index.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ description: Prop renames, value standardization, event consolidation, slot rena
2424
| `dt-link` | Prop value | `tone="success"` | `tone="positive"` |
2525
| `dt-modal` | Prop value | `bannerKind="error"` | `bannerKind="critical"` |
2626
| `dt-modal` | Prop value | `bannerKind="success"` | `bannerKind="positive"` |
27+
| `dt-text` | Prop value | `tone="success"` | `tone="positive"` |
28+
| `dt-text` | Prop value | `tone="success-strong"` | `tone="positive-strong"` |
29+
| `dt-button` | Prop value | `link-kind="danger"` | `link-kind="critical"` |
30+
| `dt-button` | Prop value | `link-kind="success"` | `link-kind="positive"` |
31+
| `dt-box` | Prop value | `surface="success*"` (subtle, strong, opaque, subtle-opaque) | `surface="positive*"` |
32+
| `dt-box` | Prop value | `bc="success*"` (subtle, strong) | `bc="positive*"` |
33+
34+
> [!INFO] CSS variables and utility classes also rename
35+
> The success-to-positive rename also covers `var(--dt-color-*-success-*)` design tokens, `d-fc-success*` / `d-bgc-success*` / `d-bc-success*` utility classes, and ships an ESLint rule and Stylelint rule. See the [Success to Positive](../success-to-positive/) migration guide for the CSS / token side and run `dialtone-migration-helper`.
2736
2837
### Visibility and open state
2938

@@ -120,6 +129,61 @@ Prop values across the system map to a shared set of names. `danger` and `error`
120129
</div>
121130
</div>
122131

132+
## DtBox `surface` / `bc`, DtText `tone-strong`, and DtButton `link-kind` Value Renames
133+
134+
DtBox, DtText, and DtButton each have severity-value props that the original DLT-3157 release missed. The migration script handles all of them.
135+
136+
**Affected components:** [DtBox](/components/box.html), [DtText](/components/text.html), [DtButton](/components/button.html)
137+
138+
<div class="d-d-grid d-g-200 d-g-cols1 md:d-g-cols2">
139+
<div>
140+
141+
### Before
142+
143+
```vue
144+
<dt-box surface="success" />
145+
<dt-box surface="success-subtle" />
146+
<dt-box surface="success-strong" />
147+
<dt-box surface="success-opaque" />
148+
<dt-box surface="success-subtle-opaque" />
149+
150+
<dt-box bc="success" />
151+
<dt-box bc="success-subtle" />
152+
<dt-box bc="success-strong" />
153+
154+
<dt-text tone="success">Saved.</dt-text>
155+
<dt-text tone="success-strong">Saved.</dt-text>
156+
157+
<dt-button link-kind="danger">Delete</dt-button>
158+
<dt-button link-kind="success">Confirm</dt-button>
159+
```
160+
161+
</div>
162+
<div>
163+
164+
### After
165+
166+
```vue
167+
<dt-box surface="positive" />
168+
<dt-box surface="positive-subtle" />
169+
<dt-box surface="positive-strong" />
170+
<dt-box surface="positive-opaque" />
171+
<dt-box surface="positive-subtle-opaque" />
172+
173+
<dt-box bc="positive" />
174+
<dt-box bc="positive-subtle" />
175+
<dt-box bc="positive-strong" />
176+
177+
<dt-text tone="positive">Saved.</dt-text>
178+
<dt-text tone="positive-strong">Saved.</dt-text>
179+
180+
<dt-button link-kind="critical">Delete</dt-button>
181+
<dt-button link-kind="positive">Confirm</dt-button>
182+
```
183+
184+
</div>
185+
</div>
186+
123187
## `show``open` on Overlay Components
124188

125189
On overlay components, `show` is now `open` and `update:show` is now `update:open`. This matches the `v-model:open` convention already used by `dt-popover`, `dt-dropdown`, and `dt-combobox-with-popover`.
@@ -549,6 +613,9 @@ npx dialtone-migrate-props --cwd ./src --yes
549613
- `type="success"``type="positive"` on `dt-badge`
550614
- `kind``tone` prop rename on `dt-link`, with value renames applied in the same pass
551615
- `banner-kind` / `bannerKind` value renames on `dt-modal` (`error``critical`, `success``positive`)
616+
- `tone="success-strong"``tone="positive-strong"` on `dt-text` (the bare `tone="success"` is covered by the global `tone` rule above)
617+
- `link-kind="danger"``link-kind="critical"` and `link-kind="success"``link-kind="positive"` on `dt-button`
618+
- `surface="success*"``surface="positive*"` and `bc="success*"``bc="positive*"` on `dt-box` (covers `subtle`, `strong`, `opaque`, and `subtle-opaque` variants)
552619

553620
**Visibility and open state**
554621

apps/dialtone-documentation/docs/guides/migration/index.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This guide walks you through every breaking and deprecation change in the upcomi
1212

1313
Work through each applicable guide in order. Guides earlier in the list are prerequisites for later ones (e.g. color stop renames before base-to-semantic).
1414

15-
### CSS & Tokens
15+
### CSS and Design Tokens
1616

1717
| # | Guide | Breaking? | Tool | Summary |
1818
| --- | --- | --- | --- | --- |
@@ -21,23 +21,24 @@ Work through each applicable guide in order. Guides earlier in the list are prer
2121
| 3 | [HSL to OKLCH](./hsl-to-oklch/) | **Yes** | `dialtone-migration-helper` | Color tokens moved from HSL to OKLCH. Per-channel breakout variables removed (~3,200 CSS vars). |
2222
| 4 | [Base to Semantic Colors](./color-stops/#adopting-semantic-color-tokens) | Deprecation | `dialtone-migration-helper` | Upgrade base color utilities/tokens to theme-aware semantic equivalents. |
2323
| 5 | [Layout & Spacing Tokens](./layout-and-spacing-tokens/) | **Yes** | `dialtone-migration-helper` | `--dt-size-*``--dt-layout-*`, `--dt-space-*``--dt-spacing-*`. |
24+
| 6 | [Success to Positive](./success-to-positive/) | Deprecation | `dialtone-migration-helper` | `success*` design tokens and `d-fc-success*` / `d-bgc-success*` / `d-bc-success*` utility classes deprecated in favor of `positive*`. Includes ESLint and Stylelint rules. |
2425

2526
### Components
2627

2728
| # | Guide | Breaking? | Tool | Summary |
2829
| --- | --- | --- | --- | --- |
29-
| 6 | [Flex to DtStack](./flex-to-stack/) | Deprecation | `dialtone-migrate-flex-to-stack` | Replace `d-d-flex` utilities with the `<dt-stack>` component. |
30-
| 7 | [Component Sizes to Numeric](./component-sizes/) | Deprecation | ESLint + `dialtone-migrate-tshirt-to-numeric` | `size="sm"``:size="200"` across all components. |
31-
| 8 | [Avatar Updates](./avatar-updates/) | **Yes** | Manual (grep) | `DtAvatar` size prop moves to numeric, `iconSize` removed, group avatar behavior changed. |
32-
| 9 | [Logical Naming](./logical-naming/) | Deprecation | `dialtone-migration-helper` | Slots, props, events: `left`/`right``start`/`end`. |
33-
| 10 | [Recipes to UI Kits](./recipes-to-ui-kits/) | **Yes** | Migration script | `DtRecipe*` components move to standalone `@dialpad/` UI Kit packages. |
34-
| 11 | [Component Props & Events](./component-props/) | **Yes** | `dialtone-migrate-props` | Value renames, `show``open`, `hide-*` inversion, `title``header-text`, event/slot renames, `rootClass` removal. |
30+
| 7 | [Flex to DtStack](./flex-to-stack/) | Deprecation | `dialtone-migrate-flex-to-stack` | Replace `d-d-flex` utilities with the `<dt-stack>` component. |
31+
| 8 | [Component Sizes to Numeric](./component-sizes/) | Deprecation | ESLint + `dialtone-migrate-tshirt-to-numeric` | `size="sm"``:size="200"` across all components. |
32+
| 9 | [Avatar Updates](./avatar-updates/) | **Yes** | Manual (grep) | `DtAvatar` size prop moves to numeric, `iconSize` removed, group avatar behavior changed. |
33+
| 10 | [Logical Naming](./logical-naming/) | Deprecation | `dialtone-migration-helper` | Slots, props, events: `left`/`right``start`/`end`. |
34+
| 11 | [Recipes to UI Kits](./recipes-to-ui-kits/) | **Yes** | Migration script | `DtRecipe*` components move to standalone `@dialpad/` UI Kit packages. |
35+
| 12 | [Component Props & Events](./component-props/) | **Yes** | `dialtone-migrate-props` | Value renames (including DtBox `surface`/`bc`, DtText `tone-strong`, DtButton `link-kind`), `show``open`, `hide-*` inversion, `title``header-text`, event/slot renames, `rootClass` removal. |
3536

3637
### Framework
3738

3839
| # | Guide | Breaking? | Tool | Summary |
3940
| --- | --- | --- | --- | --- |
40-
| 12 | [Vue 2 Removal](./vue2-removal/) | **Yes** || Vue 2 support dropped. Last Vue 2 version: `9.154.0`. |
41+
| 13 | [Vue 2 Removal](./vue2-removal/) | **Yes** || Vue 2 support dropped. Last Vue 2 version: `9.154.0`. |
4142

4243
## Quick Start
4344

@@ -64,20 +65,24 @@ npx dialtone-migration-helper --cwd ./src
6465
npx dialtone-migration-helper --cwd ./src
6566
# Select "size-to-layout"
6667

67-
# 6. Flex to Stack
68+
# 6. Success to positive (tokens + utility classes)
69+
npx dialtone-migration-helper --cwd ./src
70+
# Select "success-to-positive"
71+
72+
# 7. Flex to Stack
6873
npx dialtone-migrate-flex-to-stack --cwd ./src
6974

70-
# 7. T-shirt sizes to numeric
75+
# 8. T-shirt sizes to numeric
7176
npx dialtone-migrate-tshirt-to-numeric --cwd ./src
7277

73-
# 8. Physical to logical naming
78+
# 9. Physical to logical naming
7479
npx dialtone-migration-helper --cwd ./src
7580
# Select "physical-to-logical"
7681

77-
# 9. Component props, events, and slots
82+
# 10. Component props, events, and slots
7883
npx dialtone-migrate-props --cwd ./src
7984

80-
# 10. ESLint auto-fix pass
85+
# 11. ESLint auto-fix pass
8186
npx eslint --fix "src/**/*.vue"
8287
```
8388

0 commit comments

Comments
 (0)