Skip to content

Commit d7f45e9

Browse files
chore(devdeps): update dependency vite to v7.1.11 [security] (#5720)
Signed-off-by: aphilibeaux <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: philibeaux <[email protected]>
1 parent b2a2ed3 commit d7f45e9

File tree

15 files changed

+305
-294
lines changed

15 files changed

+305
-294
lines changed

e2e/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@
3333
"globals": "16.4.0",
3434
"typescript": "5.9.3",
3535
"typescript-eslint": "8.46.1",
36-
"vite": "7.1.10"
36+
"vite": "7.2.2"
3737
}
3838
}

examples/vite/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
"@types/react-dom": "19.2.2",
2222
"@vitejs/plugin-react": "5.0.4",
2323
"typescript": "5.9.3",
24-
"vite": "7.1.10"
24+
"vite": "7.2.2"
2525
}
2626
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
"@babel/preset-react": "7.27.1",
100100
"@babel/preset-typescript": "7.27.1",
101101
"@babel/runtime": "7.28.4",
102-
"@biomejs/biome": "2.2.7",
102+
"@biomejs/biome": "2.3.6",
103103
"@changesets/changelog-github": "0.5.1",
104104
"@changesets/cli": "2.29.7",
105105
"@commitlint/cli": "20.1.0",
@@ -148,7 +148,7 @@
148148
"cross-env": "10.1.0",
149149
"cz-conventional-changelog": "3.3.0",
150150
"date-fns": "4.1.0",
151-
"esbuild-plugin-browserslist": "1.0.2",
151+
"esbuild-plugin-browserslist": "2.0.0",
152152
"eslint": "9.39.1",
153153
"eslint-plugin-oxlint": "1.28.0",
154154
"eslint-plugin-storybook": "9.1.13",
@@ -180,9 +180,9 @@
180180
"svgo": "4.0.0",
181181
"timekeeper": "2.3.1",
182182
"tsx": "4.20.6",
183-
"turbo": "2.5.8",
183+
"turbo": "2.6.1",
184184
"typescript": "5.9.3",
185-
"vite": "7.1.10",
185+
"vite": "7.2.2",
186186
"vitest": "3.2.4",
187187
"vitest-canvas-mock": "0.3.3",
188188
"vitest-localstorage-mock": "0.1.2",

packages/ui/src/components/Alert/__tests__/index.test.tsx

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,14 @@ describe('alert', () => {
4141
))
4242

4343
describe(`renders correctly with all sentiments`, () => {
44-
test.each(['danger', 'info', 'success', 'warning', 'neutral'] as const)(
45-
`renders correctly sentiment %o`,
46-
sentiment =>
47-
shouldMatchSnapshot(<Alert sentiment={sentiment}>Sample Alert</Alert>),
48-
)
44+
test.each([
45+
'danger',
46+
'info',
47+
'success',
48+
'warning',
49+
'neutral',
50+
] as const)(`renders correctly sentiment %o`, sentiment =>
51+
shouldMatchSnapshot(<Alert sentiment={sentiment}>Sample Alert</Alert>))
4952
})
5053

5154
test(`should render alert and then close it`, async () => {

packages/ui/src/components/Avatar/__tests__/index.test.tsx

Lines changed: 69 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -7,90 +7,82 @@ import { Avatar } from '..'
77
import support from '../__stories__/assets/avatar.svg'
88

99
describe('avatar', () => {
10-
describe.each(['circle', 'square'] as const)(
11-
`renders correctly with shape %s`,
12-
shape => {
13-
describe.each(['xsmall', 'small', 'medium', 'large'] as const)(
14-
`renders correctly with shape ${shape} and size %s`,
15-
size => {
16-
it('renders correctly with variant user', () =>
17-
shouldMatchSnapshot(
18-
<Avatar shape={shape} size={size} variant="user" />,
19-
))
10+
describe.each([
11+
'circle',
12+
'square',
13+
] as const)(`renders correctly with shape %s`, shape => {
14+
describe.each([
15+
'xsmall',
16+
'small',
17+
'medium',
18+
'large',
19+
] as const)(`renders correctly with shape ${shape} and size %s`, size => {
20+
it('renders correctly with variant user', () =>
21+
shouldMatchSnapshot(
22+
<Avatar shape={shape} size={size} variant="user" />,
23+
))
2024

21-
it('renders correctly with variant image', () =>
22-
shouldMatchSnapshot(
23-
<Avatar
24-
image={support}
25-
shape={shape}
26-
size={size}
27-
variant="image"
28-
/>,
29-
))
25+
it('renders correctly with variant image', () =>
26+
shouldMatchSnapshot(
27+
<Avatar image={support} shape={shape} size={size} variant="image" />,
28+
))
3029

31-
it('renders correctly with variant text', () =>
32-
shouldMatchSnapshot(
33-
<Avatar shape={shape} size={size} text="UV" variant="text" />,
34-
))
30+
it('renders correctly with variant text', () =>
31+
shouldMatchSnapshot(
32+
<Avatar shape={shape} size={size} text="UV" variant="text" />,
33+
))
3534

36-
it('renders correctly with variant text and sentiment neutral', () =>
37-
shouldMatchSnapshot(
38-
<Avatar
39-
sentiment="neutral"
40-
shape={shape}
41-
size={size}
42-
text="UV"
43-
variant="text"
44-
/>,
45-
))
35+
it('renders correctly with variant text and sentiment neutral', () =>
36+
shouldMatchSnapshot(
37+
<Avatar
38+
sentiment="neutral"
39+
shape={shape}
40+
size={size}
41+
text="UV"
42+
variant="text"
43+
/>,
44+
))
4645

47-
it('renders correctly with variant icon', () =>
48-
shouldMatchSnapshot(
49-
<Avatar shape={shape} size={size} variant="icon">
50-
<MosaicIcon />
51-
</Avatar>,
52-
))
46+
it('renders correctly with variant icon', () =>
47+
shouldMatchSnapshot(
48+
<Avatar shape={shape} size={size} variant="icon">
49+
<MosaicIcon />
50+
</Avatar>,
51+
))
5352

54-
it('renders correctly with variant icon and sentiment neutral', () =>
55-
shouldMatchSnapshot(
56-
<Avatar
57-
sentiment="neutral"
58-
shape={shape}
59-
size={size}
60-
variant="icon"
61-
>
62-
<MosaicIcon />
63-
</Avatar>,
64-
))
53+
it('renders correctly with variant icon and sentiment neutral', () =>
54+
shouldMatchSnapshot(
55+
<Avatar sentiment="neutral" shape={shape} size={size} variant="icon">
56+
<MosaicIcon />
57+
</Avatar>,
58+
))
6559

66-
it('renders correctly with variant colors', () =>
67-
shouldMatchSnapshot(
68-
<Avatar shape={shape} size={size} variant="colors" />,
69-
))
60+
it('renders correctly with variant colors', () =>
61+
shouldMatchSnapshot(
62+
<Avatar shape={shape} size={size} variant="colors" />,
63+
))
7064

71-
it('renders correctly with variant text and upload', async () => {
72-
const onClick = vi.fn()
73-
const { asFragment } = renderWithTheme(
74-
<Avatar
75-
data-testid="avatar"
76-
onClick={onClick}
77-
shape={shape}
78-
size={size}
79-
text="UV"
80-
upload
81-
variant="text"
82-
/>,
83-
)
84-
const avatar = screen.getByTestId('avatar')
65+
it('renders correctly with variant text and upload', async () => {
66+
const onClick = vi.fn()
67+
const { asFragment } = renderWithTheme(
68+
<Avatar
69+
data-testid="avatar"
70+
onClick={onClick}
71+
shape={shape}
72+
size={size}
73+
text="UV"
74+
upload
75+
variant="text"
76+
/>,
77+
)
78+
const avatar = screen.getByTestId('avatar')
8579

86-
await userEvent.hover(avatar)
87-
expect(asFragment()).toMatchSnapshot()
80+
await userEvent.hover(avatar)
81+
expect(asFragment()).toMatchSnapshot()
8882

89-
await userEvent.click(avatar)
90-
expect(onClick).toHaveBeenCalledOnce()
91-
})
92-
},
93-
)
94-
},
95-
)
83+
await userEvent.click(avatar)
84+
expect(onClick).toHaveBeenCalledOnce()
85+
})
86+
})
87+
})
9688
})

packages/ui/src/components/LineChart/helpers.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,11 @@ export const getMinChartValue = (preppedData?: Serie[]): number => {
5353
return Math.floor(minimum - minimum * 0.1)
5454
}
5555

56-
export const getCurrent = (values: number[] = []): number =>
57-
values.length > 0 ? values[values.length - 1] : 0
56+
export const getCurrent = (values: number[] = []): number => {
57+
const val = values.at(-1)
58+
59+
return val ? val : 0
60+
}
5861

5962
export const getSelected = (
6063
label: string,

packages/ui/src/components/Link/__tests__/index.test.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ describe('link', () => {
1616
<Link href="/" sentiment={sentiment as 'primary' | 'info'}>
1717
Hello
1818
</Link>,
19-
),
20-
)
19+
))
2120
})
2221

2322
describe('prominence', () => {
@@ -31,8 +30,7 @@ describe('link', () => {
3130
<Link href="/" prominence={prominence as ProminenceProps}>
3231
Hello
3332
</Link>,
34-
),
35-
)
33+
))
3634
})
3735

3836
test(`render correctly with target blank`, () =>

packages/ui/src/components/Modal/components/Dialog.tsx

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -161,33 +161,39 @@ export const Dialog = ({
161161
return
162162
}
163163

164-
const focusableEls =
165-
dialogRef.current?.querySelectorAll(
166-
'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])',
167-
) ?? []
164+
const focusableEls = dialogRef.current?.querySelectorAll(
165+
'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])',
166+
)
168167

169168
// Handle case when no interactive element are within the modal (including close icon)
170-
if (focusableEls.length === 0) {
169+
if (focusableEls?.length === 0) {
171170
event.preventDefault()
172171
}
173172

174-
const firstFocusableEl = focusableEls[0] as HTMLElement
175-
const lastFocusableEl = focusableEls[focusableEls.length - 1] as HTMLElement
173+
if (focusableEls) {
174+
const elems = [...focusableEls]
175+
const firstFocusableEl = elems[0]
176+
const lastFocusableEl = elems.at(-1)
176177

177-
if (event.shiftKey) {
178-
if (
179-
document.activeElement === firstFocusableEl ||
178+
if (event.shiftKey) {
179+
if (
180+
document.activeElement === firstFocusableEl ||
181+
document.activeElement === dialogRef.current
182+
) {
183+
if (lastFocusableEl instanceof HTMLElement) {
184+
lastFocusableEl.focus()
185+
}
186+
event.preventDefault()
187+
}
188+
} else if (
189+
document.activeElement === lastFocusableEl ||
180190
document.activeElement === dialogRef.current
181191
) {
182-
lastFocusableEl.focus()
192+
if (firstFocusableEl instanceof HTMLElement) {
193+
firstFocusableEl.focus()
194+
}
183195
event.preventDefault()
184196
}
185-
} else if (
186-
document.activeElement === lastFocusableEl ||
187-
document.activeElement === dialogRef.current
188-
) {
189-
firstFocusableEl.focus()
190-
event.preventDefault()
191197
}
192198
}, [])
193199

packages/ui/src/components/Popup/index.tsx

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -452,35 +452,39 @@ export const Popup = forwardRef(
452452
}
453453
event.stopPropagation()
454454

455-
const focusableEls =
456-
innerPopupRef.current?.querySelectorAll(
457-
'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])',
458-
) ?? []
455+
const focusableEls = innerPopupRef.current?.querySelectorAll(
456+
'a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled])',
457+
)
459458

460459
// Handle case when no interactive element are within the modal (including close icon)
461-
if (focusableEls.length === 0) {
460+
if (focusableEls?.length === 0) {
462461
event.preventDefault()
463462
}
464463

465-
const firstFocusableEl = focusableEls[0] as HTMLElement
466-
const lastFocusableEl = focusableEls[
467-
focusableEls.length - 1
468-
] as HTMLElement
469-
470-
if (event.shiftKey) {
471-
if (
472-
document.activeElement === firstFocusableEl ||
464+
if (focusableEls) {
465+
const elems = [...focusableEls]
466+
const firstFocusableEl = elems[0]
467+
const lastFocusableEl = elems.at(-1)
468+
469+
if (event.shiftKey) {
470+
if (
471+
document.activeElement === firstFocusableEl ||
472+
document.activeElement === innerPopupRef.current
473+
) {
474+
if (lastFocusableEl instanceof HTMLElement) {
475+
lastFocusableEl.focus()
476+
}
477+
event.preventDefault()
478+
}
479+
} else if (
480+
document.activeElement === lastFocusableEl ||
473481
document.activeElement === innerPopupRef.current
474482
) {
475-
lastFocusableEl.focus()
483+
if (firstFocusableEl instanceof HTMLElement) {
484+
firstFocusableEl.focus()
485+
}
476486
event.preventDefault()
477487
}
478-
} else if (
479-
document.activeElement === lastFocusableEl ||
480-
document.activeElement === innerPopupRef.current
481-
) {
482-
firstFocusableEl.focus()
483-
event.preventDefault()
484488
}
485489
}, [])
486490

packages/ui/src/components/Status/__tests__/index.test.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { SENTIMENTS } from '../constant'
55

66
describe('status', () => {
77
test.each(SENTIMENTS)('renders correctly with type="%s"', sentiment =>
8-
shouldMatchSnapshot(<Status sentiment={sentiment} />),
9-
)
8+
shouldMatchSnapshot(<Status sentiment={sentiment} />))
109

1110
test(`render animated`, () =>
1211
shouldMatchSnapshot(<Status animated sentiment="success" />))

0 commit comments

Comments
 (0)