Skip to content

Commit aa46f34

Browse files
committed
feat(components): include globalStyles on styles provider context
1 parent 77f0034 commit aa46f34

4 files changed

Lines changed: 24 additions & 12 deletions

File tree

.DS_Store

2 KB
Binary file not shown.

packages/components/src/components/carousel/__tests__/carousel.test.tsx

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,14 @@ const mockUseCarousel = vi.mocked(useCarousel);
2828

2929
describe('Carousel component', () => {
3030
it('Should render carousel component', async () => {
31-
const { container } = render(<Carousel {...mockProps} ref={() => {}} />);
31+
const { container } = render(
32+
<Carousel
33+
{...mockProps}
34+
ref={() => {
35+
// empty
36+
}}
37+
/>,
38+
);
3239

3340
const results = await axe(container);
3441
expect(container).toHTMLValidate({
@@ -43,7 +50,9 @@ describe('Carousel component', () => {
4350
render(
4451
<Carousel
4552
{...mockProps}
46-
ref={() => {}}
53+
ref={() => {
54+
// empty
55+
}}
4756
numElementsPerPage={mockProps.elements.length + 2}
4857
/>,
4958
);
@@ -59,7 +68,9 @@ describe('Carousel component', () => {
5968
render(
6069
<Carousel
6170
{...mockProps}
62-
ref={() => {}}
71+
ref={() => {
72+
// empty
73+
}}
6374
allowModifySliceWidth={true}
6475
numElementsPerPage={0}
6576
/>,
@@ -76,7 +87,9 @@ describe('Carousel component', () => {
7687
render(
7788
<Carousel
7889
{...mockProps}
79-
ref={() => {}}
90+
ref={() => {
91+
// empty
92+
}}
8093
allowModifySliceWidth={true}
8194
autoFitContainer={true}
8295
numElementsPerPage={5}

packages/components/src/lib/provider/stylesProvider/stylesProvider.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ export const StylesProvider: FC<StylesProviderProps> = ({
201201
classes: [],
202202
currentTheme,
203203
getComponentStyles,
204+
globalStyles: provider.globalStyles,
204205
icons,
205206
illustrations,
206207
mediaQueries,
@@ -217,6 +218,7 @@ export const StylesProvider: FC<StylesProviderProps> = ({
217218
provider.classNames,
218219
provider.allThemes,
219220
provider.variables,
221+
provider.globalStyles,
220222
],
221223
);
222224

packages/components/src/lib/types/react.d.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,14 @@
55
* This file re-exports it to maintain backward compatibility
66
* with existing code that uses JSX.Element
77
*/
8-
import type React from 'react';
8+
import type { JSX } from 'react';
99

1010
declare global {
1111
namespace JSX {
12-
type Element = React.JSX.Element;
13-
type ElementType = React.JSX.ElementType;
14-
type IntrinsicElements = React.JSX.IntrinsicElements;
15-
type LibraryManagedAttributes<C, P> = React.JSX.LibraryManagedAttributes<
16-
C,
17-
P
18-
>;
12+
type Element = JSX.Element;
13+
type ElementType = JSX.ElementType;
14+
type IntrinsicElements = JSX.IntrinsicElements;
15+
type LibraryManagedAttributes<C, P> = JSX.LibraryManagedAttributes<C, P>;
1916
}
2017
}
2118

0 commit comments

Comments
 (0)