react-bootstrap 2.0.1 → 2.1.0

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.
Files changed (61) hide show
  1. package/cjs/Accordion.d.ts +5 -4
  2. package/cjs/Accordion.js +4 -2
  3. package/cjs/AccordionButton.js +21 -6
  4. package/cjs/AccordionCollapse.js +2 -2
  5. package/cjs/AccordionContext.d.ts +6 -3
  6. package/cjs/AccordionContext.js +6 -2
  7. package/cjs/ElementChildren.d.ts +6 -1
  8. package/cjs/ElementChildren.js +10 -0
  9. package/cjs/FormCheck.js +4 -2
  10. package/cjs/Modal.d.ts +1 -1
  11. package/cjs/NavDropdown.d.ts +1 -1
  12. package/dist/react-bootstrap.js +104 -44
  13. package/dist/react-bootstrap.min.js +1 -1
  14. package/esm/Accordion.d.ts +5 -4
  15. package/esm/Accordion.js +4 -2
  16. package/esm/AccordionButton.js +21 -6
  17. package/esm/AccordionCollapse.js +2 -2
  18. package/esm/AccordionContext.d.ts +6 -3
  19. package/esm/AccordionContext.js +3 -0
  20. package/esm/ElementChildren.d.ts +6 -1
  21. package/esm/ElementChildren.js +10 -1
  22. package/esm/FormCheck.js +3 -2
  23. package/esm/Modal.d.ts +1 -1
  24. package/esm/NavDropdown.d.ts +1 -1
  25. package/package.json +3 -4
  26. package/cjs/AbstractNav.d.ts +0 -15
  27. package/cjs/AbstractNavItem.d.ts +0 -19
  28. package/cjs/AccordionToggle.d.ts +0 -11
  29. package/cjs/CardColumns.d.ts +0 -2
  30. package/cjs/CardContext.d.ts +0 -6
  31. package/cjs/CardDeck.d.ts +0 -2
  32. package/cjs/FormFile.d.ts +0 -23
  33. package/cjs/FormFileInput.d.ts +0 -10
  34. package/cjs/FormFileLabel.d.ts +0 -7
  35. package/cjs/Jumbotron.d.ts +0 -7
  36. package/cjs/Media.d.ts +0 -8
  37. package/cjs/PopoverContent.d.ts +0 -5
  38. package/cjs/PopoverTitle.d.ts +0 -5
  39. package/cjs/ResponsiveEmbed.d.ts +0 -9
  40. package/cjs/SafeAnchor.d.ts +0 -17
  41. package/cjs/SelectableContext.d.ts +0 -5
  42. package/cjs/TabContext.d.ts +0 -12
  43. package/cjs/usePopperMarginModifiers.d.ts +0 -4
  44. package/esm/AbstractNav.d.ts +0 -15
  45. package/esm/AbstractNavItem.d.ts +0 -19
  46. package/esm/AccordionToggle.d.ts +0 -11
  47. package/esm/CardColumns.d.ts +0 -2
  48. package/esm/CardContext.d.ts +0 -6
  49. package/esm/CardDeck.d.ts +0 -2
  50. package/esm/FormFile.d.ts +0 -23
  51. package/esm/FormFileInput.d.ts +0 -10
  52. package/esm/FormFileLabel.d.ts +0 -7
  53. package/esm/Jumbotron.d.ts +0 -7
  54. package/esm/Media.d.ts +0 -8
  55. package/esm/PopoverContent.d.ts +0 -5
  56. package/esm/PopoverTitle.d.ts +0 -5
  57. package/esm/ResponsiveEmbed.d.ts +0 -9
  58. package/esm/SafeAnchor.d.ts +0 -17
  59. package/esm/SelectableContext.d.ts +0 -5
  60. package/esm/TabContext.d.ts +0 -12
  61. package/esm/usePopperMarginModifiers.d.ts +0 -4
@@ -1,11 +1,12 @@
1
1
  import * as React from 'react';
2
- import { SelectCallback } from '@restart/ui/types';
2
+ import { AccordionSelectCallback, AccordionEventKey } from './AccordionContext';
3
3
  import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
4
4
  export interface AccordionProps extends Omit<React.HTMLAttributes<HTMLElement>, 'onSelect'>, BsPrefixProps {
5
- activeKey?: string;
6
- defaultActiveKey?: string;
7
- onSelect?: SelectCallback;
5
+ activeKey?: AccordionEventKey;
6
+ defaultActiveKey?: AccordionEventKey;
7
+ onSelect?: AccordionSelectCallback;
8
8
  flush?: boolean;
9
+ alwaysOpen?: boolean;
9
10
  }
10
11
  declare const _default: BsPrefixRefForwardingComponent<"div", AccordionProps> & {
11
12
  Button: BsPrefixRefForwardingComponent<"div", import("./AccordionButton").AccordionButtonProps>;
package/esm/Accordion.js CHANGED
@@ -19,6 +19,7 @@ const Accordion = /*#__PURE__*/React.forwardRef((props, ref) => {
19
19
  className,
20
20
  onSelect,
21
21
  flush,
22
+ alwaysOpen,
22
23
  ...controlledProps
23
24
  } = useUncontrolled(props, {
24
25
  activeKey: 'onSelect'
@@ -26,8 +27,9 @@ const Accordion = /*#__PURE__*/React.forwardRef((props, ref) => {
26
27
  const prefix = useBootstrapPrefix(bsPrefix, 'accordion');
27
28
  const contextValue = useMemo(() => ({
28
29
  activeEventKey: activeKey,
29
- onSelect
30
- }), [activeKey, onSelect]);
30
+ onSelect,
31
+ alwaysOpen
32
+ }), [activeKey, onSelect, alwaysOpen]);
31
33
  return /*#__PURE__*/_jsx(AccordionContext.Provider, {
32
34
  value: contextValue,
33
35
  children: /*#__PURE__*/_jsx(Component, {
@@ -1,23 +1,38 @@
1
1
  import * as React from 'react';
2
2
  import { useContext } from 'react';
3
3
  import classNames from 'classnames';
4
- import AccordionContext from './AccordionContext';
4
+ import AccordionContext, { isAccordionItemSelected } from './AccordionContext';
5
5
  import AccordionItemContext from './AccordionItemContext';
6
6
  import { useBootstrapPrefix } from './ThemeProvider';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  export function useAccordionButton(eventKey, onClick) {
9
9
  const {
10
10
  activeEventKey,
11
- onSelect
11
+ onSelect,
12
+ alwaysOpen
12
13
  } = useContext(AccordionContext);
13
14
  return e => {
14
15
  /*
15
16
  Compare the event key in context with the given event key.
16
17
  If they are the same, then collapse the component.
17
18
  */
18
- const eventKeyPassed = eventKey === activeEventKey ? null : eventKey;
19
- if (onSelect) onSelect(eventKeyPassed, e);
20
- if (onClick) onClick(e);
19
+ let eventKeyPassed = eventKey === activeEventKey ? null : eventKey;
20
+
21
+ if (alwaysOpen) {
22
+ if (Array.isArray(activeEventKey)) {
23
+ if (activeEventKey.includes(eventKey)) {
24
+ eventKeyPassed = activeEventKey.filter(k => k !== eventKey);
25
+ } else {
26
+ eventKeyPassed = [...activeEventKey, eventKey];
27
+ }
28
+ } else {
29
+ // activeEventKey is undefined.
30
+ eventKeyPassed = [eventKey];
31
+ }
32
+ }
33
+
34
+ onSelect == null ? void 0 : onSelect(eventKeyPassed, e);
35
+ onClick == null ? void 0 : onClick(e);
21
36
  };
22
37
  }
23
38
  const AccordionButton = /*#__PURE__*/React.forwardRef(({
@@ -46,7 +61,7 @@ const AccordionButton = /*#__PURE__*/React.forwardRef(({
46
61
  onClick: accordionOnClick,
47
62
  ...props,
48
63
  "aria-expanded": eventKey === activeEventKey,
49
- className: classNames(className, bsPrefix, eventKey !== activeEventKey && 'collapsed')
64
+ className: classNames(className, bsPrefix, !isAccordionItemSelected(activeEventKey, eventKey) && 'collapsed')
50
65
  });
51
66
  });
52
67
  AccordionButton.displayName = 'AccordionButton';
@@ -3,7 +3,7 @@ import * as React from 'react';
3
3
  import { useContext } from 'react';
4
4
  import { useBootstrapPrefix } from './ThemeProvider';
5
5
  import Collapse from './Collapse';
6
- import AccordionContext from './AccordionContext';
6
+ import AccordionContext, { isAccordionItemSelected } from './AccordionContext';
7
7
  import { jsx as _jsx } from "react/jsx-runtime";
8
8
  const AccordionCollapse = /*#__PURE__*/React.forwardRef(({
9
9
  as: Component = 'div',
@@ -19,7 +19,7 @@ const AccordionCollapse = /*#__PURE__*/React.forwardRef(({
19
19
  bsPrefix = useBootstrapPrefix(bsPrefix, 'accordion-collapse');
20
20
  return /*#__PURE__*/_jsx(Collapse, {
21
21
  ref: ref,
22
- in: activeEventKey === eventKey,
22
+ in: isAccordionItemSelected(activeEventKey, eventKey),
23
23
  ...props,
24
24
  className: classNames(className, bsPrefix),
25
25
  children: /*#__PURE__*/_jsx(Component, {
@@ -1,8 +1,11 @@
1
1
  import * as React from 'react';
2
- import { SelectCallback } from '@restart/ui/types';
2
+ export declare type AccordionEventKey = string | string[] | null | undefined;
3
+ export declare type AccordionSelectCallback = (eventKey: AccordionEventKey, e: React.SyntheticEvent<unknown>) => void;
3
4
  export interface AccordionContextValue {
4
- activeEventKey?: string;
5
- onSelect?: SelectCallback;
5
+ activeEventKey?: AccordionEventKey;
6
+ onSelect?: AccordionSelectCallback;
7
+ alwaysOpen?: boolean;
6
8
  }
9
+ export declare function isAccordionItemSelected(activeEventKey: AccordionEventKey, eventKey: string): boolean;
7
10
  declare const context: React.Context<AccordionContextValue>;
8
11
  export default context;
@@ -1,4 +1,7 @@
1
1
  import * as React from 'react';
2
+ export function isAccordionItemSelected(activeEventKey, eventKey) {
3
+ return Array.isArray(activeEventKey) ? activeEventKey.includes(eventKey) : activeEventKey === eventKey;
4
+ }
2
5
  const context = /*#__PURE__*/React.createContext({});
3
6
  context.displayName = 'AccordionContext';
4
7
  export default context;
@@ -15,4 +15,9 @@ declare function map<P = any>(children: any, func: (el: React.ReactElement<P>, i
15
15
  * leaf child with the index reflecting the position relative to "valid components".
16
16
  */
17
17
  declare function forEach<P = any>(children: any, func: (el: React.ReactElement<P>, index: number) => void): void;
18
- export { map, forEach };
18
+ /**
19
+ * Finds whether a component's `children` prop includes a React element of the
20
+ * specified type.
21
+ */
22
+ declare function hasChildOfType<P = any>(children: React.ReactNode, type: string | React.JSXElementConstructor<P>): boolean;
23
+ export { map, forEach, hasChildOfType };
@@ -26,5 +26,14 @@ function forEach(children, func) {
26
26
  if ( /*#__PURE__*/React.isValidElement(child)) func(child, index++);
27
27
  });
28
28
  }
29
+ /**
30
+ * Finds whether a component's `children` prop includes a React element of the
31
+ * specified type.
32
+ */
33
+
34
+
35
+ function hasChildOfType(children, type) {
36
+ return React.Children.toArray(children).some(child => /*#__PURE__*/React.isValidElement(child) && child.type === type);
37
+ }
29
38
 
30
- export { map, forEach };
39
+ export { map, forEach, hasChildOfType };
package/esm/FormCheck.js CHANGED
@@ -6,6 +6,7 @@ import FormCheckInput from './FormCheckInput';
6
6
  import FormCheckLabel from './FormCheckLabel';
7
7
  import FormContext from './FormContext';
8
8
  import { useBootstrapPrefix } from './ThemeProvider';
9
+ import { hasChildOfType } from './ElementChildren';
9
10
  import { jsx as _jsx } from "react/jsx-runtime";
10
11
  import { Fragment as _Fragment } from "react/jsx-runtime";
11
12
  import { jsxs as _jsxs } from "react/jsx-runtime";
@@ -38,7 +39,7 @@ const FormCheck = /*#__PURE__*/React.forwardRef(({
38
39
  const innerFormContext = useMemo(() => ({
39
40
  controlId: id || controlId
40
41
  }), [controlId, id]);
41
- const hasLabel = label != null && label !== false && !children;
42
+ const hasLabel = !children && label != null && label !== false || hasChildOfType(children, FormCheckLabel);
42
43
 
43
44
  const input = /*#__PURE__*/_jsx(FormCheckInput, { ...props,
44
45
  type: type === 'switch' ? 'checkbox' : type,
@@ -53,7 +54,7 @@ const FormCheck = /*#__PURE__*/React.forwardRef(({
53
54
  value: innerFormContext,
54
55
  children: /*#__PURE__*/_jsx("div", {
55
56
  style: style,
56
- className: classNames(className, label && bsPrefix, inline && `${bsPrefix}-inline`, type === 'switch' && bsSwitchPrefix),
57
+ className: classNames(className, hasLabel && bsPrefix, inline && `${bsPrefix}-inline`, type === 'switch' && bsSwitchPrefix),
57
58
  children: children || /*#__PURE__*/_jsxs(_Fragment, {
58
59
  children: [input, hasLabel && /*#__PURE__*/_jsx(FormCheckLabel, {
59
60
  title: title,
package/esm/Modal.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as React from 'react';
2
- import { ModalProps as BaseModalProps } from '@restart/ui/Modal';
2
+ import { BaseModalProps } from '@restart/ui/Modal';
3
3
  import { BsPrefixRefForwardingComponent } from './helpers';
4
4
  export interface ModalProps extends Omit<BaseModalProps, 'role' | 'renderBackdrop' | 'renderDialog' | 'transition' | 'backdropTransition' | 'children'> {
5
5
  size?: 'sm' | 'lg' | 'xl';
@@ -2,7 +2,7 @@ import * as React from 'react';
2
2
  import { DropdownProps } from './Dropdown';
3
3
  import { DropdownMenuVariant } from './DropdownMenu';
4
4
  import { BsPrefixRefForwardingComponent } from './helpers';
5
- export interface NavDropdownProps extends Omit<DropdownProps, 'onSelect' | 'title'> {
5
+ export interface NavDropdownProps extends Omit<DropdownProps, 'title'> {
6
6
  title: React.ReactNode;
7
7
  disabled?: boolean;
8
8
  active?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-bootstrap",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "Bootstrap 5 components built with React",
5
5
  "keywords": [
6
6
  "react",
@@ -34,9 +34,8 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@babel/runtime": "^7.14.0",
37
- "@restart/context": "^2.1.4",
38
- "@restart/hooks": "^0.3.26",
39
- "@restart/ui": "^0.2.3",
37
+ "@restart/hooks": "^0.4.5",
38
+ "@restart/ui": "^0.2.5",
40
39
  "@types/invariant": "^2.2.33",
41
40
  "@types/prop-types": "^15.7.3",
42
41
  "@types/react": ">=16.14.8",
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { BsPrefixRefForwardingComponent } from './helpers';
3
- interface AbstractNavProps {
4
- activeKey?: any;
5
- as?: React.ElementType;
6
- getControlledId?: any;
7
- getControllerId?: any;
8
- onKeyDown?: any;
9
- onSelect?: any;
10
- parentOnSelect?: any;
11
- role?: string;
12
- }
13
- declare type AbstractNav = BsPrefixRefForwardingComponent<'ul', AbstractNavProps>;
14
- declare const AbstractNav: AbstractNav;
15
- export default AbstractNav;
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { BsPrefixRefForwardingComponent } from './helpers';
3
- import { EventKey } from './types';
4
- interface AbstractNavItemProps {
5
- active?: boolean;
6
- as: React.ElementType;
7
- className?: string;
8
- disabled?: boolean;
9
- eventKey?: EventKey;
10
- href?: string;
11
- role?: string;
12
- id?: string;
13
- tabIndex?: number;
14
- onClick?: (e: any) => void;
15
- onSelect?: (navKey: string, e: any) => void;
16
- }
17
- declare type AbstractNavItem = BsPrefixRefForwardingComponent<'div', AbstractNavItemProps>;
18
- declare const AbstractNavItem: AbstractNavItem;
19
- export default AbstractNavItem;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
3
- declare type EventHandler = React.EventHandler<React.SyntheticEvent>;
4
- export interface AccordionToggleProps extends BsPrefixPropsWithChildren {
5
- eventKey: string;
6
- onClick?: EventHandler;
7
- }
8
- declare type AccordionToggle = BsPrefixRefForwardingComponent<'div', AccordionToggleProps>;
9
- export declare function useAccordionToggle(eventKey: string, onClick?: EventHandler): EventHandler;
10
- declare const AccordionToggle: AccordionToggle;
11
- export default AccordionToggle;
@@ -1,2 +0,0 @@
1
- declare const _default: import("./helpers").BsPrefixRefForwardingComponent<"div", unknown>;
2
- export default _default;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- interface CardContextType {
3
- cardHeaderBsPrefix: string;
4
- }
5
- declare const context: React.Context<CardContextType | null>;
6
- export default context;
package/cjs/CardDeck.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const _default: import("./helpers").BsPrefixRefForwardingComponent<"div", unknown>;
2
- export default _default;
package/cjs/FormFile.d.ts DELETED
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import FormFileInput from './FormFileInput';
3
- import FormFileLabel from './FormFileLabel';
4
- import { BsCustomPrefixProps, BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
5
- export interface FormFileProps extends BsPrefixPropsWithChildren, BsCustomPrefixProps, Pick<React.HTMLAttributes<HTMLElement>, 'style'> {
6
- inputAs?: React.ElementType;
7
- id?: string;
8
- disabled?: boolean;
9
- label?: React.ReactNode;
10
- custom?: boolean;
11
- isValid?: boolean;
12
- isInvalid?: boolean;
13
- feedback?: React.ReactNode;
14
- feedbackTooltip?: boolean;
15
- lang?: string;
16
- 'data-browse'?: any;
17
- }
18
- declare type FormFile = BsPrefixRefForwardingComponent<'input', FormFileProps> & {
19
- Input: typeof FormFileInput;
20
- Label: typeof FormFileLabel;
21
- };
22
- declare const FormFile: FormFile;
23
- export default FormFile;
@@ -1,10 +0,0 @@
1
- import { BsCustomPrefixProps, BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
2
- export interface FormFileInputProps extends BsPrefixProps, BsCustomPrefixProps {
3
- id?: string;
4
- isValid?: boolean;
5
- isInvalid?: boolean;
6
- lang?: string;
7
- }
8
- declare type FormFileInput = BsPrefixRefForwardingComponent<'input', FormFileInputProps>;
9
- declare const FormFileInput: FormFileInput;
10
- export default FormFileInput;
@@ -1,7 +0,0 @@
1
- import { BsCustomPrefixProps, BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
2
- export interface FormFileLabelProps extends BsPrefixProps, BsCustomPrefixProps {
3
- htmlFor?: string;
4
- }
5
- declare type FormFileLabel = BsPrefixRefForwardingComponent<'label', FormFileLabelProps>;
6
- declare const FormFileLabel: FormFileLabel;
7
- export default FormFileLabel;
@@ -1,7 +0,0 @@
1
- import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
2
- export interface JumbotronProps extends BsPrefixProps {
3
- fluid?: boolean;
4
- }
5
- declare type Jumbotron = BsPrefixRefForwardingComponent<'div', JumbotronProps>;
6
- declare const Jumbotron: Jumbotron;
7
- export default Jumbotron;
package/cjs/Media.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
2
- declare const MediaBody: BsPrefixRefForwardingComponent<"div", unknown>;
3
- declare type MediaProps = BsPrefixProps;
4
- declare type Media = BsPrefixRefForwardingComponent<'div', MediaProps> & {
5
- Body: typeof MediaBody;
6
- };
7
- declare const Media: Media;
8
- export default Media;
@@ -1,5 +0,0 @@
1
- import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
2
- declare type PopoverContentProps = BsPrefixPropsWithChildren;
3
- declare type PopoverContent = BsPrefixRefForwardingComponent<'div', PopoverContentProps>;
4
- declare const PopoverContent: PopoverContent;
5
- export default PopoverContent;
@@ -1,5 +0,0 @@
1
- import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
2
- declare type PopoverTitleProps = BsPrefixPropsWithChildren;
3
- declare type PopoverTitle = BsPrefixRefForwardingComponent<'div', PopoverTitleProps>;
4
- declare const PopoverTitle: PopoverTitle;
5
- export default PopoverTitle;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
3
- export interface ResponsiveEmbedProps extends BsPrefixPropsWithChildren {
4
- children: React.ReactChild;
5
- aspectRatio?: '21by9' | '16by9' | '4by3' | '1by1';
6
- }
7
- declare type ResponsiveEmbed = BsPrefixRefForwardingComponent<'div', ResponsiveEmbedProps>;
8
- declare const ResponsiveEmbed: ResponsiveEmbed;
9
- export default ResponsiveEmbed;
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
3
- export interface SafeAnchorProps extends React.HTMLAttributes<HTMLElement>, BsPrefixProps {
4
- href?: string;
5
- disabled?: boolean;
6
- tabIndex?: number;
7
- }
8
- declare type SafeAnchor = BsPrefixRefForwardingComponent<'a', SafeAnchorProps>;
9
- /**
10
- * There are situations due to browser quirks or Bootstrap CSS where
11
- * an anchor tag is needed, when semantically a button tag is the
12
- * better choice. SafeAnchor ensures that when an anchor is used like a
13
- * button its accessible. It also emulates input `disabled` behavior for
14
- * links, which is usually desirable for Buttons, NavItems, DropdownItems, etc.
15
- */
16
- declare const SafeAnchor: SafeAnchor;
17
- export default SafeAnchor;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- declare type SelectableContextType = (key: string | null, event: any) => void;
3
- declare const SelectableContext: React.Context<SelectableContextType | null>;
4
- export declare const makeEventKey: (eventKey?: string | number | null | undefined, href?: string | null) => string | null;
5
- export default SelectableContext;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- export interface TabContextType {
3
- onSelect: any;
4
- activeKey: any;
5
- transition: any;
6
- mountOnEnter: boolean;
7
- unmountOnExit: boolean;
8
- getControlledId: (key: any) => any;
9
- getControllerId: (key: any) => any;
10
- }
11
- declare const TabContext: React.Context<TabContextType | null>;
12
- export default TabContext;
@@ -1,4 +0,0 @@
1
- export default function usePopperMarginModifiers(): [
2
- (overlay: HTMLDivElement) => void,
3
- Array<Record<string, unknown>>
4
- ];
@@ -1,15 +0,0 @@
1
- import React from 'react';
2
- import { BsPrefixRefForwardingComponent } from './helpers';
3
- interface AbstractNavProps {
4
- activeKey?: any;
5
- as?: React.ElementType;
6
- getControlledId?: any;
7
- getControllerId?: any;
8
- onKeyDown?: any;
9
- onSelect?: any;
10
- parentOnSelect?: any;
11
- role?: string;
12
- }
13
- declare type AbstractNav = BsPrefixRefForwardingComponent<'ul', AbstractNavProps>;
14
- declare const AbstractNav: AbstractNav;
15
- export default AbstractNav;
@@ -1,19 +0,0 @@
1
- import React from 'react';
2
- import { BsPrefixRefForwardingComponent } from './helpers';
3
- import { EventKey } from './types';
4
- interface AbstractNavItemProps {
5
- active?: boolean;
6
- as: React.ElementType;
7
- className?: string;
8
- disabled?: boolean;
9
- eventKey?: EventKey;
10
- href?: string;
11
- role?: string;
12
- id?: string;
13
- tabIndex?: number;
14
- onClick?: (e: any) => void;
15
- onSelect?: (navKey: string, e: any) => void;
16
- }
17
- declare type AbstractNavItem = BsPrefixRefForwardingComponent<'div', AbstractNavItemProps>;
18
- declare const AbstractNavItem: AbstractNavItem;
19
- export default AbstractNavItem;
@@ -1,11 +0,0 @@
1
- import React from 'react';
2
- import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
3
- declare type EventHandler = React.EventHandler<React.SyntheticEvent>;
4
- export interface AccordionToggleProps extends BsPrefixPropsWithChildren {
5
- eventKey: string;
6
- onClick?: EventHandler;
7
- }
8
- declare type AccordionToggle = BsPrefixRefForwardingComponent<'div', AccordionToggleProps>;
9
- export declare function useAccordionToggle(eventKey: string, onClick?: EventHandler): EventHandler;
10
- declare const AccordionToggle: AccordionToggle;
11
- export default AccordionToggle;
@@ -1,2 +0,0 @@
1
- declare const _default: import("./helpers").BsPrefixRefForwardingComponent<"div", unknown>;
2
- export default _default;
@@ -1,6 +0,0 @@
1
- import React from 'react';
2
- interface CardContextType {
3
- cardHeaderBsPrefix: string;
4
- }
5
- declare const context: React.Context<CardContextType | null>;
6
- export default context;
package/esm/CardDeck.d.ts DELETED
@@ -1,2 +0,0 @@
1
- declare const _default: import("./helpers").BsPrefixRefForwardingComponent<"div", unknown>;
2
- export default _default;
package/esm/FormFile.d.ts DELETED
@@ -1,23 +0,0 @@
1
- import React from 'react';
2
- import FormFileInput from './FormFileInput';
3
- import FormFileLabel from './FormFileLabel';
4
- import { BsCustomPrefixProps, BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
5
- export interface FormFileProps extends BsPrefixPropsWithChildren, BsCustomPrefixProps, Pick<React.HTMLAttributes<HTMLElement>, 'style'> {
6
- inputAs?: React.ElementType;
7
- id?: string;
8
- disabled?: boolean;
9
- label?: React.ReactNode;
10
- custom?: boolean;
11
- isValid?: boolean;
12
- isInvalid?: boolean;
13
- feedback?: React.ReactNode;
14
- feedbackTooltip?: boolean;
15
- lang?: string;
16
- 'data-browse'?: any;
17
- }
18
- declare type FormFile = BsPrefixRefForwardingComponent<'input', FormFileProps> & {
19
- Input: typeof FormFileInput;
20
- Label: typeof FormFileLabel;
21
- };
22
- declare const FormFile: FormFile;
23
- export default FormFile;
@@ -1,10 +0,0 @@
1
- import { BsCustomPrefixProps, BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
2
- export interface FormFileInputProps extends BsPrefixProps, BsCustomPrefixProps {
3
- id?: string;
4
- isValid?: boolean;
5
- isInvalid?: boolean;
6
- lang?: string;
7
- }
8
- declare type FormFileInput = BsPrefixRefForwardingComponent<'input', FormFileInputProps>;
9
- declare const FormFileInput: FormFileInput;
10
- export default FormFileInput;
@@ -1,7 +0,0 @@
1
- import { BsCustomPrefixProps, BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
2
- export interface FormFileLabelProps extends BsPrefixProps, BsCustomPrefixProps {
3
- htmlFor?: string;
4
- }
5
- declare type FormFileLabel = BsPrefixRefForwardingComponent<'label', FormFileLabelProps>;
6
- declare const FormFileLabel: FormFileLabel;
7
- export default FormFileLabel;
@@ -1,7 +0,0 @@
1
- import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
2
- export interface JumbotronProps extends BsPrefixProps {
3
- fluid?: boolean;
4
- }
5
- declare type Jumbotron = BsPrefixRefForwardingComponent<'div', JumbotronProps>;
6
- declare const Jumbotron: Jumbotron;
7
- export default Jumbotron;
package/esm/Media.d.ts DELETED
@@ -1,8 +0,0 @@
1
- import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
2
- declare const MediaBody: BsPrefixRefForwardingComponent<"div", unknown>;
3
- declare type MediaProps = BsPrefixProps;
4
- declare type Media = BsPrefixRefForwardingComponent<'div', MediaProps> & {
5
- Body: typeof MediaBody;
6
- };
7
- declare const Media: Media;
8
- export default Media;
@@ -1,5 +0,0 @@
1
- import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
2
- declare type PopoverContentProps = BsPrefixPropsWithChildren;
3
- declare type PopoverContent = BsPrefixRefForwardingComponent<'div', PopoverContentProps>;
4
- declare const PopoverContent: PopoverContent;
5
- export default PopoverContent;
@@ -1,5 +0,0 @@
1
- import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
2
- declare type PopoverTitleProps = BsPrefixPropsWithChildren;
3
- declare type PopoverTitle = BsPrefixRefForwardingComponent<'div', PopoverTitleProps>;
4
- declare const PopoverTitle: PopoverTitle;
5
- export default PopoverTitle;
@@ -1,9 +0,0 @@
1
- import React from 'react';
2
- import { BsPrefixPropsWithChildren, BsPrefixRefForwardingComponent } from './helpers';
3
- export interface ResponsiveEmbedProps extends BsPrefixPropsWithChildren {
4
- children: React.ReactChild;
5
- aspectRatio?: '21by9' | '16by9' | '4by3' | '1by1';
6
- }
7
- declare type ResponsiveEmbed = BsPrefixRefForwardingComponent<'div', ResponsiveEmbedProps>;
8
- declare const ResponsiveEmbed: ResponsiveEmbed;
9
- export default ResponsiveEmbed;
@@ -1,17 +0,0 @@
1
- import React from 'react';
2
- import { BsPrefixProps, BsPrefixRefForwardingComponent } from './helpers';
3
- export interface SafeAnchorProps extends React.HTMLAttributes<HTMLElement>, BsPrefixProps {
4
- href?: string;
5
- disabled?: boolean;
6
- tabIndex?: number;
7
- }
8
- declare type SafeAnchor = BsPrefixRefForwardingComponent<'a', SafeAnchorProps>;
9
- /**
10
- * There are situations due to browser quirks or Bootstrap CSS where
11
- * an anchor tag is needed, when semantically a button tag is the
12
- * better choice. SafeAnchor ensures that when an anchor is used like a
13
- * button its accessible. It also emulates input `disabled` behavior for
14
- * links, which is usually desirable for Buttons, NavItems, DropdownItems, etc.
15
- */
16
- declare const SafeAnchor: SafeAnchor;
17
- export default SafeAnchor;
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- declare type SelectableContextType = (key: string | null, event: any) => void;
3
- declare const SelectableContext: React.Context<SelectableContextType | null>;
4
- export declare const makeEventKey: (eventKey?: string | number | null | undefined, href?: string | null) => string | null;
5
- export default SelectableContext;
@@ -1,12 +0,0 @@
1
- import React from 'react';
2
- export interface TabContextType {
3
- onSelect: any;
4
- activeKey: any;
5
- transition: any;
6
- mountOnEnter: boolean;
7
- unmountOnExit: boolean;
8
- getControlledId: (key: any) => any;
9
- getControllerId: (key: any) => any;
10
- }
11
- declare const TabContext: React.Context<TabContextType | null>;
12
- export default TabContext;
@@ -1,4 +0,0 @@
1
- export default function usePopperMarginModifiers(): [
2
- (overlay: HTMLDivElement) => void,
3
- Array<Record<string, unknown>>
4
- ];