@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export
|
|
2
|
+
export type AssignableRef<ValueType> = {
|
|
3
3
|
bivarianceHack(instance: ValueType | null): void;
|
|
4
4
|
}['bivarianceHack'] | React.MutableRefObject<ValueType | null>;
|
|
5
5
|
export declare function useForkedRef<RefValueType = any>(...refs: (AssignableRef<RefValueType> | null | undefined)[]): ((node: any) => void) | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coreui/react",
|
|
3
|
-
"version": "4.4.
|
|
3
|
+
"version": "4.4.1",
|
|
4
4
|
"description": "UI Components Library for React.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
"src/"
|
|
33
33
|
],
|
|
34
34
|
"scripts": {
|
|
35
|
-
"build": "rollup -c"
|
|
35
|
+
"build": "rollup -c --bundleConfigAsCjs"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@popperjs/core": "^2.11.5",
|
|
39
|
-
"@rollup/plugin-commonjs": "^
|
|
40
|
-
"@rollup/plugin-node-resolve": "^
|
|
41
|
-
"@rollup/plugin-typescript": "^
|
|
39
|
+
"@rollup/plugin-commonjs": "^23.0.4",
|
|
40
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
41
|
+
"@rollup/plugin-typescript": "^10.0.1",
|
|
42
42
|
"@testing-library/jest-dom": "^5.16.5",
|
|
43
43
|
"@testing-library/react": "^13.4.0",
|
|
44
|
-
"@types/react": "18.0.
|
|
44
|
+
"@types/react": "18.0.26",
|
|
45
45
|
"@types/react-dom": "^18.0.6",
|
|
46
46
|
"@types/react-transition-group": "^4.4.5",
|
|
47
47
|
"classnames": "^2.3.2",
|
|
@@ -50,10 +50,9 @@
|
|
|
50
50
|
"react-dom": "^18.2.0",
|
|
51
51
|
"react-popper": "^2.2.5",
|
|
52
52
|
"react-transition-group": "^4.4.5",
|
|
53
|
-
"rollup": "^
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"typescript": "^4.8.3"
|
|
53
|
+
"rollup": "^3.7.2",
|
|
54
|
+
"tslib": "^2.4.1",
|
|
55
|
+
"typescript": "^4.9.4"
|
|
57
56
|
},
|
|
58
57
|
"peerDependencies": {
|
|
59
58
|
"react": ">=17",
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React, {
|
|
1
|
+
import React, { ElementType, forwardRef } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import classNames from 'classnames'
|
|
4
4
|
|
|
5
5
|
import { Colors, Shapes, colorPropType } from '../Types'
|
|
6
|
-
import { CLink } from '../link/CLink'
|
|
6
|
+
import { CLink, CLinkProps } from '../link/CLink'
|
|
7
7
|
|
|
8
|
-
export interface CButtonProps extends
|
|
8
|
+
export interface CButtonProps extends Omit<CLinkProps, 'size'> {
|
|
9
9
|
/**
|
|
10
10
|
* Toggle the active state for the component.
|
|
11
11
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import React, { forwardRef,
|
|
1
|
+
import React, { forwardRef, LabelHTMLAttributes } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import classNames from 'classnames'
|
|
4
4
|
|
|
5
|
-
export interface CFormLabelProps extends
|
|
5
|
+
export interface CFormLabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
6
6
|
/**
|
|
7
7
|
* A string of all className you want applied to the component.
|
|
8
8
|
*/
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React, { ElementType, forwardRef,
|
|
1
|
+
import React, { ElementType, forwardRef, LabelHTMLAttributes } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import classNames from 'classnames'
|
|
4
4
|
|
|
5
|
-
export interface CInputGroupTextProps
|
|
5
|
+
export interface CInputGroupTextProps
|
|
6
|
+
extends LabelHTMLAttributes<HTMLLabelElement | HTMLSpanElement> {
|
|
6
7
|
/**
|
|
7
8
|
* A string of all className you want applied to the component.
|
|
8
9
|
*/
|
|
@@ -4,7 +4,7 @@ import '@testing-library/jest-dom/extend-expect'
|
|
|
4
4
|
import { CFormRange } from '../../../index'
|
|
5
5
|
|
|
6
6
|
test('loads and displays CFormRange component', async () => {
|
|
7
|
-
const { container } = render(<CFormRange
|
|
7
|
+
const { container } = render(<CFormRange step={3} />)
|
|
8
8
|
expect(container).toMatchSnapshot()
|
|
9
9
|
})
|
|
10
10
|
|
|
@@ -12,7 +12,7 @@ test('CFormRange customize', async () => {
|
|
|
12
12
|
const { container } = render(
|
|
13
13
|
<CFormRange
|
|
14
14
|
className="bazinga"
|
|
15
|
-
|
|
15
|
+
step={2}
|
|
16
16
|
disabled={true}
|
|
17
17
|
max={150}
|
|
18
18
|
min={20}
|
|
@@ -8,6 +8,15 @@ test('loads and displays CInputGroupText component', async () => {
|
|
|
8
8
|
expect(container).toMatchSnapshot()
|
|
9
9
|
})
|
|
10
10
|
|
|
11
|
+
test('renders CInputGroupText component as a label', async () => {
|
|
12
|
+
const { container } = render(
|
|
13
|
+
<CInputGroupText component="label" htmlFor="input">
|
|
14
|
+
Test
|
|
15
|
+
</CInputGroupText>,
|
|
16
|
+
)
|
|
17
|
+
expect(container).toMatchSnapshot()
|
|
18
|
+
})
|
|
19
|
+
|
|
11
20
|
test('CInputGroupText customize', async () => {
|
|
12
21
|
const { container } = render(<CInputGroupText className="bazinga">Test</CInputGroupText>)
|
|
13
22
|
expect(container).toMatchSnapshot()
|
|
@@ -19,3 +19,14 @@ exports[`loads and displays CInputGroupText component 1`] = `
|
|
|
19
19
|
</span>
|
|
20
20
|
</div>
|
|
21
21
|
`;
|
|
22
|
+
|
|
23
|
+
exports[`renders CInputGroupText component as a label 1`] = `
|
|
24
|
+
<div>
|
|
25
|
+
<label
|
|
26
|
+
class="input-group-text"
|
|
27
|
+
for="input"
|
|
28
|
+
>
|
|
29
|
+
Test
|
|
30
|
+
</label>
|
|
31
|
+
</div>
|
|
32
|
+
`;
|
|
@@ -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'
|
|
@@ -15,6 +17,8 @@ import { CInputGroupText } from './CInputGroupText'
|
|
|
15
17
|
export {
|
|
16
18
|
CForm,
|
|
17
19
|
CFormCheck,
|
|
20
|
+
CFormControlValidation,
|
|
21
|
+
CFormControlWrapper,
|
|
18
22
|
CFormFeedback,
|
|
19
23
|
CFormFloating,
|
|
20
24
|
CFormInput,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import React, { ElementType, forwardRef,
|
|
1
|
+
import React, { ElementType, forwardRef, AnchorHTMLAttributes } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import classNames from 'classnames'
|
|
4
4
|
|
|
5
|
-
export interface CHeaderBrandProps
|
|
5
|
+
export interface CHeaderBrandProps
|
|
6
|
+
extends AnchorHTMLAttributes<HTMLAnchorElement | HTMLSpanElement> {
|
|
6
7
|
/**
|
|
7
8
|
* A string of all className you want applied to the component.
|
|
8
9
|
*/
|
|
@@ -2,7 +2,7 @@ import React, { AllHTMLAttributes, ElementType, forwardRef, MouseEvent } from 'r
|
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import classNames from 'classnames'
|
|
4
4
|
|
|
5
|
-
export interface CLinkProps extends AllHTMLAttributes<
|
|
5
|
+
export interface CLinkProps extends AllHTMLAttributes<HTMLButtonElement | HTMLAnchorElement> {
|
|
6
6
|
/**
|
|
7
7
|
* Toggle the active state for the component.
|
|
8
8
|
*/
|
|
@@ -36,7 +36,7 @@ export const CLink = forwardRef<HTMLButtonElement | HTMLAnchorElement, CLinkProp
|
|
|
36
36
|
{...(active && { 'aria-current': 'page' })}
|
|
37
37
|
{...(Component === 'a' && disabled && { 'aria-disabled': true, tabIndex: -1 })}
|
|
38
38
|
{...((Component === 'a' || Component === 'button') && {
|
|
39
|
-
onClick: (event: MouseEvent<
|
|
39
|
+
onClick: (event: MouseEvent<HTMLButtonElement | HTMLAnchorElement>) => {
|
|
40
40
|
event.preventDefault
|
|
41
41
|
!disabled && rest.onClick && rest.onClick(event)
|
|
42
42
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ElementType,
|
|
1
|
+
import React, { ElementType, AnchorHTMLAttributes, forwardRef } from 'react'
|
|
2
2
|
import PropTypes from 'prop-types'
|
|
3
3
|
import classNames from 'classnames'
|
|
4
4
|
|
|
@@ -6,7 +6,7 @@ import { Colors, colorPropType } from '../Types'
|
|
|
6
6
|
import { CLink } from '../link/CLink'
|
|
7
7
|
|
|
8
8
|
export interface CListGroupItemProps
|
|
9
|
-
extends
|
|
9
|
+
extends AnchorHTMLAttributes<HTMLLIElement | HTMLAnchorElement | HTMLButtonElement> {
|
|
10
10
|
/**
|
|
11
11
|
* Toggle the active state for the component.
|
|
12
12
|
*/
|
|
@@ -3,7 +3,10 @@ import PropTypes from 'prop-types'
|
|
|
3
3
|
import { CToastContext } from './CToast'
|
|
4
4
|
import { CCloseButton, CCloseButtonProps } from '../close-button/CCloseButton'
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import type { CButtonProps } from '../button/CButton'
|
|
7
|
+
|
|
8
|
+
type CombineButtonProps = CCloseButtonProps & CButtonProps
|
|
9
|
+
export interface CToastCloseProps extends CombineButtonProps {
|
|
7
10
|
/**
|
|
8
11
|
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
9
12
|
*/
|