Skip to content

Commit b9067f3

Browse files
committed
refactor(many): readd maxWidth to Tag
Just deprecate it for now. We would also need to change Pill, and the a11y team is still considering the best option for such cases
1 parent 392adc3 commit b9067f3

File tree

14 files changed

+20
-678
lines changed

14 files changed

+20
-678
lines changed

docs/contributor-docs/upgrade-guide.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@ The **`<CodeEditor>` component** from the `ui-code-editor` package has been **re
7474
| `Body` | `hover` | is now stored in `TableContext` |
7575
| `Body` | `headers` | is now stored in `TableContext` |
7676

77-
### Tag
78-
79-
The **`maxWidth` theme variable has been removed** from the `Tag` component. As a result, **`<Tag>` can no longer be truncated**. This change was made because placing a tooltip on a non-interactive element is an accessibility anti-pattern. You will need to handle truncation and tooltips via a new design if this functionality is required.
80-
8177
---
8278

8379
## API Changes

packages/shared-types/src/ComponentThemeVariables.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,7 @@ export type TagTheme = {
14261426
focusOutlineColor: Colors['contrasts']['blue4570']
14271427
focusOutlineWidth: Border['widthMedium']
14281428
focusOutlineStyle: Border['style']
1429+
maxWidth: string | 0
14291430
iconMargin: Spacing['small']
14301431
transitionTiming: string
14311432
defaultBackgroundHover: Colors['contrasts']['grey1214']

packages/ui-codemods/lib/__node_tests__/__testfixtures__/removeMaxWidthFromTag/test1.input.tsx

Lines changed: 0 additions & 111 deletions
This file was deleted.

packages/ui-codemods/lib/__node_tests__/__testfixtures__/removeMaxWidthFromTag/test1.output.tsx

Lines changed: 0 additions & 83 deletions
This file was deleted.

packages/ui-codemods/lib/__node_tests__/__testfixtures__/removeMaxWidthFromTag/test1.warning.input.tsx

Lines changed: 0 additions & 111 deletions
This file was deleted.

packages/ui-codemods/lib/__node_tests__/__testfixtures__/removeMaxWidthFromTag/test1.warning.output.tsx

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/ui-codemods/lib/__node_tests__/codemods.test.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import updateV10Breaking from '../updateV10Breaking'
2727
import removeAsFromInstUISettingsProvider from '../removeAsFromInstUISettingsProvider'
2828
import renameCanvasThemesCodemod from '../renameCanvasThemesCodemod'
2929
import updateCodeEditorImport from '../updateCodeEditorImport'
30-
import removeMaxWidthFromTag from '../removeMaxWidthFromTag'
3130
import renameGetComputedStyleToGetCSSStyleDeclaration from '../renameGetComputedStyleToGetCSSStyleDeclaration'
3231

3332
describe('test codemods', () => {
@@ -47,10 +46,6 @@ describe('test codemods', () => {
4746
runTest(updateCodeEditorImport)
4847
})
4948

50-
it('test removing "maxWidth" from Tag', () => {
51-
runTest(removeMaxWidthFromTag)
52-
})
53-
5449
it('test renaming "getComputedStyle" to getCSSStyleDeclaration', () => {
5550
runTest(renameGetComputedStyleToGetCSSStyleDeclaration)
5651
})

packages/ui-codemods/lib/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import instUIv11Codemods from './instUIv11Codemods'
2727
import removeAsFromInstUISettingsProvider from './removeAsFromInstUISettingsProvider'
2828
import { renameCanvasThemes } from './renameCanvasThemesCodemod'
2929
import updateCodeEditorImport from './updateCodeEditorImport'
30-
import removeMaxWidthFromTag from './removeMaxWidthFromTag'
3130
import renameGetComputedStyleToGetCSSStyleDeclaration from './renameGetComputedStyleToGetCSSStyleDeclaration'
3231

3332
export {
@@ -36,6 +35,5 @@ export {
3635
removeAsFromInstUISettingsProvider,
3736
renameCanvasThemes,
3837
updateCodeEditorImport,
39-
removeMaxWidthFromTag,
4038
renameGetComputedStyleToGetCSSStyleDeclaration
4139
}

packages/ui-codemods/lib/instUIv11Codemods.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import instUICodemodExecutor from './utils/instUICodemodExecutor'
2727
import { removeAsProp } from './removeAsFromInstUISettingsProvider'
2828
import { renameCanvasThemes } from './renameCanvasThemesCodemod'
2929
import { updateCodeEditor } from './updateCodeEditorImport'
30-
import { removeMaxWidth } from './removeMaxWidthFromTag'
3130

3231
/**
3332
* Runs all InstUI v10 -> v11 upgrade codemods
@@ -39,7 +38,7 @@ const InstUIv11Codemods: Transform = (
3938
) => {
4039
// TODO add other v11 codemods to this array
4140
return instUICodemodExecutor(
42-
[removeAsProp, renameCanvasThemes, updateCodeEditor, removeMaxWidth],
41+
[removeAsProp, renameCanvasThemes, updateCodeEditor],
4342
file,
4443
api,
4544
options

0 commit comments

Comments
 (0)