react-bootstrap 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,16 +1,14 @@
1
1
  import * as React from 'react';
2
2
  import { UseDropdownMenuOptions } from '@restart/ui/DropdownMenu';
3
- import { SelectCallback } from '@restart/ui/types';
4
3
  import { DropDirection } from './DropdownContext';
5
4
  import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
6
5
  import { AlignType } from './types';
7
6
  export declare type DropdownMenuVariant = 'dark' | string;
8
- export interface DropdownMenuProps extends BsPrefixProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> {
7
+ export interface DropdownMenuProps extends BsPrefixProps, React.HTMLAttributes<HTMLElement> {
9
8
  show?: boolean;
10
9
  renderOnMount?: boolean;
11
10
  flip?: boolean;
12
11
  align?: AlignType;
13
- onSelect?: SelectCallback;
14
12
  rootCloseEvent?: 'click' | 'mousedown';
15
13
  popperConfig?: UseDropdownMenuOptions['popperConfig'];
16
14
  variant?: DropdownMenuVariant;
package/esm/Modal.js CHANGED
@@ -57,6 +57,8 @@ const Modal = /*#__PURE__*/React.forwardRef(({
57
57
  children,
58
58
  dialogAs: Dialog,
59
59
  'aria-labelledby': ariaLabelledby,
60
+ 'aria-describedby': ariaDescribedby,
61
+ 'aria-label': ariaLabel,
60
62
 
61
63
  /* BaseModal props */
62
64
  show,
@@ -178,7 +180,6 @@ const Modal = /*#__PURE__*/React.forwardRef(({
178
180
 
179
181
  const handleEnter = (node, isAppearing) => {
180
182
  if (node) {
181
- node.style.display = 'block';
182
183
  updateDialogStyle(node);
183
184
  }
184
185
 
@@ -209,11 +210,10 @@ const Modal = /*#__PURE__*/React.forwardRef(({
209
210
  }), [animation, backdropClassName, bsPrefix]);
210
211
  const baseModalStyle = { ...style,
211
212
  ...modalStyle
212
- }; // Sets `display` always block when `animation` is false
213
+ }; // If `display` is not set to block, autoFocus inside the modal fails
214
+ // https://github.com/react-bootstrap/react-bootstrap/issues/5102
213
215
 
214
- if (!animation) {
215
- baseModalStyle.display = 'block';
216
- }
216
+ baseModalStyle.display = 'block';
217
217
 
218
218
  const renderDialog = dialogProps => /*#__PURE__*/_jsx("div", {
219
219
  role: "dialog",
@@ -222,7 +222,9 @@ const Modal = /*#__PURE__*/React.forwardRef(({
222
222
  className: classNames(className, bsPrefix, animateStaticModal && `${bsPrefix}-static`),
223
223
  onClick: backdrop ? handleClick : undefined,
224
224
  onMouseUp: handleMouseUp,
225
+ "aria-label": ariaLabel,
225
226
  "aria-labelledby": ariaLabelledby,
227
+ "aria-describedby": ariaDescribedby,
226
228
  children: /*#__PURE__*/_jsx(Dialog, { ...props,
227
229
  onMouseDown: handleDialogMouseDown,
228
230
  className: dialogClassName,
package/esm/PageItem.d.ts CHANGED
@@ -8,23 +8,8 @@ export interface PageItemProps extends React.HTMLAttributes<HTMLElement>, BsPref
8
8
  }
9
9
  declare const PageItem: BsPrefixRefForwardingComponent<'li', PageItemProps>;
10
10
  export default PageItem;
11
- export declare const First: {
12
- ({ children, ...props }: PageItemProps): JSX.Element;
13
- displayName: string;
14
- };
15
- export declare const Prev: {
16
- ({ children, ...props }: PageItemProps): JSX.Element;
17
- displayName: string;
18
- };
19
- export declare const Ellipsis: {
20
- ({ children, ...props }: PageItemProps): JSX.Element;
21
- displayName: string;
22
- };
23
- export declare const Next: {
24
- ({ children, ...props }: PageItemProps): JSX.Element;
25
- displayName: string;
26
- };
27
- export declare const Last: {
28
- ({ children, ...props }: PageItemProps): JSX.Element;
29
- displayName: string;
30
- };
11
+ export declare const First: React.ForwardRefExoticComponent<PageItemProps & React.RefAttributes<unknown>>;
12
+ export declare const Prev: React.ForwardRefExoticComponent<PageItemProps & React.RefAttributes<unknown>>;
13
+ export declare const Ellipsis: React.ForwardRefExoticComponent<PageItemProps & React.RefAttributes<unknown>>;
14
+ export declare const Next: React.ForwardRefExoticComponent<PageItemProps & React.RefAttributes<unknown>>;
15
+ export declare const Last: React.ForwardRefExoticComponent<PageItemProps & React.RefAttributes<unknown>>;
package/esm/PageItem.js CHANGED
@@ -42,21 +42,19 @@ PageItem.displayName = 'PageItem';
42
42
  export default PageItem;
43
43
 
44
44
  function createButton(name, defaultValue, label = name) {
45
- function Button({
45
+ const Button = /*#__PURE__*/React.forwardRef(({
46
46
  children,
47
47
  ...props
48
- }) {
49
- return /*#__PURE__*/_jsxs(PageItem, { ...props,
50
- children: [/*#__PURE__*/_jsx("span", {
51
- "aria-hidden": "true",
52
- children: children || defaultValue
53
- }), /*#__PURE__*/_jsx("span", {
54
- className: "visually-hidden",
55
- children: label
56
- })]
57
- });
58
- }
59
-
48
+ }, ref) => /*#__PURE__*/_jsxs(PageItem, { ...props,
49
+ ref: ref,
50
+ children: [/*#__PURE__*/_jsx("span", {
51
+ "aria-hidden": "true",
52
+ children: children || defaultValue
53
+ }), /*#__PURE__*/_jsx("span", {
54
+ className: "visually-hidden",
55
+ children: label
56
+ })]
57
+ }));
60
58
  Button.displayName = name;
61
59
  return Button;
62
60
  }
@@ -4,26 +4,11 @@ export interface PaginationProps extends BsPrefixProps, React.HTMLAttributes<HTM
4
4
  size?: 'sm' | 'lg';
5
5
  }
6
6
  declare const _default: React.ForwardRefExoticComponent<PaginationProps & React.RefAttributes<HTMLUListElement>> & {
7
- First: {
8
- ({ children, ...props }: import("./PageItem").PageItemProps): JSX.Element;
9
- displayName: string;
10
- };
11
- Prev: {
12
- ({ children, ...props }: import("./PageItem").PageItemProps): JSX.Element;
13
- displayName: string;
14
- };
15
- Ellipsis: {
16
- ({ children, ...props }: import("./PageItem").PageItemProps): JSX.Element;
17
- displayName: string;
18
- };
7
+ First: React.ForwardRefExoticComponent<import("./PageItem").PageItemProps & React.RefAttributes<unknown>>;
8
+ Prev: React.ForwardRefExoticComponent<import("./PageItem").PageItemProps & React.RefAttributes<unknown>>;
9
+ Ellipsis: React.ForwardRefExoticComponent<import("./PageItem").PageItemProps & React.RefAttributes<unknown>>;
19
10
  Item: import("./helpers").BsPrefixRefForwardingComponent<"li", import("./PageItem").PageItemProps>;
20
- Next: {
21
- ({ children, ...props }: import("./PageItem").PageItemProps): JSX.Element;
22
- displayName: string;
23
- };
24
- Last: {
25
- ({ children, ...props }: import("./PageItem").PageItemProps): JSX.Element;
26
- displayName: string;
27
- };
11
+ Next: React.ForwardRefExoticComponent<import("./PageItem").PageItemProps & React.RefAttributes<unknown>>;
12
+ Last: React.ForwardRefExoticComponent<import("./PageItem").PageItemProps & React.RefAttributes<unknown>>;
28
13
  };
29
14
  export default _default;
package/package.json CHANGED
@@ -1,12 +1,14 @@
1
1
  {
2
2
  "name": "react-bootstrap",
3
- "version": "2.2.1",
3
+ "version": "2.3.0",
4
4
  "description": "Bootstrap 5 components built with React",
5
5
  "keywords": [
6
+ "bootstrap",
6
7
  "react",
8
+ "component",
9
+ "components",
7
10
  "ecosystem-react",
8
- "react-component",
9
- "bootstrap"
11
+ "react-component"
10
12
  ],
11
13
  "homepage": "https://react-bootstrap.github.io/",
12
14
  "bugs": {
@@ -34,13 +36,9 @@
34
36
  },
35
37
  "dependencies": {
36
38
  "@babel/runtime": "^7.17.2",
37
- "@restart/hooks": "^0.4.5",
38
- "@restart/ui": "^1.0.2",
39
- "@types/invariant": "^2.2.35",
40
- "@types/prop-types": "^15.7.4",
41
- "@types/react": ">=16.14.8",
39
+ "@restart/hooks": "^0.4.6",
40
+ "@restart/ui": "^1.2.0",
42
41
  "@types/react-transition-group": "^4.4.4",
43
- "@types/warning": "^3.0.0",
44
42
  "classnames": "^2.3.1",
45
43
  "dom-helpers": "^5.2.1",
46
44
  "invariant": "^2.2.4",
@@ -51,9 +49,15 @@
51
49
  "warning": "^4.0.3"
52
50
  },
53
51
  "peerDependencies": {
52
+ "@types/react": ">=16.14.8",
54
53
  "react": ">=16.14.0",
55
54
  "react-dom": ">=16.14.0"
56
55
  },
56
+ "peerDependenciesMeta": {
57
+ "@types/react": {
58
+ "optional": true
59
+ }
60
+ },
57
61
  "publishConfig": {
58
62
  "directory": "lib"
59
63
  },