Skip to content

Commit

Permalink
Merge branch 'master' into e.muhamethanov/fix-calendar-rtl
Browse files Browse the repository at this point in the history
  • Loading branch information
EldarMuhamethanov committed Dec 12, 2024
2 parents 27a6c63 + 6f6e984 commit d6e333d
Show file tree
Hide file tree
Showing 115 changed files with 1,705 additions and 1,240 deletions.
12 changes: 12 additions & 0 deletions .yarn/patches/@types-mdx-npm-2.0.13-52981f86f6.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/types.d.ts b/types.d.ts
index 498bb694de2e6a62f14d3fe998dc538aff920fc6..719f0ea55bb472e2df0e38a06df88d5ad6156b44 100644
--- a/types.d.ts
+++ b/types.d.ts
@@ -1,5 +1,7 @@
// Internal helper types

+import type { JSX } from "react/jsx-runtime";
+
/**
* This is the global JSX.ElementType if it’s defined, otherwise never.
*/
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
"@types/jest": "^29.5.14",
"@types/jest-axe": "^3.5.9",
"@types/node": "^22.10.1",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@types/react": "^19.0.1",
"@types/react-dom": "^19.0.1",
"@types/webpack": "^5.28.5",
"@typescript-eslint/eslint-plugin": "^7.5.0",
"@typescript-eslint/parser": "^7.5.0",
Expand Down Expand Up @@ -100,7 +100,9 @@
"yargs": "^17.7.2"
},
"resolutions": {
"markdown-to-jsx@npm:^6.11.4": "^7.5.0"
"markdown-to-jsx@npm:^6.11.4": "^7.5.0",
"@types/mdx@npm:^2.0.0": "patch:@types/mdx@npm%3A2.0.13#~/.yarn/patches/@types-mdx-npm-2.0.13-52981f86f6.patch",
"express": "4.21.2"
},
"scripts": {
"docs:styleguide": "yarn workspace @project-docs/styleguide run start",
Expand Down
4 changes: 2 additions & 2 deletions packages/vkui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,8 @@
"generate:css-custom-medias": "node scripts/generateCSSCustomMedias.mjs"
},
"peerDependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
"react": "^18.2.0 || ^19.0.0",
"react-dom": "^18.2.0 || ^19.0.0"
},
"dependencies": {
"@swc/helpers": "^0.5.15",
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/src/components/ActionSheet/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type * as React from 'react';
import type { PlacementWithAuto } from '../../lib/floating/types/common';
import { type FocusTrapProps } from '../FocusTrap/FocusTrap';

export type ToggleRef = Element | null | undefined | React.RefObject<Element>;
export type ToggleRef = Element | null | undefined | React.RefObject<Element | null>;

export interface SharedDropdownProps extends FocusTrapProps {
closing: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/src/components/AppRoot/AppRoot.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ describe('AppRoot', () => {
describe('portalRoot prop', () => {
it('should accept custom portal root', () => {
const customPortalRoot = document.createElement('div');
let portalRoot: React.MutableRefObject<HTMLElement | null> = React.createRef();
let portalRoot: React.RefObject<HTMLElement | null> = React.createRef();
const contextCallback = jest.fn().mockImplementation((ctx) => {
portalRoot.current = ctx.portalRoot ?? null;
return null;
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/src/components/AppRoot/AppRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export interface AppRootProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* Кастомный root-элемент портала
*/
portalRoot?: HTMLElement | React.RefObject<HTMLElement> | null;
portalRoot?: HTMLElement | React.RefObject<HTMLElement | null> | null;
/**
* Отключает рендер всплывающих компонентов в отдельном контейнере
*/
Expand Down
4 changes: 2 additions & 2 deletions packages/vkui/src/components/AppRoot/AppRootContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import * as React from 'react';
import { type AppRootUserSelectMode, type SafeAreaInsets } from './types';

export interface AppRootContextInterface {
appRoot: React.RefObject<HTMLElement>;
portalRoot?: HTMLElement | React.RefObject<HTMLElement> | null;
appRoot: React.RefObject<HTMLElement | null>;
portalRoot?: HTMLElement | React.RefObject<HTMLElement | null> | null;
safeAreaInsets?: SafeAreaInsets;
embedded: boolean;
mode: 'partial' | 'embedded' | 'full';
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/src/components/AppRoot/AppRootPortal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export interface AppRootPortalProps extends HasChildren {
*
* По умолчанию в качестве портала будет использован `document.body`
*/
usePortal?: boolean | HTMLElement | React.RefObject<HTMLElement> | null;
usePortal?: boolean | HTMLElement | React.RefObject<HTMLElement | null> | null;
className?: string;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
} from './ScrollContext';

type ChildWithContextProps = {
contextRef?: RefObject<ScrollContextInterface>;
contextRef?: RefObject<ScrollContextInterface | null>;
beforeScrollLockFn?: VoidFunction;
};
const ChildWithContext = ({ contextRef, beforeScrollLockFn }: ChildWithContextProps) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/vkui/src/components/AppRoot/ScrollContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function useScrollLockController(enableScrollLock: () => void, disableScrollLock
}

export interface ScrollControllerProps extends HasChildren {
elRef: React.RefObject<HTMLElement>;
elRef: React.RefObject<HTMLElement | null>;
}

export const GlobalScrollController = ({ children }: ScrollControllerProps): React.ReactNode => {
Expand Down
6 changes: 5 additions & 1 deletion packages/vkui/src/components/AspectRatio/AspectRatio.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ export interface AspectRatioProps extends Omit<RootComponentProps<HTMLElement>,
* @since 5.5.0
* @see https://vkcom.github.io/VKUI/#/AspectRatio
*/
export function AspectRatio({ ratio, mode = 'stretch', ...props }: AspectRatioProps): JSX.Element {
export function AspectRatio({
ratio,
mode = 'stretch',
...props
}: AspectRatioProps): React.JSX.Element {
const style: React.CSSProperties & CSSCustomProperties = {
'--vkui_internal--aspect_ratio': String(ratio),
};
Expand Down
Loading

0 comments on commit d6e333d

Please sign in to comment.