Skip to content

Commit

Permalink
Merge pull request #369 from wwnorton/fix-react-types
Browse files Browse the repository at this point in the history
fix: fix type react types mismatch
  • Loading branch information
cafrias authored Dec 17, 2024
2 parents b9a5571 + 0d4dfb3 commit e1d351c
Show file tree
Hide file tree
Showing 9 changed files with 30,742 additions and 25,373 deletions.
56,083 changes: 30,733 additions & 25,350 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@
"packages/*/src"
]
},
"overrides": {
"@types/react": "^17",
"@types/react-dom": "^17"
},
"devDependencies": {
"@babel/preset-env": "^7.22.10",
"@babel/preset-react": "^7.22.5",
Expand Down
8 changes: 1 addition & 7 deletions packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,6 @@
"build:main": "microbundle --jsx React.createElement --jsxFragment React.Fragment --format modern,es,cjs --globals @popperjs/core=Popper,react=React,react-dom=ReactDOM",
"build:umd": "microbundle --jsx React.createElement --jsxFragment React.Fragment --format umd --name NDSReact --external @popperjs/core,react,react-dom --globals @popperjs/core=Popper,react=React,react-dom=ReactDOM"
},
"overrides": {
"@types/react": "^17",
"@types/react-dom": "^17"
},
"dependencies": {
"@material/linear-progress": "^14.0.0",
"@popperjs/core": "^2.11.6",
Expand All @@ -59,10 +55,8 @@
"react-transition-group": "^4.4.5"
},
"devDependencies": {
"@types/react-is": "^18.3.0",
"@faker-js/faker": "^9.0.3",
"@types/react": "^17.0.53",
"@types/react-dom": "^17.0.19",
"@types/react-is": "^17.0.3",
"react-router-dom": "^5.3.4"
},
"peerDependencies": {
Expand Down
4 changes: 3 additions & 1 deletion packages/react/src/components/Listbox/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ export interface OptionProps extends OptionBase {

export type ListboxBase = Omit<
React.ComponentPropsWithoutRef<'ul'>,
'role' | 'aria-multiselectable' | 'aria-orientation' | 'onChange'
'children' | 'role' | 'aria-multiselectable' | 'aria-orientation' | 'onChange'
>;

export interface ListboxProps extends ListboxBase {
children?: OptionProps[] | React.ReactNode;

/**
* A list of options as either an array of `value` props, an array of `OptionProps`
* objects, or an object with `label: value` entries. Array values will be
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Modal/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export interface ModalProps extends BaseDialogProps {
* A list of actions or React Fragment that will be set inside an action bar
* at the bottom of the Modal dialog.
*/
actions?: React.ReactElement<ButtonProps>[] | React.ReactFragment;
actions?: React.ReactElement | React.ReactElement<ButtonProps>[] | React.ReactFragment;
/**
* Indicates whether the header should stick to the top of the screen. Only
* has an effect when the modal's content is longer than the window height
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/Popover/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react';
import classNames from 'classnames';
import { Button } from '../Button';
import { Popper } from '../Popper';
import { useForwardedRef, useId, usePopperTriggers } from '../../utilities';
import { PopperTriggersClose, useForwardedRef, useId, usePopperTriggers } from '../../utilities';
import { PopoverProps } from './types';

/** A popover is a non-modal dialog that points to a reference element. */
Expand Down Expand Up @@ -63,7 +63,7 @@ export const Popover = React.forwardRef<HTMLElement, PopoverProps>(
const prevOpen = React.useRef(isOpen);

const close: PopoverProps['onRequestClose'] = React.useCallback(
(trigger) => {
(trigger: PopperTriggersClose) => {
focusReferenceOnClose.current = trigger !== 'click.external';
if (onRequestClose) onRequestClose(trigger);
},
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/utilities/children/toElements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import ReactIs from 'react-is';
*/
export const toElements = <P extends Record<string, any> = any>(
/** A React node, such as `children` of any element. */
node: React.ReactNode,
node: P[] | React.ReactNode,
/** A list of required prop names. */
required: string[] = [],
): React.ReactElement<P>[] => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/utilities/rovingTabindex/hook.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const useRovingTabindex = <Container extends HTMLElement | null, Child ex
);

const createRef = useCallback(
(i) => (el: Child | null) => {
(i: number) => (el: Child | null) => {
if (!el || !container) {
return;
}
Expand Down
6 changes: 0 additions & 6 deletions website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@
"last 1 safari version"
]
},
"overrides": {
"@types/react": "^17",
"@types/react-dom": "^17"
},
"dependencies": {
"@docusaurus/core": "^3.1.1",
"@docusaurus/module-type-aliases": "^3.1.1",
Expand All @@ -60,8 +56,6 @@
"@docusaurus/module-type-aliases": "3.1.1",
"@docusaurus/tsconfig": "^3.1.1",
"@docusaurus/types": "3.1.1",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"gauge": "^3.0.2",
"lunr": "^2.3.9",
"react-docgen-typescript-plugin": "^1.0.5",
Expand Down

0 comments on commit e1d351c

Please sign in to comment.