@coreui/react 4.4.0 → 4.4.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.
Files changed (37) hide show
  1. package/README.md +1 -1
  2. package/dist/components/Types.d.ts +6 -6
  3. package/dist/components/button/CButton.d.ts +4 -3
  4. package/dist/components/dropdown/CDropdown.d.ts +3 -3
  5. package/dist/components/dropdown/CDropdownItem.d.ts +1 -1
  6. package/dist/components/form/CFormCheck.d.ts +1 -1
  7. package/dist/components/form/CFormLabel.d.ts +2 -2
  8. package/dist/components/form/CFormRange.d.ts +1 -1
  9. package/dist/components/form/CFormSelect.d.ts +1 -1
  10. package/dist/components/form/CInputGroupText.d.ts +2 -2
  11. package/dist/components/form/index.d.ts +3 -1
  12. package/dist/components/grid/CCol.d.ts +3 -3
  13. package/dist/components/grid/CRow.d.ts +1 -1
  14. package/dist/components/header/CHeaderBrand.d.ts +2 -2
  15. package/dist/components/link/CLink.d.ts +2 -2
  16. package/dist/components/list-group/CListGroupItem.d.ts +3 -3
  17. package/dist/components/nav/CNavLink.d.ts +1 -1
  18. package/dist/components/toast/CToastClose.d.ts +4 -1
  19. package/dist/components/widgets/CWidgetStatsD.d.ts +1 -1
  20. package/dist/index.es.js +1 -6
  21. package/dist/index.es.js.map +1 -1
  22. package/dist/index.js +300 -310
  23. package/dist/index.js.map +1 -1
  24. package/dist/utils/hooks/useForkedRef.d.ts +1 -1
  25. package/package.json +9 -10
  26. package/src/components/button/CButton.tsx +3 -3
  27. package/src/components/form/CFormLabel.tsx +2 -2
  28. package/src/components/form/CFormRange.tsx +1 -1
  29. package/src/components/form/CInputGroupText.tsx +3 -2
  30. package/src/components/form/__tests__/CFormRange.spec.tsx +2 -2
  31. package/src/components/form/__tests__/CInputGroupText.spec.tsx +9 -0
  32. package/src/components/form/__tests__/__snapshots__/CInputGroupText.spec.tsx.snap +11 -0
  33. package/src/components/form/index.ts +4 -0
  34. package/src/components/header/CHeaderBrand.tsx +3 -2
  35. package/src/components/link/CLink.tsx +2 -2
  36. package/src/components/list-group/CListGroupItem.tsx +2 -2
  37. package/src/components/toast/CToastClose.tsx +4 -1
package/README.md CHANGED
@@ -46,7 +46,7 @@
46
46
 
47
47
  Several quick start options are available:
48
48
 
49
- - [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.4.0.zip)
49
+ - [Download the latest release](https://github.com/coreui/coreui-react/archive/v4.4.1.zip)
50
50
  - Clone the repo: `git clone https://github.com/coreui/coreui-react.git`
51
51
  - Install with [npm](https://www.npmjs.com/): `npm install @coreui/react`
52
52
  - Install with [yarn](https://yarnpkg.com/): `yarn add @coreui/react`
@@ -1,12 +1,12 @@
1
1
  import PropTypes from 'prop-types';
2
- export declare type Breakpoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
3
- export declare type Colors = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string;
2
+ export type Breakpoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl';
3
+ export type Colors = 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string;
4
4
  export declare const colorPropType: PropTypes.Requireable<string>;
5
- export declare type Placements = 'auto' | 'auto-start' | 'auto-end' | 'top-end' | 'top' | 'top-start' | 'bottom-end' | 'bottom' | 'bottom-start' | 'right-start' | 'right' | 'right-end' | 'left-start' | 'left' | 'left-end' | undefined;
5
+ export type Placements = 'auto' | 'auto-start' | 'auto-end' | 'top-end' | 'top' | 'top-start' | 'bottom-end' | 'bottom' | 'bottom-start' | 'right-start' | 'right' | 'right-end' | 'left-start' | 'left' | 'left-end' | undefined;
6
6
  export declare const placementPropType: PropTypes.Requireable<Placements>;
7
- export declare type Shapes = 'rounded' | 'rounded-top' | 'rounded-end' | 'rounded-bottom' | 'rounded-start' | 'rounded-circle' | 'rounded-pill' | 'rounded-0' | 'rounded-1' | 'rounded-2' | 'rounded-3' | string;
7
+ export type Shapes = 'rounded' | 'rounded-top' | 'rounded-end' | 'rounded-bottom' | 'rounded-start' | 'rounded-circle' | 'rounded-pill' | 'rounded-0' | 'rounded-1' | 'rounded-2' | 'rounded-3' | string;
8
8
  export declare const shapePropType: PropTypes.Requireable<string>;
9
- export declare type TextColors = Colors | 'white' | 'muted' | 'high-emphasis' | 'medium-emphasis' | 'disabled' | 'high-emphasis-inverse' | 'medium-emphasis-inverse' | 'disabled-inverse' | string;
9
+ export type TextColors = Colors | 'white' | 'muted' | 'high-emphasis' | 'medium-emphasis' | 'disabled' | 'high-emphasis-inverse' | 'medium-emphasis-inverse' | 'disabled-inverse' | string;
10
10
  export declare const textColorsPropType: PropTypes.Requireable<string>;
11
- export declare type Triggers = 'hover' | 'focus' | 'click';
11
+ export type Triggers = 'hover' | 'focus' | 'click';
12
12
  export declare const triggerPropType: PropTypes.Requireable<Triggers>;
@@ -1,6 +1,7 @@
1
- import React, { ButtonHTMLAttributes, ElementType } from 'react';
1
+ import React, { ElementType } from 'react';
2
2
  import { Colors, Shapes } from '../Types';
3
- export interface CButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
3
+ import { CLinkProps } from '../link/CLink';
4
+ export interface CButtonProps extends Omit<CLinkProps, 'size'> {
4
5
  /**
5
6
  * Toggle the active state for the component.
6
7
  */
@@ -51,4 +52,4 @@ export interface CButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
51
52
  */
52
53
  variant?: 'outline' | 'ghost';
53
54
  }
54
- export declare const CButton: React.ForwardRefExoticComponent<CButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
55
+ export declare const CButton: React.ForwardRefExoticComponent<CButtonProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
@@ -1,7 +1,7 @@
1
1
  import React, { ElementType, HTMLAttributes, RefObject } from 'react';
2
2
  import { Placements } from '../Types';
3
- export declare type Directions = 'start' | 'end';
4
- export declare type Breakpoints = {
3
+ export type Directions = 'start' | 'end';
4
+ export type Breakpoints = {
5
5
  xs: Directions;
6
6
  } | {
7
7
  sm: Directions;
@@ -14,7 +14,7 @@ export declare type Breakpoints = {
14
14
  } | {
15
15
  xxl: Directions;
16
16
  };
17
- export declare type Alignments = Directions | Breakpoints;
17
+ export type Alignments = Directions | Breakpoints;
18
18
  export interface CDropdownProps extends HTMLAttributes<HTMLDivElement | HTMLLIElement> {
19
19
  /**
20
20
  * Set aligment of dropdown menu.
@@ -10,4 +10,4 @@ export interface CDropdownItemProps extends CLinkProps {
10
10
  */
11
11
  component?: string | ElementType;
12
12
  }
13
- export declare const CDropdownItem: React.ForwardRefExoticComponent<CDropdownItemProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
13
+ export declare const CDropdownItem: React.ForwardRefExoticComponent<CDropdownItemProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
@@ -1,7 +1,7 @@
1
1
  import React, { InputHTMLAttributes, ReactNode } from 'react';
2
2
  import { Colors, Shapes } from '../Types';
3
3
  import { CFormControlValidationProps } from './CFormControlValidation';
4
- export declare type ButtonObject = {
4
+ export type ButtonObject = {
5
5
  /**
6
6
  * Sets the color context of the component to one of CoreUI’s themed colors.
7
7
  *
@@ -1,5 +1,5 @@
1
- import React, { AllHTMLAttributes } from 'react';
2
- export interface CFormLabelProps extends AllHTMLAttributes<HTMLLabelElement> {
1
+ import React, { LabelHTMLAttributes } from 'react';
2
+ export interface CFormLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
3
3
  /**
4
4
  * A string of all className you want applied to the component.
5
5
  */
@@ -33,7 +33,7 @@ export interface CFormRangeProps extends InputHTMLAttributes<HTMLInputElement> {
33
33
  /**
34
34
  * Specifies the interval between legal numbers in the component.
35
35
  */
36
- steps: number;
36
+ step?: number;
37
37
  /**
38
38
  * The `value` attribute of component.
39
39
  *
@@ -1,6 +1,6 @@
1
1
  import React, { ChangeEventHandler, InputHTMLAttributes } from 'react';
2
2
  import { CFormControlWrapperProps } from './CFormControlWrapper';
3
- declare type Option = {
3
+ type Option = {
4
4
  disabled?: boolean;
5
5
  label?: string;
6
6
  value?: string;
@@ -1,5 +1,5 @@
1
- import React, { ElementType, HTMLAttributes } from 'react';
2
- export interface CInputGroupTextProps extends HTMLAttributes<HTMLLabelElement | HTMLSpanElement> {
1
+ import React, { ElementType, LabelHTMLAttributes } from 'react';
2
+ export interface CInputGroupTextProps extends LabelHTMLAttributes<HTMLLabelElement | HTMLSpanElement> {
3
3
  /**
4
4
  * A string of all className you want applied to the component.
5
5
  */
@@ -1,5 +1,7 @@
1
1
  import { CForm } from './CForm';
2
2
  import { CFormCheck } from './CFormCheck';
3
+ import { CFormControlValidation } from './CFormControlValidation';
4
+ import { CFormControlWrapper } from './CFormControlWrapper';
3
5
  import { CFormFeedback } from './CFormFeedback';
4
6
  import { CFormFloating } from './CFormFloating';
5
7
  import { CFormInput } from './CFormInput';
@@ -11,4 +13,4 @@ import { CFormText } from './CFormText';
11
13
  import { CFormTextarea } from './CFormTextarea';
12
14
  import { CInputGroup } from './CInputGroup';
13
15
  import { CInputGroupText } from './CInputGroupText';
14
- export { CForm, CFormCheck, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CInputGroup, CInputGroupText, };
16
+ export { CForm, CFormCheck, CFormControlValidation, CFormControlWrapper, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CInputGroup, CInputGroupText, };
@@ -1,11 +1,11 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- declare type Span = 'auto' | number | string | boolean | null;
3
- declare type BPObject = {
2
+ type Span = 'auto' | number | string | boolean | null;
3
+ type BPObject = {
4
4
  span?: Span;
5
5
  offset?: number | string | null;
6
6
  order?: 'first' | 'last' | number | string | null;
7
7
  };
8
- declare type Col = Span | BPObject;
8
+ type Col = Span | BPObject;
9
9
  export interface CColProps extends HTMLAttributes<HTMLDivElement> {
10
10
  /**
11
11
  * A string of all className you want applied to the base component.
@@ -1,5 +1,5 @@
1
1
  import React, { HTMLAttributes } from 'react';
2
- export declare type BPObject = {
2
+ export type BPObject = {
3
3
  cols?: 'auto' | number | string | null;
4
4
  gutter?: number | string | null;
5
5
  gutterX?: number | string | null;
@@ -1,5 +1,5 @@
1
- import React, { ElementType, HTMLAttributes } from 'react';
2
- export interface CHeaderBrandProps extends HTMLAttributes<HTMLAnchorElement | HTMLSpanElement> {
1
+ import React, { ElementType, AnchorHTMLAttributes } from 'react';
2
+ export interface CHeaderBrandProps extends AnchorHTMLAttributes<HTMLAnchorElement | HTMLSpanElement> {
3
3
  /**
4
4
  * A string of all className you want applied to the component.
5
5
  */
@@ -1,5 +1,5 @@
1
1
  import React, { AllHTMLAttributes, ElementType } from 'react';
2
- export interface CLinkProps extends AllHTMLAttributes<HTMLElement> {
2
+ export interface CLinkProps extends AllHTMLAttributes<HTMLButtonElement | HTMLAnchorElement> {
3
3
  /**
4
4
  * Toggle the active state for the component.
5
5
  */
@@ -21,4 +21,4 @@ export interface CLinkProps extends AllHTMLAttributes<HTMLElement> {
21
21
  */
22
22
  href?: string;
23
23
  }
24
- export declare const CLink: React.ForwardRefExoticComponent<CLinkProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
24
+ export declare const CLink: React.ForwardRefExoticComponent<CLinkProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
@@ -1,6 +1,6 @@
1
- import React, { ElementType, HTMLAttributes } from 'react';
1
+ import React, { ElementType, AnchorHTMLAttributes } from 'react';
2
2
  import { Colors } from '../Types';
3
- export interface CListGroupItemProps extends HTMLAttributes<HTMLLIElement | HTMLAnchorElement | HTMLButtonElement> {
3
+ export interface CListGroupItemProps extends AnchorHTMLAttributes<HTMLLIElement | HTMLAnchorElement | HTMLButtonElement> {
4
4
  /**
5
5
  * Toggle the active state for the component.
6
6
  */
@@ -24,4 +24,4 @@ export interface CListGroupItemProps extends HTMLAttributes<HTMLLIElement | HTML
24
24
  */
25
25
  component?: string | ElementType;
26
26
  }
27
- export declare const CListGroupItem: React.ForwardRefExoticComponent<CListGroupItemProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement | HTMLLIElement>>;
27
+ export declare const CListGroupItem: React.ForwardRefExoticComponent<CListGroupItemProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement | HTMLLIElement>>;
@@ -26,4 +26,4 @@ export interface CNavLinkProps extends Omit<CLinkProps, 'idx'> {
26
26
  */
27
27
  to?: string;
28
28
  }
29
- export declare const CNavLink: React.ForwardRefExoticComponent<CNavLinkProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement | HTMLLIElement>>;
29
+ export declare const CNavLink: React.ForwardRefExoticComponent<CNavLinkProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement | HTMLLIElement>>;
@@ -1,9 +1,12 @@
1
1
  import React, { ElementType } from 'react';
2
2
  import { CCloseButtonProps } from '../close-button/CCloseButton';
3
- export interface CToastCloseProps extends CCloseButtonProps {
3
+ import type { CButtonProps } from '../button/CButton';
4
+ type CombineButtonProps = CCloseButtonProps & CButtonProps;
5
+ export interface CToastCloseProps extends CombineButtonProps {
4
6
  /**
5
7
  * Component used for the root node. Either a string to use a HTML element or a component.
6
8
  */
7
9
  component?: string | ElementType;
8
10
  }
9
11
  export declare const CToastClose: React.ForwardRefExoticComponent<CToastCloseProps & React.RefAttributes<HTMLButtonElement>>;
12
+ export {};
@@ -1,6 +1,6 @@
1
1
  import React, { HTMLAttributes, ReactNode } from 'react';
2
2
  import { Colors } from '../Types';
3
- declare type Value = {
3
+ type Value = {
4
4
  title?: string | ReactNode;
5
5
  value?: number | string | ReactNode;
6
6
  };
package/dist/index.es.js CHANGED
@@ -1338,14 +1338,12 @@ function _extends() {
1338
1338
  _extends = Object.assign ? Object.assign.bind() : function (target) {
1339
1339
  for (var i = 1; i < arguments.length; i++) {
1340
1340
  var source = arguments[i];
1341
-
1342
1341
  for (var key in source) {
1343
1342
  if (Object.prototype.hasOwnProperty.call(source, key)) {
1344
1343
  target[key] = source[key];
1345
1344
  }
1346
1345
  }
1347
1346
  }
1348
-
1349
1347
  return target;
1350
1348
  };
1351
1349
  return _extends.apply(this, arguments);
@@ -1356,13 +1354,11 @@ function _objectWithoutPropertiesLoose(source, excluded) {
1356
1354
  var target = {};
1357
1355
  var sourceKeys = Object.keys(source);
1358
1356
  var key, i;
1359
-
1360
1357
  for (i = 0; i < sourceKeys.length; i++) {
1361
1358
  key = sourceKeys[i];
1362
1359
  if (excluded.indexOf(key) >= 0) continue;
1363
1360
  target[key] = source[key];
1364
1361
  }
1365
-
1366
1362
  return target;
1367
1363
  }
1368
1364
 
@@ -2472,7 +2468,6 @@ function _assertThisInitialized(self) {
2472
2468
  if (self === void 0) {
2473
2469
  throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2474
2470
  }
2475
-
2476
2471
  return self;
2477
2472
  }
2478
2473
 
@@ -8767,5 +8762,5 @@ CWidgetStatsF.propTypes = {
8767
8762
  };
8768
8763
  CWidgetStatsF.displayName = 'CWidgetStatsF';
8769
8764
 
8770
- export { CAccordion, CAccordionBody, CAccordionButton, CAccordionCollapse, CAccordionHeader, CAccordionItem, CAlert, CAlertHeading, CAlertLink, CAvatar, CBackdrop, CBadge, CBreadcrumb, CBreadcrumbItem, CButton, CButtonGroup, CButtonToolbar, CCallout, CCard, CCardBody, CCardFooter, CCardGroup, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCloseButton, CCol, CCollapse, CContainer, CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownItemPlain, CDropdownMenu, CDropdownToggle, CFooter, CForm, CFormCheck, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderText, CHeaderToggler, CImage, CInputGroup, CInputGroupText, CLink, CListGroup, CListGroupItem, CModal, CModalBody, CModalContent, CModalDialog, CModalFooter, CModalHeader, CModalTitle, CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavTitle, CNavbar, CNavbarBrand, CNavbarNav, CNavbarText, CNavbarToggler, COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasTitle, CPagination, CPaginationItem, CPlaceholder, CPopover, CProgress, CProgressBar, CRow, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarHeader, CSidebarNav, CSidebarToggler, CSpinner, CTabContent, CTabPane, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTableRow, CToast, CToastBody, CToastClose, CToastHeader, CToaster, CTooltip, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF };
8765
+ export { CAccordion, CAccordionBody, CAccordionButton, CAccordionCollapse, CAccordionHeader, CAccordionItem, CAlert, CAlertHeading, CAlertLink, CAvatar, CBackdrop, CBadge, CBreadcrumb, CBreadcrumbItem, CButton, CButtonGroup, CButtonToolbar, CCallout, CCard, CCardBody, CCardFooter, CCardGroup, CCardHeader, CCardImage, CCardImageOverlay, CCardLink, CCardSubtitle, CCardText, CCardTitle, CCarousel, CCarouselCaption, CCarouselItem, CCloseButton, CCol, CCollapse, CContainer, CDropdown, CDropdownDivider, CDropdownHeader, CDropdownItem, CDropdownItemPlain, CDropdownMenu, CDropdownToggle, CFooter, CForm, CFormCheck, CFormControlValidation, CFormControlWrapper, CFormFeedback, CFormFloating, CFormInput, CFormLabel, CFormRange, CFormSelect, CFormSwitch, CFormText, CFormTextarea, CHeader, CHeaderBrand, CHeaderDivider, CHeaderNav, CHeaderText, CHeaderToggler, CImage, CInputGroup, CInputGroupText, CLink, CListGroup, CListGroupItem, CModal, CModalBody, CModalContent, CModalDialog, CModalFooter, CModalHeader, CModalTitle, CNav, CNavGroup, CNavGroupItems, CNavItem, CNavLink, CNavTitle, CNavbar, CNavbarBrand, CNavbarNav, CNavbarText, CNavbarToggler, COffcanvas, COffcanvasBody, COffcanvasHeader, COffcanvasTitle, CPagination, CPaginationItem, CPlaceholder, CPopover, CProgress, CProgressBar, CRow, CSidebar, CSidebarBrand, CSidebarFooter, CSidebarHeader, CSidebarNav, CSidebarToggler, CSpinner, CTabContent, CTabPane, CTable, CTableBody, CTableCaption, CTableDataCell, CTableFoot, CTableHead, CTableHeaderCell, CTableRow, CToast, CToastBody, CToastClose, CToastHeader, CToaster, CTooltip, CWidgetStatsA, CWidgetStatsB, CWidgetStatsC, CWidgetStatsD, CWidgetStatsE, CWidgetStatsF };
8771
8766
  //# sourceMappingURL=index.es.js.map