react-bootstrap 2.10.4 → 2.10.5

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.
package/esm/Fade.js CHANGED
@@ -2,6 +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
6
  import transitionEndListener from './transitionEndListener';
6
7
  import triggerBrowserReflow from './triggerBrowserReflow';
7
8
  import TransitionWrapper from './TransitionWrapper';
@@ -29,12 +30,16 @@ const Fade = /*#__PURE__*/React.forwardRef(({
29
30
  triggerBrowserReflow(node);
30
31
  onEnter == null || onEnter(node, isAppearing);
31
32
  }, [onEnter]);
33
+ const {
34
+ major
35
+ } = getReactVersion();
36
+ const childRef = major >= 19 ? children.props.ref : children.ref;
32
37
  return /*#__PURE__*/_jsx(TransitionWrapper, {
33
38
  ref: ref,
34
39
  addEndListener: transitionEndListener,
35
40
  ...props,
36
41
  onEnter: handleEnter,
37
- childRef: children.ref,
42
+ childRef: childRef,
38
43
  children: (status, innerProps) => /*#__PURE__*/React.cloneElement(children, {
39
44
  ...innerProps,
40
45
  className: classNames('fade', className, children.props.className, fadeStyles[status], transitionClasses[status])
package/esm/Form.d.ts CHANGED
@@ -21,13 +21,13 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
21
21
  "aria-label"?: string | undefined;
22
22
  disabled?: boolean | undefined;
23
23
  form?: string | undefined;
24
- formAction?: string | undefined;
24
+ formAction?: string | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_EXPERIMENTAL_FORM_ACTIONS] | undefined;
25
25
  formEncType?: string | undefined;
26
26
  formMethod?: string | undefined;
27
27
  formNoValidate?: boolean | undefined;
28
28
  formTarget?: string | undefined;
29
29
  name?: string | undefined;
30
- value?: string | number | readonly string[] | undefined;
30
+ value?: string | readonly string[] | number | undefined;
31
31
  defaultChecked?: boolean | undefined;
32
32
  defaultValue?: string | number | readonly string[] | undefined;
33
33
  suppressContentEditableWarning?: boolean | undefined;
@@ -73,33 +73,33 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
73
73
  results?: number | undefined;
74
74
  security?: string | undefined;
75
75
  unselectable?: "on" | "off" | undefined;
76
- inputMode?: "search" | "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
76
+ inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined;
77
77
  is?: string | undefined;
78
78
  "aria-activedescendant"?: string | undefined;
79
79
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
80
- "aria-autocomplete"?: "list" | "none" | "both" | "inline" | undefined;
80
+ "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined;
81
81
  "aria-braillelabel"?: string | undefined;
82
82
  "aria-brailleroledescription"?: string | undefined;
83
83
  "aria-busy"?: (boolean | "true" | "false") | undefined;
84
- "aria-checked"?: boolean | "true" | "false" | "mixed" | undefined;
84
+ "aria-checked"?: boolean | "false" | "mixed" | "true" | undefined;
85
85
  "aria-colcount"?: number | undefined;
86
86
  "aria-colindex"?: number | undefined;
87
87
  "aria-colindextext"?: string | undefined;
88
88
  "aria-colspan"?: number | undefined;
89
89
  "aria-controls"?: string | undefined;
90
- "aria-current"?: boolean | "true" | "false" | "time" | "page" | "step" | "location" | "date" | undefined;
90
+ "aria-current"?: boolean | "false" | "true" | "page" | "step" | "location" | "date" | "time" | undefined;
91
91
  "aria-describedby"?: string | undefined;
92
92
  "aria-description"?: string | undefined;
93
93
  "aria-details"?: string | undefined;
94
94
  "aria-disabled"?: (boolean | "true" | "false") | undefined;
95
- "aria-dropeffect"?: "link" | "none" | "copy" | "move" | "execute" | "popup" | undefined;
95
+ "aria-dropeffect"?: "none" | "copy" | "execute" | "link" | "move" | "popup" | undefined;
96
96
  "aria-errormessage"?: string | undefined;
97
97
  "aria-expanded"?: (boolean | "true" | "false") | undefined;
98
98
  "aria-flowto"?: string | undefined;
99
99
  "aria-grabbed"?: (boolean | "true" | "false") | undefined;
100
- "aria-haspopup"?: boolean | "true" | "false" | "dialog" | "grid" | "listbox" | "menu" | "tree" | undefined;
100
+ "aria-haspopup"?: boolean | "false" | "true" | "menu" | "listbox" | "tree" | "grid" | "dialog" | undefined;
101
101
  "aria-hidden"?: (boolean | "true" | "false") | undefined;
102
- "aria-invalid"?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
102
+ "aria-invalid"?: boolean | "false" | "true" | "grammar" | "spelling" | undefined;
103
103
  "aria-keyshortcuts"?: string | undefined;
104
104
  "aria-labelledby"?: string | undefined;
105
105
  "aria-level"?: number | undefined;
@@ -111,9 +111,9 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
111
111
  "aria-owns"?: string | undefined;
112
112
  "aria-placeholder"?: string | undefined;
113
113
  "aria-posinset"?: number | undefined;
114
- "aria-pressed"?: boolean | "true" | "false" | "mixed" | undefined;
114
+ "aria-pressed"?: boolean | "false" | "mixed" | "true" | undefined;
115
115
  "aria-readonly"?: (boolean | "true" | "false") | undefined;
116
- "aria-relevant"?: "text" | "all" | "additions" | "additions removals" | "additions text" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
116
+ "aria-relevant"?: "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text" | "text additions" | "text removals" | undefined;
117
117
  "aria-required"?: (boolean | "true" | "false") | undefined;
118
118
  "aria-roledescription"?: string | undefined;
119
119
  "aria-rowcount"?: number | undefined;
@@ -127,7 +127,7 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
127
127
  "aria-valuemin"?: number | undefined;
128
128
  "aria-valuenow"?: number | undefined;
129
129
  "aria-valuetext"?: string | undefined;
130
- children?: React.ReactNode;
130
+ children?: React.ReactNode | undefined;
131
131
  dangerouslySetInnerHTML?: {
132
132
  __html: string | TrustedHTML;
133
133
  } | undefined;
@@ -296,8 +296,8 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
296
296
  pattern?: string | undefined;
297
297
  reverse?: boolean | undefined;
298
298
  bsPrefix?: string | undefined;
299
- height?: string | number | undefined;
300
- width?: string | number | undefined;
299
+ height?: number | string | undefined;
300
+ width?: number | string | undefined;
301
301
  size?: number | undefined;
302
302
  inline?: boolean | undefined;
303
303
  multiple?: boolean | undefined;
@@ -307,16 +307,16 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
307
307
  accept?: string | undefined;
308
308
  capture?: boolean | "user" | "environment" | undefined;
309
309
  checked?: boolean | undefined;
310
- enterKeyHint?: "search" | "next" | "enter" | "done" | "go" | "previous" | "send" | undefined;
310
+ enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined;
311
311
  maxLength?: number | undefined;
312
312
  minLength?: number | undefined;
313
313
  src?: string | undefined;
314
- max?: string | number | undefined;
315
- min?: string | number | undefined;
314
+ max?: number | string | undefined;
315
+ min?: number | string | undefined;
316
316
  placeholder?: string | undefined;
317
317
  readOnly?: boolean | undefined;
318
318
  required?: boolean | undefined;
319
- step?: string | number | undefined;
319
+ step?: number | string | undefined;
320
320
  feedback?: React.ReactNode;
321
321
  isValid?: boolean | undefined;
322
322
  isInvalid?: boolean | undefined;
@@ -2,16 +2,25 @@
2
2
 
3
3
  import * as React from 'react';
4
4
  import { useContext } from 'react';
5
+ import useEventCallback from '@restart/hooks/useEventCallback';
5
6
  import Offcanvas from './Offcanvas';
6
7
  import NavbarContext from './NavbarContext';
7
8
  import { jsx as _jsx } from "react/jsx-runtime";
8
- const NavbarOffcanvas = /*#__PURE__*/React.forwardRef((props, ref) => {
9
+ const NavbarOffcanvas = /*#__PURE__*/React.forwardRef(({
10
+ onHide,
11
+ ...props
12
+ }, ref) => {
9
13
  const context = useContext(NavbarContext);
14
+ const handleHide = useEventCallback(() => {
15
+ context == null || context.onToggle == null || context.onToggle();
16
+ onHide == null || onHide();
17
+ });
10
18
  return /*#__PURE__*/_jsx(Offcanvas, {
11
19
  ref: ref,
12
20
  show: !!(context != null && context.expanded),
13
21
  ...props,
14
- renderStaticNode: true
22
+ renderStaticNode: true,
23
+ onHide: handleHide
15
24
  });
16
25
  });
17
26
  NavbarOffcanvas.displayName = 'NavbarOffcanvas';
package/esm/Offcanvas.js CHANGED
@@ -4,13 +4,12 @@ import classNames from 'classnames';
4
4
  import useBreakpoint from '@restart/hooks/useBreakpoint';
5
5
  import useEventCallback from '@restart/hooks/useEventCallback';
6
6
  import * as React from 'react';
7
- import { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
7
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
8
8
  import BaseModal from '@restart/ui/Modal';
9
9
  import Fade from './Fade';
10
10
  import OffcanvasBody from './OffcanvasBody';
11
11
  import OffcanvasToggling from './OffcanvasToggling';
12
12
  import ModalContext from './ModalContext';
13
- import NavbarContext from './NavbarContext';
14
13
  import OffcanvasHeader from './OffcanvasHeader';
15
14
  import OffcanvasTitle from './OffcanvasTitle';
16
15
  import { useBootstrapPrefix } from './ThemeProvider';
@@ -62,20 +61,14 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
62
61
  }, ref) => {
63
62
  const modalManager = useRef();
64
63
  bsPrefix = useBootstrapPrefix(bsPrefix, 'offcanvas');
65
- const {
66
- onToggle
67
- } = useContext(NavbarContext) || {};
68
64
  const [showOffcanvas, setShowOffcanvas] = useState(false);
65
+ const handleHide = useEventCallback(onHide);
69
66
  const hideResponsiveOffcanvas = useBreakpoint(responsive || 'xs', 'up');
70
67
  useEffect(() => {
71
68
  // Handles the case where screen is resized while the responsive
72
69
  // offcanvas is shown. If `responsive` not provided, just use `show`.
73
70
  setShowOffcanvas(responsive ? show && !hideResponsiveOffcanvas : show);
74
71
  }, [show, responsive, hideResponsiveOffcanvas]);
75
- const handleHide = useEventCallback(() => {
76
- onToggle == null || onToggle();
77
- onHide == null || onHide();
78
- });
79
72
  const modalContext = useMemo(() => ({
80
73
  onHide: handleHide
81
74
  }), [handleHide]);
@@ -20,7 +20,7 @@ export declare function useBootstrapBreakpoints(): string[];
20
20
  export declare function useBootstrapMinBreakpoint(): string | undefined;
21
21
  export declare function useIsRTL(): boolean;
22
22
  declare function createBootstrapComponent(Component: any, opts: any): React.ForwardRefExoticComponent<{
23
- bsPrefix?: string | undefined;
23
+ bsPrefix?: string;
24
24
  } & React.RefAttributes<any>>;
25
25
  export { createBootstrapComponent, Consumer as ThemeConsumer };
26
26
  export default ThemeProvider;
@@ -5,10 +5,10 @@ export type TransitionWrapperProps = TransitionProps & {
5
5
  children: React.ReactElement | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
6
6
  };
7
7
  declare const TransitionWrapper: React.ForwardRefExoticComponent<(Omit<import("react-transition-group/Transition").TimeoutProps<undefined> & {
8
- childRef?: React.Ref<unknown> | undefined;
8
+ childRef?: React.Ref<unknown>;
9
9
  children: React.ReactElement | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
10
10
  }, "ref"> | Omit<import("react-transition-group/Transition").EndListenerProps<undefined> & {
11
- childRef?: React.Ref<unknown> | undefined;
11
+ childRef?: React.Ref<unknown>;
12
12
  children: React.ReactElement | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
13
13
  }, "ref">) & React.RefAttributes<Transition<any>>>;
14
14
  export default TransitionWrapper;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export default function getInitialPopperStyles(position?: React.CSSProperties['position']): Partial<React.CSSProperties>;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export default function safeFindDOMNode(componentOrElement: React.Component | Element | null | undefined): Element | Text | null;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import { Offset, Options } from '@restart/ui/usePopper';
3
2
  export default function useOverlayOffset(customOffset?: Offset): [React.RefObject<HTMLElement>, Options['modifiers']];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bootstrap",
3
- "version": "2.10.4",
3
+ "version": "2.10.5",
4
4
  "description": "Bootstrap 5 components built with React",
5
5
  "keywords": [
6
6
  "bootstrap",
@@ -62,5 +62,6 @@
62
62
  },
63
63
  "release": {
64
64
  "conventionalCommits": true
65
- }
65
+ },
66
+ "packageManager": "yarn@1.22.19+sha1.4ba7fc5c6e704fce2066ecbfb0b0d8976fe62447"
66
67
  }