react-bootstrap 2.10.5 → 2.10.7

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.
@@ -8,6 +8,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
8
8
  const AccordionHeader = /*#__PURE__*/React.forwardRef(({
9
9
  // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
10
10
  as: Component = 'h2',
11
+ 'aria-controls': ariaControls,
11
12
  bsPrefix,
12
13
  className,
13
14
  children,
@@ -21,6 +22,7 @@ const AccordionHeader = /*#__PURE__*/React.forwardRef(({
21
22
  className: classNames(className, bsPrefix),
22
23
  children: /*#__PURE__*/_jsx(AccordionButton, {
23
24
  onClick: onClick,
25
+ "aria-controls": ariaControls,
24
26
  children: children
25
27
  })
26
28
  });
package/esm/Collapse.js CHANGED
@@ -2,6 +2,7 @@ import classNames from 'classnames';
2
2
  import css from 'dom-helpers/css';
3
3
  import React, { useMemo } from 'react';
4
4
  import { ENTERED, ENTERING, EXITED, EXITING } from 'react-transition-group/Transition';
5
+ import { getChildRef } from '@restart/ui/utils';
5
6
  import transitionEndListener from './transitionEndListener';
6
7
  import createChainedFunction from './createChainedFunction';
7
8
  import triggerBrowserReflow from './triggerBrowserReflow';
@@ -77,7 +78,7 @@ const Collapse = /*#__PURE__*/React.forwardRef(({
77
78
  onEntered: handleEntered,
78
79
  onExit: handleExit,
79
80
  onExiting: handleExiting,
80
- childRef: children.ref,
81
+ childRef: getChildRef(children),
81
82
  in: inProp,
82
83
  timeout: timeout,
83
84
  mountOnEnter: mountOnEnter,
package/esm/Dropdown.d.ts CHANGED
@@ -3,7 +3,7 @@ import { DropdownProps as BaseDropdownProps } from '@restart/ui/Dropdown';
3
3
  import { DropDirection } from './DropdownContext';
4
4
  import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
5
5
  import { AlignType } from './types';
6
- export interface DropdownProps extends BaseDropdownProps, BsPrefixProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect' | 'children'> {
6
+ export interface DropdownProps extends BaseDropdownProps, BsPrefixProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect' | 'children' | 'onToggle'> {
7
7
  drop?: DropDirection;
8
8
  align?: AlignType;
9
9
  focusFirstItemOnShow?: boolean | 'keyboard';
package/esm/Fade.js CHANGED
@@ -2,7 +2,7 @@ import classNames from 'classnames';
2
2
  import * as React from 'react';
3
3
  import { useCallback } from 'react';
4
4
  import { ENTERED, ENTERING } from 'react-transition-group/Transition';
5
- import { getReactVersion } from '@restart/ui/utils';
5
+ import { getChildRef } from '@restart/ui/utils';
6
6
  import transitionEndListener from './transitionEndListener';
7
7
  import triggerBrowserReflow from './triggerBrowserReflow';
8
8
  import TransitionWrapper from './TransitionWrapper';
@@ -30,16 +30,12 @@ const Fade = /*#__PURE__*/React.forwardRef(({
30
30
  triggerBrowserReflow(node);
31
31
  onEnter == null || onEnter(node, isAppearing);
32
32
  }, [onEnter]);
33
- const {
34
- major
35
- } = getReactVersion();
36
- const childRef = major >= 19 ? children.props.ref : children.ref;
37
33
  return /*#__PURE__*/_jsx(TransitionWrapper, {
38
34
  ref: ref,
39
35
  addEndListener: transitionEndListener,
40
36
  ...props,
41
37
  onEnter: handleEnter,
42
- childRef: childRef,
38
+ childRef: getChildRef(children),
43
39
  children: (status, innerProps) => /*#__PURE__*/React.cloneElement(children, {
44
40
  ...innerProps,
45
41
  className: classNames('fade', className, children.props.className, fadeStyles[status], transitionClasses[status])
package/esm/Nav.js CHANGED
@@ -1,7 +1,6 @@
1
1
  "use client";
2
2
 
3
3
  import classNames from 'classnames';
4
- import all from 'prop-types-extra/lib/all';
5
4
  import * as React from 'react';
6
5
  import { useContext } from 'react';
7
6
  import { useUncontrolled } from 'uncontrollable';
@@ -3,6 +3,7 @@
3
3
  import classNames from 'classnames';
4
4
  import * as React from 'react';
5
5
  import { ENTERED, ENTERING, EXITING } from 'react-transition-group/Transition';
6
+ import { getChildRef } from '@restart/ui/utils';
6
7
  import transitionEndListener from './transitionEndListener';
7
8
  import TransitionWrapper from './TransitionWrapper';
8
9
  import { useBootstrapPrefix } from './ThemeProvider';
@@ -30,7 +31,7 @@ const OffcanvasToggling = /*#__PURE__*/React.forwardRef(({
30
31
  unmountOnExit: unmountOnExit,
31
32
  appear: appear,
32
33
  ...props,
33
- childRef: children.ref,
34
+ childRef: getChildRef(children),
34
35
  children: (status, innerProps) => /*#__PURE__*/React.cloneElement(children, {
35
36
  ...innerProps,
36
37
  className: classNames(className, children.props.className, (status === ENTERING || status === EXITING) && `${bsPrefix}-toggling`, transitionStyles[status])
@@ -8,6 +8,7 @@ import useTimeout from '@restart/hooks/useTimeout';
8
8
  import warning from 'warning';
9
9
  import { useUncontrolledProp } from 'uncontrollable';
10
10
  import useMergedRefs from '@restart/hooks/useMergedRefs';
11
+ import { getChildRef } from '@restart/ui/utils';
11
12
  import Overlay from './Overlay';
12
13
  import safeFindDOMNode from './safeFindDOMNode';
13
14
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -49,7 +50,7 @@ const OverlayTrigger = ({
49
50
  ...props
50
51
  }) => {
51
52
  const triggerNodeRef = useRef(null);
52
- const mergedRef = useMergedRefs(triggerNodeRef, children.ref);
53
+ const mergedRef = useMergedRefs(triggerNodeRef, getChildRef(children));
53
54
  const timeout = useTimeout();
54
55
  const hoverStateRef = useRef('');
55
56
  const [show, setShow] = useUncontrolledProp(propsShow, defaultShow, onToggle);
package/esm/Ratio.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { BsPrefixProps } from './helpers';
3
3
  export type AspectRatio = '1x1' | '4x3' | '16x9' | '21x9' | string;
4
4
  export interface RatioProps extends BsPrefixProps, React.HTMLAttributes<HTMLDivElement> {
5
- children: React.ReactChild;
5
+ children: React.ReactElement | string | number;
6
6
  aspectRatio?: AspectRatio | number;
7
7
  }
8
8
  declare const Ratio: React.ForwardRefExoticComponent<RatioProps & React.RefAttributes<HTMLDivElement>>;
package/esm/Tabs.d.ts CHANGED
@@ -1,75 +1,9 @@
1
1
  import * as React from 'react';
2
- import PropTypes from 'prop-types';
3
2
  import { TabsProps as BaseTabsProps } from '@restart/ui/Tabs';
4
3
  import { NavProps } from './Nav';
5
4
  import { TransitionType } from './helpers';
6
5
  export interface TabsProps extends Omit<BaseTabsProps, 'transition'>, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'>, NavProps {
7
6
  transition?: TransitionType;
8
7
  }
9
- declare const Tabs: {
10
- (props: TabsProps): React.JSX.Element;
11
- propTypes: {
12
- /**
13
- * Mark the Tab with a matching `eventKey` as active.
14
- *
15
- * @controllable onSelect
16
- */
17
- activeKey: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
18
- /** The default active key that is selected on start */
19
- defaultActiveKey: PropTypes.Requireable<NonNullable<string | number | null | undefined>>;
20
- /**
21
- * Navigation style
22
- *
23
- * @type {('tabs'| 'pills' | 'underline')}
24
- */
25
- variant: PropTypes.Requireable<string>;
26
- /**
27
- * Sets a default animation strategy for all children `<TabPane>`s.<tbcont
28
- *
29
- * Defaults to `<Fade>` animation, else use `false` to disable or a
30
- * react-transition-group `<Transition/>` component.
31
- *
32
- * @type {Transition | false}
33
- * @default {Fade}
34
- */
35
- transition: PropTypes.Requireable<NonNullable<boolean | PropTypes.ReactComponentLike | null | undefined>>;
36
- /**
37
- * HTML id attribute, required if no `generateChildId` prop
38
- * is specified.
39
- *
40
- * @type {string}
41
- */
42
- id: PropTypes.Requireable<string>;
43
- /**
44
- * Callback fired when a Tab is selected.
45
- *
46
- * ```js
47
- * function (
48
- * Any eventKey,
49
- * SyntheticEvent event?
50
- * )
51
- * ```
52
- *
53
- * @controllable activeKey
54
- */
55
- onSelect: PropTypes.Requireable<(...args: any[]) => any>;
56
- /**
57
- * Wait until the first "enter" transition to mount tabs (add them to the DOM)
58
- */
59
- mountOnEnter: PropTypes.Requireable<boolean>;
60
- /**
61
- * Unmount tabs (remove it from the DOM) when it is no longer visible
62
- */
63
- unmountOnExit: PropTypes.Requireable<boolean>;
64
- /**
65
- * Have all `Tabs`s proportionately fill all available width.
66
- */
67
- fill: PropTypes.Requireable<boolean>;
68
- /**
69
- * Have all `Tab`s evenly fill all available width.
70
- */
71
- justify: PropTypes.Requireable<boolean>;
72
- };
73
- displayName: string;
74
- };
8
+ declare const Tabs: React.FC<TabsProps>;
75
9
  export default Tabs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bootstrap",
3
- "version": "2.10.5",
3
+ "version": "2.10.7",
4
4
  "description": "Bootstrap 5 components built with React",
5
5
  "keywords": [
6
6
  "bootstrap",
@@ -36,7 +36,8 @@
36
36
  "dependencies": {
37
37
  "@babel/runtime": "^7.24.7",
38
38
  "@restart/hooks": "^0.4.9",
39
- "@restart/ui": "^1.6.9",
39
+ "@restart/ui": "^1.9.2",
40
+ "@types/prop-types": "^15.7.12",
40
41
  "@types/react-transition-group": "^4.4.6",
41
42
  "classnames": "^2.3.2",
42
43
  "dom-helpers": "^5.2.1",