@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.
- package/README.md +1 -1
- package/dist/components/Types.d.ts +6 -6
- package/dist/components/button/CButton.d.ts +4 -3
- package/dist/components/dropdown/CDropdown.d.ts +3 -3
- package/dist/components/dropdown/CDropdownItem.d.ts +1 -1
- package/dist/components/form/CFormCheck.d.ts +1 -1
- package/dist/components/form/CFormLabel.d.ts +2 -2
- package/dist/components/form/CFormRange.d.ts +1 -1
- package/dist/components/form/CFormSelect.d.ts +1 -1
- package/dist/components/form/CInputGroupText.d.ts +2 -2
- package/dist/components/form/index.d.ts +3 -1
- package/dist/components/grid/CCol.d.ts +3 -3
- package/dist/components/grid/CRow.d.ts +1 -1
- package/dist/components/header/CHeaderBrand.d.ts +2 -2
- package/dist/components/link/CLink.d.ts +2 -2
- package/dist/components/list-group/CListGroupItem.d.ts +3 -3
- package/dist/components/nav/CNavLink.d.ts +1 -1
- package/dist/components/toast/CToastClose.d.ts +4 -1
- package/dist/components/widgets/CWidgetStatsD.d.ts +1 -1
- package/dist/index.es.js +1 -6
- package/dist/index.es.js.map +1 -1
- package/dist/index.js +300 -310
- package/dist/index.js.map +1 -1
- package/dist/utils/hooks/useForkedRef.d.ts +1 -1
- package/package.json +9 -10
- package/src/components/button/CButton.tsx +3 -3
- package/src/components/form/CFormLabel.tsx +2 -2
- package/src/components/form/CFormRange.tsx +1 -1
- package/src/components/form/CInputGroupText.tsx +3 -2
- package/src/components/form/__tests__/CFormRange.spec.tsx +2 -2
- package/src/components/form/__tests__/CInputGroupText.spec.tsx +9 -0
- package/src/components/form/__tests__/__snapshots__/CInputGroupText.spec.tsx.snap +11 -0
- package/src/components/form/index.ts +4 -0
- package/src/components/header/CHeaderBrand.tsx +3 -2
- package/src/components/link/CLink.tsx +2 -2
- package/src/components/list-group/CListGroupItem.tsx +2 -2
- 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.
|
|
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
|
|
3
|
-
export
|
|
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
|
|
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
|
|
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
|
|
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
|
|
11
|
+
export type Triggers = 'hover' | 'focus' | 'click';
|
|
12
12
|
export declare const triggerPropType: PropTypes.Requireable<Triggers>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ElementType } from 'react';
|
|
2
2
|
import { Colors, Shapes } from '../Types';
|
|
3
|
-
|
|
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<
|
|
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
|
|
4
|
-
export
|
|
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
|
|
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<
|
|
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
|
|
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, {
|
|
2
|
-
export interface CFormLabelProps extends
|
|
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
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React, { ElementType,
|
|
2
|
-
export interface CInputGroupTextProps extends
|
|
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
|
-
|
|
3
|
-
|
|
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
|
-
|
|
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
|
-
import React, { ElementType,
|
|
2
|
-
export interface CHeaderBrandProps extends
|
|
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<
|
|
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<
|
|
24
|
+
export declare const CLink: React.ForwardRefExoticComponent<CLinkProps & React.RefAttributes<HTMLButtonElement | HTMLAnchorElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import React, { ElementType,
|
|
1
|
+
import React, { ElementType, AnchorHTMLAttributes } from 'react';
|
|
2
2
|
import { Colors } from '../Types';
|
|
3
|
-
export interface CListGroupItemProps extends
|
|
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<
|
|
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<
|
|
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
|
-
|
|
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 {};
|
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
|