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/cjs/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/cjs/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/cjs/Navbar.js CHANGED
@@ -80,8 +80,9 @@ const Navbar = /*#__PURE__*/React.forwardRef((props, ref) => {
80
80
  const navbarContext = (0, React.useMemo)(() => ({
81
81
  onToggle: () => onToggle == null ? void 0 : onToggle(!expanded),
82
82
  bsPrefix,
83
- expanded: !!expanded
84
- }), [bsPrefix, expanded, onToggle]);
83
+ expanded: !!expanded,
84
+ expand
85
+ }), [bsPrefix, expanded, expand, onToggle]);
85
86
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_NavbarContext.default.Provider, {
86
87
  value: navbarContext,
87
88
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectableContext.default.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;
@@ -7,6 +7,12 @@ exports.default = void 0;
7
7
 
8
8
  var React = _interopRequireWildcard(require("react"));
9
9
 
10
+ var _useBreakpoint = _interopRequireDefault(require("@restart/hooks/useBreakpoint"));
11
+
12
+ var _classnames = _interopRequireDefault(require("classnames"));
13
+
14
+ var _ThemeProvider = require("./ThemeProvider");
15
+
10
16
  var _Offcanvas = _interopRequireDefault(require("./Offcanvas"));
11
17
 
12
18
  var _NavbarContext = _interopRequireDefault(require("./NavbarContext"));
@@ -17,11 +23,59 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
17
23
 
18
24
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
25
 
20
- const NavbarOffcanvas = /*#__PURE__*/React.forwardRef((props, ref) => {
26
+ const NavbarOffcanvas = /*#__PURE__*/React.forwardRef(({
27
+ className,
28
+ bsPrefix,
29
+ backdrop,
30
+ backdropClassName,
31
+ keyboard,
32
+ scroll,
33
+ placement,
34
+ autoFocus,
35
+ enforceFocus,
36
+ restoreFocus,
37
+ restoreFocusOptions,
38
+ onShow,
39
+ onHide,
40
+ onEscapeKeyDown,
41
+ onEnter,
42
+ onEntering,
43
+ onEntered,
44
+ onExit,
45
+ onExiting,
46
+ onExited,
47
+ ...props
48
+ }, ref) => {
21
49
  const context = (0, React.useContext)(_NavbarContext.default);
22
- return /*#__PURE__*/(0, _jsxRuntime.jsx)(_Offcanvas.default, {
50
+ bsPrefix = (0, _ThemeProvider.useBootstrapPrefix)(bsPrefix, 'offcanvas');
51
+ const hasExpandProp = typeof (context == null ? void 0 : context.expand) === 'string';
52
+ const shouldExpand = (0, _useBreakpoint.default)(hasExpandProp ? context.expand : 'xs', 'up');
53
+ return hasExpandProp && shouldExpand ? /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
54
+ ref: ref,
55
+ ...props,
56
+ className: (0, _classnames.default)(className, bsPrefix, `${bsPrefix}-${placement}`)
57
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_Offcanvas.default, {
23
58
  ref: ref,
24
59
  show: !!(context != null && context.expanded),
60
+ bsPrefix: bsPrefix,
61
+ backdrop: backdrop,
62
+ backdropClassName: backdropClassName,
63
+ keyboard: keyboard,
64
+ scroll: scroll,
65
+ placement: placement,
66
+ autoFocus: autoFocus,
67
+ enforceFocus: enforceFocus,
68
+ restoreFocus: restoreFocus,
69
+ restoreFocusOptions: restoreFocusOptions,
70
+ onShow: onShow,
71
+ onHide: onHide,
72
+ onEscapeKeyDown: onEscapeKeyDown,
73
+ onEnter: onEnter,
74
+ onEntering: onEntering,
75
+ onEntered: onEntered,
76
+ onExit: onExit,
77
+ onExiting: onExiting,
78
+ onExited: onExited,
25
79
  ...props
26
80
  });
27
81
  });
@@ -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;
@@ -5,11 +5,13 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.default = getTabTransitionComponent;
7
7
 
8
+ var _NoopTransition = _interopRequireDefault(require("@restart/ui/NoopTransition"));
9
+
8
10
  var _Fade = _interopRequireDefault(require("./Fade"));
9
11
 
10
12
  function getTabTransitionComponent(transition) {
11
13
  if (typeof transition === 'boolean') {
12
- return transition ? _Fade.default : undefined;
14
+ return transition ? _Fade.default : _NoopTransition.default;
13
15
  }
14
16
 
15
17
  return transition;