react-bootstrap 2.3.0 → 2.3.1

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/Form.d.ts CHANGED
@@ -72,9 +72,9 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
72
72
  inputMode?: "search" | "text" | "none" | "tel" | "url" | "email" | "numeric" | "decimal" | undefined;
73
73
  is?: string | undefined;
74
74
  'aria-activedescendant'?: string | undefined;
75
- 'aria-atomic'?: boolean | "true" | "false" | undefined;
75
+ 'aria-atomic'?: (boolean | "true" | "false") | undefined;
76
76
  'aria-autocomplete'?: "list" | "none" | "inline" | "both" | undefined;
77
- 'aria-busy'?: boolean | "true" | "false" | undefined;
77
+ 'aria-busy'?: (boolean | "true" | "false") | undefined;
78
78
  'aria-checked'?: boolean | "true" | "false" | "mixed" | undefined;
79
79
  'aria-colcount'?: number | undefined;
80
80
  'aria-colindex'?: number | undefined;
@@ -83,36 +83,36 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
83
83
  'aria-current'?: boolean | "time" | "true" | "false" | "page" | "step" | "location" | "date" | undefined;
84
84
  'aria-describedby'?: string | undefined;
85
85
  'aria-details'?: string | undefined;
86
- 'aria-disabled'?: boolean | "true" | "false" | undefined;
86
+ 'aria-disabled'?: (boolean | "true" | "false") | undefined;
87
87
  'aria-dropeffect'?: "link" | "none" | "copy" | "execute" | "move" | "popup" | undefined;
88
88
  'aria-errormessage'?: string | undefined;
89
- 'aria-expanded'?: boolean | "true" | "false" | undefined;
89
+ 'aria-expanded'?: (boolean | "true" | "false") | undefined;
90
90
  'aria-flowto'?: string | undefined;
91
- 'aria-grabbed'?: boolean | "true" | "false" | undefined;
91
+ 'aria-grabbed'?: (boolean | "true" | "false") | undefined;
92
92
  'aria-haspopup'?: boolean | "dialog" | "menu" | "true" | "false" | "grid" | "listbox" | "tree" | undefined;
93
- 'aria-hidden'?: boolean | "true" | "false" | undefined;
93
+ 'aria-hidden'?: (boolean | "true" | "false") | undefined;
94
94
  'aria-invalid'?: boolean | "true" | "false" | "grammar" | "spelling" | undefined;
95
95
  'aria-keyshortcuts'?: string | undefined;
96
96
  'aria-label'?: string | undefined;
97
97
  'aria-labelledby'?: string | undefined;
98
98
  'aria-level'?: number | undefined;
99
99
  'aria-live'?: "off" | "assertive" | "polite" | undefined;
100
- 'aria-modal'?: boolean | "true" | "false" | undefined;
101
- 'aria-multiline'?: boolean | "true" | "false" | undefined;
102
- 'aria-multiselectable'?: boolean | "true" | "false" | undefined;
100
+ 'aria-modal'?: (boolean | "true" | "false") | undefined;
101
+ 'aria-multiline'?: (boolean | "true" | "false") | undefined;
102
+ 'aria-multiselectable'?: (boolean | "true" | "false") | undefined;
103
103
  'aria-orientation'?: "horizontal" | "vertical" | undefined;
104
104
  'aria-owns'?: string | undefined;
105
105
  'aria-placeholder'?: string | undefined;
106
106
  'aria-posinset'?: number | undefined;
107
107
  'aria-pressed'?: boolean | "true" | "false" | "mixed" | undefined;
108
- 'aria-readonly'?: boolean | "true" | "false" | undefined;
108
+ 'aria-readonly'?: (boolean | "true" | "false") | undefined;
109
109
  'aria-relevant'?: "text" | "additions" | "additions removals" | "additions text" | "all" | "removals" | "removals additions" | "removals text" | "text additions" | "text removals" | undefined;
110
- 'aria-required'?: boolean | "true" | "false" | undefined;
110
+ 'aria-required'?: (boolean | "true" | "false") | undefined;
111
111
  'aria-roledescription'?: string | undefined;
112
112
  'aria-rowcount'?: number | undefined;
113
113
  'aria-rowindex'?: number | undefined;
114
114
  'aria-rowspan'?: number | undefined;
115
- 'aria-selected'?: boolean | "true" | "false" | undefined;
115
+ 'aria-selected'?: (boolean | "true" | "false") | undefined;
116
116
  'aria-setsize'?: number | undefined;
117
117
  'aria-sort'?: "none" | "ascending" | "descending" | "other" | undefined;
118
118
  'aria-valuemax'?: number | undefined;
@@ -297,7 +297,7 @@ declare const _default: BsPrefixRefForwardingComponent<"form", FormProps> & {
297
297
  autoComplete?: string | undefined;
298
298
  alt?: string | undefined;
299
299
  accept?: string | undefined;
300
- capture?: string | boolean | undefined;
300
+ capture?: boolean | "user" | "environment" | undefined;
301
301
  checked?: boolean | undefined;
302
302
  maxLength?: number | undefined;
303
303
  minLength?: number | undefined;
package/esm/Navbar.d.ts CHANGED
@@ -15,7 +15,7 @@ export interface NavbarProps extends BsPrefixProps, Omit<React.HTMLAttributes<HT
15
15
  declare const _default: BsPrefixRefForwardingComponent<"nav", NavbarProps> & {
16
16
  Brand: BsPrefixRefForwardingComponent<"a", import("./NavbarBrand").NavbarBrandProps>;
17
17
  Collapse: React.ForwardRefExoticComponent<import("./NavbarCollapse").NavbarCollapseProps & React.RefAttributes<HTMLDivElement>>;
18
- Offcanvas: React.ForwardRefExoticComponent<Pick<import("./Offcanvas").OffcanvasProps, keyof import("./Offcanvas").OffcanvasProps> & React.RefAttributes<HTMLDivElement>>;
18
+ Offcanvas: React.ForwardRefExoticComponent<Pick<import("./NavbarOffcanvas").NavbarOffcanvasProps, keyof import("./Offcanvas").OffcanvasProps> & React.RefAttributes<HTMLDivElement>>;
19
19
  Text: BsPrefixRefForwardingComponent<"span", unknown>;
20
20
  Toggle: BsPrefixRefForwardingComponent<"button", import("./NavbarToggle").NavbarToggleProps>;
21
21
  };
package/esm/Navbar.js CHANGED
@@ -58,8 +58,9 @@ const Navbar = /*#__PURE__*/React.forwardRef((props, ref) => {
58
58
  const navbarContext = useMemo(() => ({
59
59
  onToggle: () => onToggle == null ? void 0 : onToggle(!expanded),
60
60
  bsPrefix,
61
- expanded: !!expanded
62
- }), [bsPrefix, expanded, onToggle]);
61
+ expanded: !!expanded,
62
+ expand
63
+ }), [bsPrefix, expanded, expand, onToggle]);
63
64
  return /*#__PURE__*/_jsx(NavbarContext.Provider, {
64
65
  value: navbarContext,
65
66
  children: /*#__PURE__*/_jsx(SelectableContext.Provider, {
@@ -3,6 +3,7 @@ export interface NavbarContextType {
3
3
  onToggle: () => void;
4
4
  bsPrefix?: string;
5
5
  expanded: boolean;
6
+ expand?: boolean | string | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
6
7
  }
7
8
  declare const context: React.Context<NavbarContextType | null>;
8
9
  export default context;
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
2
  import { OffcanvasProps } from './Offcanvas';
3
- declare const NavbarOffcanvas: React.ForwardRefExoticComponent<Pick<OffcanvasProps, keyof OffcanvasProps> & React.RefAttributes<HTMLDivElement>>;
3
+ export declare type NavbarOffcanvasProps = Omit<OffcanvasProps, 'show'>;
4
+ declare const NavbarOffcanvas: React.ForwardRefExoticComponent<Pick<NavbarOffcanvasProps, keyof OffcanvasProps> & React.RefAttributes<HTMLDivElement>>;
4
5
  export default NavbarOffcanvas;
@@ -1,13 +1,64 @@
1
1
  import * as React from 'react';
2
2
  import { useContext } from 'react';
3
+ import useBreakpoint from '@restart/hooks/useBreakpoint';
4
+ import classNames from 'classnames';
5
+ import { useBootstrapPrefix } from './ThemeProvider';
3
6
  import Offcanvas from './Offcanvas';
4
7
  import NavbarContext from './NavbarContext';
5
8
  import { jsx as _jsx } from "react/jsx-runtime";
6
- const NavbarOffcanvas = /*#__PURE__*/React.forwardRef((props, ref) => {
9
+ const NavbarOffcanvas = /*#__PURE__*/React.forwardRef(({
10
+ className,
11
+ bsPrefix,
12
+ backdrop,
13
+ backdropClassName,
14
+ keyboard,
15
+ scroll,
16
+ placement,
17
+ autoFocus,
18
+ enforceFocus,
19
+ restoreFocus,
20
+ restoreFocusOptions,
21
+ onShow,
22
+ onHide,
23
+ onEscapeKeyDown,
24
+ onEnter,
25
+ onEntering,
26
+ onEntered,
27
+ onExit,
28
+ onExiting,
29
+ onExited,
30
+ ...props
31
+ }, ref) => {
7
32
  const context = useContext(NavbarContext);
8
- return /*#__PURE__*/_jsx(Offcanvas, {
33
+ bsPrefix = useBootstrapPrefix(bsPrefix, 'offcanvas');
34
+ const hasExpandProp = typeof (context == null ? void 0 : context.expand) === 'string';
35
+ const shouldExpand = useBreakpoint(hasExpandProp ? context.expand : 'xs', 'up');
36
+ return hasExpandProp && shouldExpand ? /*#__PURE__*/_jsx("div", {
37
+ ref: ref,
38
+ ...props,
39
+ className: classNames(className, bsPrefix, `${bsPrefix}-${placement}`)
40
+ }) : /*#__PURE__*/_jsx(Offcanvas, {
9
41
  ref: ref,
10
42
  show: !!(context != null && context.expanded),
43
+ bsPrefix: bsPrefix,
44
+ backdrop: backdrop,
45
+ backdropClassName: backdropClassName,
46
+ keyboard: keyboard,
47
+ scroll: scroll,
48
+ placement: placement,
49
+ autoFocus: autoFocus,
50
+ enforceFocus: enforceFocus,
51
+ restoreFocus: restoreFocus,
52
+ restoreFocusOptions: restoreFocusOptions,
53
+ onShow: onShow,
54
+ onHide: onHide,
55
+ onEscapeKeyDown: onEscapeKeyDown,
56
+ onEnter: onEnter,
57
+ onEntering: onEntering,
58
+ onEntered: onEntered,
59
+ onExit: onExit,
60
+ onExiting: onExiting,
61
+ onExited: onExited,
11
62
  ...props
12
63
  });
13
64
  });
@@ -4,5 +4,11 @@ export declare type TransitionWrapperProps = TransitionProps & {
4
4
  childRef?: React.Ref<unknown>;
5
5
  children: React.ReactElement | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
6
6
  };
7
- declare const TransitionWrapper: React.ForwardRefExoticComponent<Pick<TransitionWrapperProps, string | number> & React.RefAttributes<Transition<any>>>;
7
+ declare const TransitionWrapper: React.ForwardRefExoticComponent<(Pick<import("react-transition-group/Transition").TimeoutProps<undefined> & {
8
+ childRef?: React.Ref<unknown> | undefined;
9
+ children: React.ReactElement<any, string | React.JSXElementConstructor<any>> | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
10
+ }, keyof import("react-transition-group/Transition").TimeoutProps<undefined>> | Pick<import("react-transition-group/Transition").EndListenerProps<undefined> & {
11
+ childRef?: React.Ref<unknown> | undefined;
12
+ children: React.ReactElement<any, string | React.JSXElementConstructor<any>> | ((status: TransitionStatus, props: Record<string, unknown>) => React.ReactNode);
13
+ }, keyof import("react-transition-group/Transition").EndListenerProps<undefined>>) & React.RefAttributes<Transition<any>>>;
8
14
  export default TransitionWrapper;
@@ -1,7 +1,8 @@
1
+ import NoopTransition from '@restart/ui/NoopTransition';
1
2
  import Fade from './Fade';
2
3
  export default function getTabTransitionComponent(transition) {
3
4
  if (typeof transition === 'boolean') {
4
- return transition ? Fade : undefined;
5
+ return transition ? Fade : NoopTransition;
5
6
  }
6
7
 
7
8
  return transition;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bootstrap",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "description": "Bootstrap 5 components built with React",
5
5
  "keywords": [
6
6
  "bootstrap",