Skip to content

Commit db4f45b

Browse files
committed
docs(ui-view): add View token changes to changelog + update hardcoded borderStyle to use token instead
1 parent b90be58 commit db4f45b

File tree

6 files changed

+28
-18
lines changed

6 files changed

+28
-18
lines changed

cypress/component/Tooltip.cy.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,12 @@ describe('<Tooltip/>', () => {
245245

246246
cy.get(tooltip).should('not.be.visible')
247247

248-
cy.get('[data-testid="trigger"]')
249-
.realHover()
250-
.then(() => {
251-
cy.get(tooltip).should('be.visible')
252-
})
248+
cy.get('[data-testid="trigger"]').realHover()
249+
250+
// Verify tooltip is rendered and accessible (avoid Cypress's "covered by" check)
251+
cy.get(tooltip).should('exist')
252+
cy.get(tooltip).should('have.css', 'display', 'block')
253+
cy.contains('Hello. I\'m a tool tip').should('exist')
253254

254255
cy.get(tooltip)
255256
.realPress('Escape')

docs/guides/upgrade-guide.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,10 @@ type: example
135135
<TextInput renderLabel="Name" placeholder="Doe, John Doe"/>
136136
</InstUISettingsProvider>
137137
```
138+
138139
### Breadcrumb
139140

140-
#### New tokens
141+
#### New tokens
141142

142143
- gapSm - Gap spacing for small size breadcrumbs
143144
- gapMd - Gap spacing for medium size breadcrumbs
@@ -281,6 +282,20 @@ type: example
281282
- theme variable `borderStyle` is now removed
282283
- theme variable `position` is now removed
283284

285+
### View
286+
287+
#### Theme variable changes
288+
289+
| Old Variable | Status | Notes |
290+
| ---------------------------------------------------------------------------------------------------------------------------------------- | ------- | ------------------------------------------- |
291+
| `arrowSize` | Removed | Moved to ContextView component |
292+
| `marginXxxSmall`, `marginXxSmall`, `marginXSmall`, `marginSmall`, `marginMedium`, `marginLarge`, `marginXLarge`, `marginXxLarge` | Removed | Use `sharedTokens.spacing` |
293+
| `paddingXxxSmall`, `paddingXxSmall`, `paddingXSmall`, `paddingSmall`, `paddingMedium`, `paddingLarge`, `paddingXLarge`, `paddingXxLarge` | Removed | Use `sharedTokens.spacing` |
294+
| `shadowDepth1`, `shadowDepth2`, `shadowDepth3` | Removed | Use `sharedTokens.boxShadow.elevation1/2/3` |
295+
| `shadowResting`, `shadowAbove`, `shadowTopmost` | Removed | Use `sharedTokens.boxShadow.elevation*` |
296+
| `borderRadiusSmall`, `borderRadiusMedium`, `borderRadiusLarge` | Removed | Use `sharedTokens.radius*` |
297+
| `borderWidthSmall`, `borderWidthMedium`, `borderWidthLarge` | Removed | Use `sharedTokens.width*` |
298+
284299
## Codemods
285300

286301
To ease the upgrade, we provide codemods that will automate most of the changes. Pay close attention to its output, it cannot refactor complex code! The codemod scripts can be run via the following commands:

packages/ui-view/src/ContextView/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ type: example
4747
width="30rem"
4848
margin="x-large 0 0"
4949
>
50-
<Text size="small">
5150
This ContextView uses the inverse background and medium padding. Its width prop is set to `30rem`, which causes long strings like this to wrap. It also has top margin to separate it from the ContextViews above it.
52-
</Text>
5351
</ContextView>
5452
</div>
5553
```

packages/ui-view/src/View/styles.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ const generateStyle = (
450450
: {}),
451451
...(withBorder(props)
452452
? {
453-
borderStyle: 'solid',
453+
borderStyle: componentTheme.borderStyle,
454454
...(borderColorVariants[borderColor!] || {
455455
borderColor: borderColor
456456
})

regression-test/src/app/contextview/page.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,10 @@ export default function ContextViewPage() {
6868
width="30rem"
6969
margin="x-large 0 0"
7070
>
71-
<Text size="small">
72-
This ContextView uses the inverse background and medium padding. Its
73-
width prop is set to 30rem, which causes long strings like this to
74-
wrap. It also has top margin to separate it from the ContextViews
75-
above it.
76-
</Text>
71+
This ContextView uses the inverse background and medium padding. Its
72+
width prop is set to 30rem, which causes long strings like this to
73+
wrap. It also has top margin to separate it from the ContextViews
74+
above it.
7775
</ContextView>
7876
</main>
7977
)

regression-test/src/app/progressbar/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ export default function ProgressBarPage() {
101101
color="primary-inverse"
102102
valueNow={30}
103103
valueMax={60}
104-
renderValue={({ valueNow, valueMax }: any) => (
105-
<Text>{Math.round((valueNow / valueMax) * 100)}%</Text>
106-
)}
104+
renderValue={({ valueNow, valueMax }: any) => `${Math.round((valueNow / valueMax) * 100)}%`}
107105
formatScreenReaderValue={({ valueNow, valueMax }: any) =>
108106
Math.round((valueNow / valueMax) * 100) + ' percent'
109107
}

0 commit comments

Comments
 (0)