react-bootstrap 2.5.0-beta.0 → 2.5.0-beta.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/Dropdown.d.ts CHANGED
@@ -6,7 +6,6 @@ import { AlignType } from './types';
6
6
  export interface DropdownProps extends BaseDropdownProps, BsPrefixProps, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect' | 'children'> {
7
7
  drop?: DropDirection;
8
8
  align?: AlignType;
9
- flip?: boolean;
10
9
  focusFirstItemOnShow?: boolean | 'keyboard';
11
10
  navbar?: boolean;
12
11
  autoClose?: boolean | 'outside' | 'inside';
@@ -9,6 +9,7 @@ export interface DropdownButtonProps extends Omit<DropdownProps, 'title'>, Props
9
9
  renderMenuOnMount?: boolean;
10
10
  rootCloseEvent?: 'click' | 'mousedown';
11
11
  menuVariant?: DropdownMenuVariant;
12
+ flip?: boolean;
12
13
  }
13
14
  /**
14
15
  * A convenience component for simple or general use dropdowns. Renders a `Button` toggle and all `children`
@@ -71,6 +71,13 @@ const propTypes = {
71
71
  */
72
72
  menuVariant: _propTypes.default.oneOf(['dark']),
73
73
 
74
+ /**
75
+ * Allow Dropdown to flip in case of an overlapping on the reference element. For more information refer to
76
+ * Popper.js's flip [docs](https://popper.js.org/docs/v2/modifiers/flip/).
77
+ *
78
+ */
79
+ flip: _propTypes.default.bool,
80
+
74
81
  /** @ignore */
75
82
  bsPrefix: _propTypes.default.string,
76
83
 
@@ -103,6 +110,7 @@ const DropdownButton = /*#__PURE__*/React.forwardRef(({
103
110
  href,
104
111
  id,
105
112
  menuVariant,
113
+ flip,
106
114
  ...props
107
115
  }, ref) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Dropdown.default, {
108
116
  ref: ref,
@@ -120,6 +128,7 @@ const DropdownButton = /*#__PURE__*/React.forwardRef(({
120
128
  renderOnMount: renderMenuOnMount,
121
129
  rootCloseEvent: rootCloseEvent,
122
130
  variant: menuVariant,
131
+ flip: flip,
123
132
  children: children
124
133
  })]
125
134
  }));
package/cjs/Offcanvas.js CHANGED
@@ -7,6 +7,8 @@ exports.default = void 0;
7
7
 
8
8
  var _classnames = _interopRequireDefault(require("classnames"));
9
9
 
10
+ var _useBreakpoint = _interopRequireDefault(require("@restart/hooks/useBreakpoint"));
11
+
10
12
  var _useEventCallback = _interopRequireDefault(require("@restart/hooks/useEventCallback"));
11
13
 
12
14
  var React = _interopRequireWildcard(require("react"));
@@ -94,6 +96,13 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
94
96
  const {
95
97
  onToggle
96
98
  } = (0, React.useContext)(_NavbarContext.default) || {};
99
+ const [showOffcanvas, setShowOffcanvas] = (0, React.useState)(false);
100
+ const hideResponsiveOffcanvas = (0, _useBreakpoint.default)(responsive || 'xs', 'up');
101
+ (0, React.useEffect)(() => {
102
+ // Handles the case where screen is resized while the responsive
103
+ // offcanvas is shown. If `responsive` not provided, just use `show`.
104
+ setShowOffcanvas(responsive ? show && !hideResponsiveOffcanvas : show);
105
+ }, [show, responsive, hideResponsiveOffcanvas]);
97
106
  const handleHide = (0, _useEventCallback.default)(() => {
98
107
  onToggle == null ? void 0 : onToggle();
99
108
  onHide == null ? void 0 : onHide();
@@ -139,10 +148,10 @@ const Offcanvas = /*#__PURE__*/React.forwardRef(({
139
148
  });
140
149
 
141
150
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
142
- children: [!show && renderDialog({}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalContext.default.Provider, {
151
+ children: [!showOffcanvas && renderDialog({}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_ModalContext.default.Provider, {
143
152
  value: modalContext,
144
153
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Modal.default, {
145
- show: show,
154
+ show: showOffcanvas,
146
155
  ref: ref,
147
156
  backdrop: backdrop,
148
157
  container: container,
@@ -31,6 +31,8 @@ declare namespace OverlayTrigger {
31
31
  /**
32
32
  * Specify which action or actions trigger Overlay visibility
33
33
  *
34
+ * The `click` trigger ignores the configured `delay`.
35
+ *
34
36
  * @type {'hover' | 'click' |'focus' | Array<'hover' | 'click' |'focus'>}
35
37
  */
36
38
  trigger: PropTypes.Requireable<string | (string | null | undefined)[]>;
@@ -11,6 +11,7 @@ export interface SplitButtonProps extends Omit<DropdownProps, 'title'>, PropsFro
11
11
  title: React.ReactNode;
12
12
  toggleLabel?: string;
13
13
  type?: ButtonType;
14
+ flip?: boolean;
14
15
  }
15
16
  /**
16
17
  * A convenience component for simple or general use split button dropdowns. Renders a
@@ -76,6 +76,13 @@ const propTypes = {
76
76
  */
77
77
  rootCloseEvent: _propTypes.default.string,
78
78
 
79
+ /**
80
+ * Allow Dropdown to flip in case of an overlapping on the reference element. For more information refer to
81
+ * Popper.js's flip [docs](https://popper.js.org/docs/v2/modifiers/flip/).
82
+ *
83
+ */
84
+ flip: _propTypes.default.bool,
85
+
79
86
  /** @ignore */
80
87
  bsPrefix: _propTypes.default.string,
81
88
 
@@ -115,6 +122,7 @@ const SplitButton = /*#__PURE__*/React.forwardRef(({
115
122
  menuRole,
116
123
  renderMenuOnMount,
117
124
  rootCloseEvent,
125
+ flip,
118
126
  ...props
119
127
  }, ref) => /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Dropdown.default, {
120
128
  ref: ref,
@@ -145,6 +153,7 @@ const SplitButton = /*#__PURE__*/React.forwardRef(({
145
153
  role: menuRole,
146
154
  renderOnMount: renderMenuOnMount,
147
155
  rootCloseEvent: rootCloseEvent,
156
+ flip: flip,
148
157
  children: children
149
158
  })]
150
159
  }));
package/cjs/Tabs.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { TabsProps as BaseTabsProps } from '@restart/ui/Tabs';
4
+ import { NavProps } from './Nav';
4
5
  import { TransitionType } from './helpers';
5
- export interface TabsProps extends Omit<BaseTabsProps, 'transition'>, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'> {
6
- variant?: 'tabs' | 'pills';
6
+ export interface TabsProps extends Omit<BaseTabsProps, 'transition'>, Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'>, NavProps {
7
7
  transition?: TransitionType;
8
8
  }
9
9
  declare const Tabs: {
@@ -61,6 +61,14 @@ declare const Tabs: {
61
61
  * Unmount tabs (remove it from the DOM) when it is no longer visible
62
62
  */
63
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>;
64
72
  };
65
73
  defaultProps: {
66
74
  variant: string;