@coreui/react 5.0.0-rc.2 → 5.0.0-rc.3
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/cjs/components/badge/CBadge.d.ts +7 -0
- package/dist/cjs/components/badge/CBadge.js +4 -2
- package/dist/cjs/components/badge/CBadge.js.map +1 -1
- package/dist/cjs/components/card/CCard.d.ts +7 -0
- package/dist/cjs/components/card/CCard.js +3 -1
- package/dist/cjs/components/card/CCard.js.map +1 -1
- package/dist/cjs/components/dropdown/CDropdownToggle.d.ts +1 -1
- package/dist/cjs/components/nav/CNavGroup.d.ts +1 -1
- package/dist/cjs/components/nav/CNavGroupItems.d.ts +1 -1
- package/dist/cjs/components/nav/CNavItem.d.ts +1 -1
- package/dist/cjs/components/sidebar/CSidebarBrand.d.ts +1 -1
- package/dist/cjs/components/sidebar/CSidebarNav.d.ts +1 -1
- package/dist/cjs/node_modules/classnames/index.js +45 -27
- package/dist/cjs/node_modules/classnames/index.js.map +1 -1
- package/dist/esm/components/badge/CBadge.d.ts +7 -0
- package/dist/esm/components/badge/CBadge.js +4 -2
- package/dist/esm/components/badge/CBadge.js.map +1 -1
- package/dist/esm/components/card/CCard.d.ts +7 -0
- package/dist/esm/components/card/CCard.js +3 -1
- package/dist/esm/components/card/CCard.js.map +1 -1
- package/dist/esm/components/dropdown/CDropdownToggle.d.ts +1 -1
- package/dist/esm/components/nav/CNavGroup.d.ts +1 -1
- package/dist/esm/components/nav/CNavGroupItems.d.ts +1 -1
- package/dist/esm/components/nav/CNavItem.d.ts +1 -1
- package/dist/esm/components/sidebar/CSidebarBrand.d.ts +1 -1
- package/dist/esm/components/sidebar/CSidebarNav.d.ts +1 -1
- package/dist/esm/node_modules/classnames/index.js +45 -27
- package/dist/esm/node_modules/classnames/index.js.map +1 -1
- package/package.json +7 -7
- package/src/components/badge/CBadge.tsx +11 -1
- package/src/components/card/CCard.tsx +10 -1
- package/src/components/dropdown/CDropdownToggle.tsx +1 -1
- package/src/components/nav/CNavGroup.tsx +1 -1
- package/src/components/nav/CNavGroupItems.tsx +1 -1
- package/src/components/nav/CNavItem.tsx +1 -1
- package/src/components/sidebar/CSidebarBrand.tsx +1 -1
- package/src/components/sidebar/CSidebarNav.tsx +1 -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/v5.0.0-rc.
|
|
49
|
+
- [Download the latest release](https://github.com/coreui/coreui-react/archive/v5.0.0-rc.3.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`
|
|
@@ -30,6 +30,13 @@ export interface CBadgeProps extends HTMLAttributes<HTMLDivElement | HTMLSpanEle
|
|
|
30
30
|
* Size the component small.
|
|
31
31
|
*/
|
|
32
32
|
size?: 'sm';
|
|
33
|
+
/**
|
|
34
|
+
* Sets the component's color scheme to one of CoreUI's themed colors, ensuring the text color contrast adheres to the WCAG 4.5:1 contrast ratio standard for accessibility.
|
|
35
|
+
*
|
|
36
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
37
|
+
* @since 5.0.0-rc.3
|
|
38
|
+
*/
|
|
39
|
+
textBgColor?: Colors;
|
|
33
40
|
/**
|
|
34
41
|
* Sets the text color of the component to one of CoreUI’s themed colors.
|
|
35
42
|
*
|
|
@@ -8,9 +8,9 @@ var props = require('../../props.js');
|
|
|
8
8
|
|
|
9
9
|
var CBadge = React.forwardRef(function (_a, ref) {
|
|
10
10
|
var _b;
|
|
11
|
-
var children = _a.children, _c = _a.as, Component = _c === void 0 ? 'span' : _c, className = _a.className, color = _a.color, position = _a.position, shape = _a.shape, size = _a.size, textColor = _a.textColor, rest = tslib_es6.__rest(_a, ["children", "as", "className", "color", "position", "shape", "size", "textColor"]);
|
|
11
|
+
var children = _a.children, _c = _a.as, Component = _c === void 0 ? 'span' : _c, className = _a.className, color = _a.color, position = _a.position, shape = _a.shape, size = _a.size, textBgColor = _a.textBgColor, textColor = _a.textColor, rest = tslib_es6.__rest(_a, ["children", "as", "className", "color", "position", "shape", "size", "textBgColor", "textColor"]);
|
|
12
12
|
return (React.createElement(Component, tslib_es6.__assign({ className: index.default('badge', (_b = {},
|
|
13
|
-
_b["
|
|
13
|
+
_b["bg-".concat(color)] = color,
|
|
14
14
|
_b['position-absolute translate-middle'] = position,
|
|
15
15
|
_b['top-0'] = position === null || position === void 0 ? void 0 : position.includes('top'),
|
|
16
16
|
_b['top-100'] = position === null || position === void 0 ? void 0 : position.includes('bottom'),
|
|
@@ -18,6 +18,7 @@ var CBadge = React.forwardRef(function (_a, ref) {
|
|
|
18
18
|
_b['start-0'] = position === null || position === void 0 ? void 0 : position.includes('start'),
|
|
19
19
|
_b["badge-".concat(size)] = size,
|
|
20
20
|
_b["text-".concat(textColor)] = textColor,
|
|
21
|
+
_b["text-bg-".concat(textBgColor)] = textBgColor,
|
|
21
22
|
_b), shape, className) }, rest, { ref: ref }), children));
|
|
22
23
|
});
|
|
23
24
|
CBadge.propTypes = {
|
|
@@ -28,6 +29,7 @@ CBadge.propTypes = {
|
|
|
28
29
|
position: PropTypes.oneOf(['top-start', 'top-end', 'bottom-end', 'bottom-start']),
|
|
29
30
|
shape: props.shapePropType,
|
|
30
31
|
size: PropTypes.oneOf(['sm']),
|
|
32
|
+
textBgColor: props.colorPropType,
|
|
31
33
|
textColor: props.textColorsPropType,
|
|
32
34
|
};
|
|
33
35
|
CBadge.displayName = 'CBadge';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CBadge.js","sources":["../../../../src/components/badge/CBadge.tsx"],"sourcesContent":[null],"names":["forwardRef","__rest","__assign","classNames","colorPropType","shapePropType","textColorsPropType"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"CBadge.js","sources":["../../../../src/components/badge/CBadge.tsx"],"sourcesContent":[null],"names":["forwardRef","__rest","__assign","classNames","colorPropType","shapePropType","textColorsPropType"],"mappings":";;;;;;;;IAmDa,MAAM,GAA2DA,gBAAU,CAItF,UACE,EAWC,EACD,GAAG,EAAA;;AAXD,IAAA,IAAA,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,EAAA,GAAA,EAAA,CAAA,EAAsB,EAAlB,SAAS,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,MAAM,GAAA,EAAA,EACtB,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,KAAK,WAAA,EACL,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,IAAI,UAAA,EACJ,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,SAAS,GAAA,EAAA,CAAA,SAAA,EACN,IAAI,GAAAC,gBAAA,CAAA,EAAA,EAVT,iGAWC,CADQ,CAAA;IAIT,QACE,oBAAC,SAAS,EAAAC,kBAAA,CAAA,EACR,SAAS,EAAEC,aAAU,CACnB,OAAO,GAAA,EAAA,GAAA,EAAA;AAEL,YAAA,EAAA,CAAC,KAAM,CAAA,MAAA,CAAA,KAAK,CAAE,CAAA,GAAG,KAAK;AACtB,YAAA,EAAA,CAAA,oCAAA,CAAoC,GAAE,QAAQ;YAC9C,EAAO,CAAA,OAAA,CAAA,GAAE,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAR,QAAQ,CAAE,QAAQ,CAAC,KAAK,CAAC;YAClC,EAAS,CAAA,SAAA,CAAA,GAAE,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAR,QAAQ,CAAE,QAAQ,CAAC,QAAQ,CAAC;YACvC,EAAW,CAAA,WAAA,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* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string
|
|
18
18
|
*/
|
|
19
19
|
textColor?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Sets the component's color scheme to one of CoreUI's themed colors, ensuring the text color contrast adheres to the WCAG 4.5:1 contrast ratio standard for accessibility.
|
|
22
|
+
*
|
|
23
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
24
|
+
* @since 5.0.0-rc.3
|
|
25
|
+
*/
|
|
26
|
+
textBgColor?: Colors;
|
|
20
27
|
}
|
|
21
28
|
export declare const CCard: React.ForwardRefExoticComponent<CCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -8,16 +8,18 @@ var props = require('../../props.js');
|
|
|
8
8
|
|
|
9
9
|
var CCard = React.forwardRef(function (_a, ref) {
|
|
10
10
|
var _b;
|
|
11
|
-
var children = _a.children, className = _a.className, color = _a.color, textColor = _a.textColor, rest = tslib_es6.__rest(_a, ["children", "className", "color", "textColor"]);
|
|
11
|
+
var children = _a.children, className = _a.className, color = _a.color, textBgColor = _a.textBgColor, textColor = _a.textColor, rest = tslib_es6.__rest(_a, ["children", "className", "color", "textBgColor", "textColor"]);
|
|
12
12
|
return (React.createElement("div", tslib_es6.__assign({ className: index.default('card', (_b = {},
|
|
13
13
|
_b["bg-".concat(color)] = color,
|
|
14
14
|
_b["text-".concat(textColor)] = textColor,
|
|
15
|
+
_b["text-bg-".concat(textBgColor)] = textBgColor,
|
|
15
16
|
_b), className) }, rest, { ref: ref }), children));
|
|
16
17
|
});
|
|
17
18
|
CCard.propTypes = {
|
|
18
19
|
children: PropTypes.node,
|
|
19
20
|
className: PropTypes.string,
|
|
20
21
|
color: props.colorPropType,
|
|
22
|
+
textBgColor: props.colorPropType,
|
|
21
23
|
textColor: PropTypes.string,
|
|
22
24
|
};
|
|
23
25
|
CCard.displayName = 'CCard';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CCard.js","sources":["../../../../src/components/card/CCard.tsx"],"sourcesContent":[null],"names":["forwardRef","__rest","__assign","classNames","colorPropType"],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"CCard.js","sources":["../../../../src/components/card/CCard.tsx"],"sourcesContent":[null],"names":["forwardRef","__rest","__assign","classNames","colorPropType"],"mappings":";;;;;;;;IAiCa,KAAK,GAAGA,gBAAU,CAC7B,UAAC,EAA+D,EAAE,GAAG,EAAA;;AAAlE,IAAA,IAAA,QAAQ,GAAA,EAAA,CAAA,QAAA,EAAE,SAAS,GAAA,EAAA,CAAA,SAAA,EAAE,KAAK,GAAA,EAAA,CAAA,KAAA,EAAE,WAAW,GAAA,EAAA,CAAA,WAAA,EAAE,SAAS,GAAA,EAAA,CAAA,SAAA,EAAK,IAAI,GAAAC,gBAAA,CAAA,EAAA,EAA7D,8DAA+D,CAAF,CAAA;AAC5D,IAAA,QACE,KACE,CAAA,aAAA,CAAA,KAAA,EAAAC,kBAAA,CAAA,EAAA,SAAS,EAAEC,aAAU,CACnB,MAAM,GAAA,EAAA,GAAA,EAAA;AAEJ,YAAA,EAAA,CAAC,KAAM,CAAA,MAAA,CAAA,KAAK,CAAE,CAAA,GAAG,KAAK;AACtB,YAAA,EAAA,CAAC,OAAQ,CAAA,MAAA,CAAA,SAAS,CAAE,CAAA,GAAG,SAAS;AAChC,YAAA,EAAA,CAAC,UAAW,CAAA,MAAA,CAAA,WAAW,CAAE,CAAA,GAAG,WAAW;iBAEzC,SAAS,CACV,EACG,EAAA,IAAI,EACR,EAAA,GAAG,EAAE,GAAG,EAEP,CAAA,EAAA,QAAQ,CACL,EACP;AACH,CAAC,EACF;AAED,KAAK,CAAC,SAAS,GAAG;IAChB,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,SAAS,EAAE,SAAS,CAAC,MAAM;AAC3B,IAAA,KAAK,EAAEC,mBAAa;AACpB,IAAA,WAAW,EAAEA,mBAAa;IAC1B,SAAS,EAAE,SAAS,CAAC,MAAM;CAC5B,CAAA;AAED,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
|
@@ -13,7 +13,7 @@ export interface CDropdownToggleProps extends Omit<CButtonProps, 'type'> {
|
|
|
13
13
|
/**
|
|
14
14
|
* If a dropdown `variant` is set to `nav-item` then render the toggler as a link instead of a button.
|
|
15
15
|
*
|
|
16
|
-
* @since v5.0.0-rc.
|
|
16
|
+
* @since v5.0.0-rc.3
|
|
17
17
|
*/
|
|
18
18
|
navLink?: boolean;
|
|
19
19
|
/**
|
|
@@ -18,39 +18,57 @@ var index = require('../../_virtual/index.js');
|
|
|
18
18
|
|
|
19
19
|
var hasOwn = {}.hasOwnProperty;
|
|
20
20
|
|
|
21
|
-
function classNames() {
|
|
22
|
-
var classes =
|
|
21
|
+
function classNames () {
|
|
22
|
+
var classes = '';
|
|
23
23
|
|
|
24
24
|
for (var i = 0; i < arguments.length; i++) {
|
|
25
25
|
var arg = arguments[i];
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
var argType = typeof arg;
|
|
29
|
-
|
|
30
|
-
if (argType === 'string' || argType === 'number') {
|
|
31
|
-
classes.push(arg);
|
|
32
|
-
} else if (Array.isArray(arg)) {
|
|
33
|
-
if (arg.length) {
|
|
34
|
-
var inner = classNames.apply(null, arg);
|
|
35
|
-
if (inner) {
|
|
36
|
-
classes.push(inner);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
} else if (argType === 'object') {
|
|
40
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
41
|
-
classes.push(arg.toString());
|
|
42
|
-
continue;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
for (var key in arg) {
|
|
46
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
47
|
-
classes.push(key);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
26
|
+
if (arg) {
|
|
27
|
+
classes = appendClass(classes, parseValue(arg));
|
|
50
28
|
}
|
|
51
29
|
}
|
|
52
30
|
|
|
53
|
-
return classes
|
|
31
|
+
return classes;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function parseValue (arg) {
|
|
35
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
36
|
+
return arg;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (typeof arg !== 'object') {
|
|
40
|
+
return '';
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (Array.isArray(arg)) {
|
|
44
|
+
return classNames.apply(null, arg);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
48
|
+
return arg.toString();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
var classes = '';
|
|
52
|
+
|
|
53
|
+
for (var key in arg) {
|
|
54
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
55
|
+
classes = appendClass(classes, key);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return classes;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function appendClass (value, newClass) {
|
|
63
|
+
if (!newClass) {
|
|
64
|
+
return value;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (value) {
|
|
68
|
+
return value + ' ' + newClass;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
return value + newClass;
|
|
54
72
|
}
|
|
55
73
|
|
|
56
74
|
if (module.exports) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../classnames/index.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../classnames/index.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t}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IAAG,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE;KACtC,OAAO,GAAG,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;KACpC;IACD;AACH;GACE,OAAO,OAAO,CAAC;GACf;AACF;AACA,EAAC,SAAS,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE;GACtC,IAAI,CAAC,QAAQ,EAAE;IACd,OAAO,KAAK,CAAC;IACb;AACH;GACE,IAAI,KAAK,EAAE;AACb,IAAG,OAAO,KAAK,GAAG,GAAG,GAAG,QAAQ,CAAC;IAC9B;AACH;AACA,GAAE,OAAO,KAAK,GAAG,QAAQ,CAAC;GACxB;AACF;EACC,IAAqC,MAAM,CAAC,OAAO,EAAE;AACtD,GAAE,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC;GAChC,MAAA,CAAA,OAAA,GAAiB,UAAU,CAAC;AAC9B,GAAE,MAKM;AACR,GAAE,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;GAC/B;AACF,EAAC,EAAE,EAAA;;;;;;;;","x_google_ignoreList":[0]}
|
|
@@ -30,6 +30,13 @@ export interface CBadgeProps extends HTMLAttributes<HTMLDivElement | HTMLSpanEle
|
|
|
30
30
|
* Size the component small.
|
|
31
31
|
*/
|
|
32
32
|
size?: 'sm';
|
|
33
|
+
/**
|
|
34
|
+
* Sets the component's color scheme to one of CoreUI's themed colors, ensuring the text color contrast adheres to the WCAG 4.5:1 contrast ratio standard for accessibility.
|
|
35
|
+
*
|
|
36
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
37
|
+
* @since 5.0.0-rc.3
|
|
38
|
+
*/
|
|
39
|
+
textBgColor?: Colors;
|
|
33
40
|
/**
|
|
34
41
|
* Sets the text color of the component to one of CoreUI’s themed colors.
|
|
35
42
|
*
|
|
@@ -6,9 +6,9 @@ import { colorPropType, shapePropType, textColorsPropType } from '../../props.js
|
|
|
6
6
|
|
|
7
7
|
var CBadge = forwardRef(function (_a, ref) {
|
|
8
8
|
var _b;
|
|
9
|
-
var children = _a.children, _c = _a.as, Component = _c === void 0 ? 'span' : _c, className = _a.className, color = _a.color, position = _a.position, shape = _a.shape, size = _a.size, textColor = _a.textColor, rest = __rest(_a, ["children", "as", "className", "color", "position", "shape", "size", "textColor"]);
|
|
9
|
+
var children = _a.children, _c = _a.as, Component = _c === void 0 ? 'span' : _c, className = _a.className, color = _a.color, position = _a.position, shape = _a.shape, size = _a.size, textBgColor = _a.textBgColor, textColor = _a.textColor, rest = __rest(_a, ["children", "as", "className", "color", "position", "shape", "size", "textBgColor", "textColor"]);
|
|
10
10
|
return (React.createElement(Component, __assign({ className: classNames('badge', (_b = {},
|
|
11
|
-
_b["
|
|
11
|
+
_b["bg-".concat(color)] = color,
|
|
12
12
|
_b['position-absolute translate-middle'] = position,
|
|
13
13
|
_b['top-0'] = position === null || position === void 0 ? void 0 : position.includes('top'),
|
|
14
14
|
_b['top-100'] = position === null || position === void 0 ? void 0 : position.includes('bottom'),
|
|
@@ -16,6 +16,7 @@ var CBadge = forwardRef(function (_a, ref) {
|
|
|
16
16
|
_b['start-0'] = position === null || position === void 0 ? void 0 : position.includes('start'),
|
|
17
17
|
_b["badge-".concat(size)] = size,
|
|
18
18
|
_b["text-".concat(textColor)] = textColor,
|
|
19
|
+
_b["text-bg-".concat(textBgColor)] = textBgColor,
|
|
19
20
|
_b), shape, className) }, rest, { ref: ref }), children));
|
|
20
21
|
});
|
|
21
22
|
CBadge.propTypes = {
|
|
@@ -26,6 +27,7 @@ CBadge.propTypes = {
|
|
|
26
27
|
position: PropTypes.oneOf(['top-start', 'top-end', 'bottom-end', 'bottom-start']),
|
|
27
28
|
shape: shapePropType,
|
|
28
29
|
size: PropTypes.oneOf(['sm']),
|
|
30
|
+
textBgColor: colorPropType,
|
|
29
31
|
textColor: textColorsPropType,
|
|
30
32
|
};
|
|
31
33
|
CBadge.displayName = 'CBadge';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CBadge.js","sources":["../../../../src/components/badge/CBadge.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"CBadge.js","sources":["../../../../src/components/badge/CBadge.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;IAmDa,MAAM,GAA2D,UAAU,CAItF,UACE,EAWC,EACD,GAAG,EAAA;;AAXD,IAAA,IAAA,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,EAAA,GAAA,EAAA,CAAA,EAAsB,EAAlB,SAAS,GAAA,EAAA,KAAA,KAAA,CAAA,GAAG,MAAM,GAAA,EAAA,EACtB,SAAS,GAAA,EAAA,CAAA,SAAA,EACT,KAAK,WAAA,EACL,QAAQ,GAAA,EAAA,CAAA,QAAA,EACR,KAAK,GAAA,EAAA,CAAA,KAAA,EACL,IAAI,UAAA,EACJ,WAAW,GAAA,EAAA,CAAA,WAAA,EACX,SAAS,GAAA,EAAA,CAAA,SAAA,EACN,IAAI,GAAA,MAAA,CAAA,EAAA,EAVT,iGAWC,CADQ,CAAA;IAIT,QACE,oBAAC,SAAS,EAAA,QAAA,CAAA,EACR,SAAS,EAAE,UAAU,CACnB,OAAO,GAAA,EAAA,GAAA,EAAA;AAEL,YAAA,EAAA,CAAC,KAAM,CAAA,MAAA,CAAA,KAAK,CAAE,CAAA,GAAG,KAAK;AACtB,YAAA,EAAA,CAAA,oCAAA,CAAoC,GAAE,QAAQ;YAC9C,EAAO,CAAA,OAAA,CAAA,GAAE,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAR,QAAQ,CAAE,QAAQ,CAAC,KAAK,CAAC;YAClC,EAAS,CAAA,SAAA,CAAA,GAAE,QAAQ,KAAA,IAAA,IAAR,QAAQ,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAR,QAAQ,CAAE,QAAQ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TMLAttributes<HTMLDivElement> {
|
|
|
17
17
|
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string
|
|
18
18
|
*/
|
|
19
19
|
textColor?: string;
|
|
20
|
+
/**
|
|
21
|
+
* Sets the component's color scheme to one of CoreUI's themed colors, ensuring the text color contrast adheres to the WCAG 4.5:1 contrast ratio standard for accessibility.
|
|
22
|
+
*
|
|
23
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
24
|
+
* @since 5.0.0-rc.3
|
|
25
|
+
*/
|
|
26
|
+
textBgColor?: Colors;
|
|
20
27
|
}
|
|
21
28
|
export declare const CCard: React.ForwardRefExoticComponent<CCardProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -6,16 +6,18 @@ import { colorPropType } from '../../props.js';
|
|
|
6
6
|
|
|
7
7
|
var CCard = forwardRef(function (_a, ref) {
|
|
8
8
|
var _b;
|
|
9
|
-
var children = _a.children, className = _a.className, color = _a.color, textColor = _a.textColor, rest = __rest(_a, ["children", "className", "color", "textColor"]);
|
|
9
|
+
var children = _a.children, className = _a.className, color = _a.color, textBgColor = _a.textBgColor, textColor = _a.textColor, rest = __rest(_a, ["children", "className", "color", "textBgColor", "textColor"]);
|
|
10
10
|
return (React.createElement("div", __assign({ className: classNames('card', (_b = {},
|
|
11
11
|
_b["bg-".concat(color)] = color,
|
|
12
12
|
_b["text-".concat(textColor)] = textColor,
|
|
13
|
+
_b["text-bg-".concat(textBgColor)] = textBgColor,
|
|
13
14
|
_b), className) }, rest, { ref: ref }), children));
|
|
14
15
|
});
|
|
15
16
|
CCard.propTypes = {
|
|
16
17
|
children: PropTypes.node,
|
|
17
18
|
className: PropTypes.string,
|
|
18
19
|
color: colorPropType,
|
|
20
|
+
textBgColor: colorPropType,
|
|
19
21
|
textColor: PropTypes.string,
|
|
20
22
|
};
|
|
21
23
|
CCard.displayName = 'CCard';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CCard.js","sources":["../../../../src/components/card/CCard.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"CCard.js","sources":["../../../../src/components/card/CCard.tsx"],"sourcesContent":[null],"names":[],"mappings":";;;;;;IAiCa,KAAK,GAAG,UAAU,CAC7B,UAAC,EAA+D,EAAE,GAAG,EAAA;;AAAlE,IAAA,IAAA,QAAQ,GAAA,EAAA,CAAA,QAAA,EAAE,SAAS,GAAA,EAAA,CAAA,SAAA,EAAE,KAAK,GAAA,EAAA,CAAA,KAAA,EAAE,WAAW,GAAA,EAAA,CAAA,WAAA,EAAE,SAAS,GAAA,EAAA,CAAA,SAAA,EAAK,IAAI,GAAA,MAAA,CAAA,EAAA,EAA7D,8DAA+D,CAAF,CAAA;AAC5D,IAAA,QACE,KACE,CAAA,aAAA,CAAA,KAAA,EAAA,QAAA,CAAA,EAAA,SAAS,EAAE,UAAU,CACnB,MAAM,GAAA,EAAA,GAAA,EAAA;AAEJ,YAAA,EAAA,CAAC,KAAM,CAAA,MAAA,CAAA,KAAK,CAAE,CAAA,GAAG,KAAK;AACtB,YAAA,EAAA,CAAC,OAAQ,CAAA,MAAA,CAAA,SAAS,CAAE,CAAA,GAAG,SAAS;AAChC,YAAA,EAAA,CAAC,UAAW,CAAA,MAAA,CAAA,WAAW,CAAE,CAAA,GAAG,WAAW;iBAEzC,SAAS,CACV,EACG,EAAA,IAAI,EACR,EAAA,GAAG,EAAE,GAAG,EAEP,CAAA,EAAA,QAAQ,CACL,EACP;AACH,CAAC,EACF;AAED,KAAK,CAAC,SAAS,GAAG;IAChB,QAAQ,EAAE,SAAS,CAAC,IAAI;IACxB,SAAS,EAAE,SAAS,CAAC,MAAM;AAC3B,IAAA,KAAK,EAAE,aAAa;AACpB,IAAA,WAAW,EAAE,aAAa;IAC1B,SAAS,EAAE,SAAS,CAAC,MAAM;CAC5B,CAAA;AAED,KAAK,CAAC,WAAW,GAAG,OAAO;;;;"}
|
|
@@ -13,7 +13,7 @@ export interface CDropdownToggleProps extends Omit<CButtonProps, 'type'> {
|
|
|
13
13
|
/**
|
|
14
14
|
* If a dropdown `variant` is set to `nav-item` then render the toggler as a link instead of a button.
|
|
15
15
|
*
|
|
16
|
-
* @since v5.0.0-rc.
|
|
16
|
+
* @since v5.0.0-rc.3
|
|
17
17
|
*/
|
|
18
18
|
navLink?: boolean;
|
|
19
19
|
/**
|
|
@@ -14,39 +14,57 @@ import { __module as classnames } from '../../_virtual/index.js';
|
|
|
14
14
|
|
|
15
15
|
var hasOwn = {}.hasOwnProperty;
|
|
16
16
|
|
|
17
|
-
function classNames() {
|
|
18
|
-
var classes =
|
|
17
|
+
function classNames () {
|
|
18
|
+
var classes = '';
|
|
19
19
|
|
|
20
20
|
for (var i = 0; i < arguments.length; i++) {
|
|
21
21
|
var arg = arguments[i];
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
var argType = typeof arg;
|
|
25
|
-
|
|
26
|
-
if (argType === 'string' || argType === 'number') {
|
|
27
|
-
classes.push(arg);
|
|
28
|
-
} else if (Array.isArray(arg)) {
|
|
29
|
-
if (arg.length) {
|
|
30
|
-
var inner = classNames.apply(null, arg);
|
|
31
|
-
if (inner) {
|
|
32
|
-
classes.push(inner);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
} else if (argType === 'object') {
|
|
36
|
-
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
37
|
-
classes.push(arg.toString());
|
|
38
|
-
continue;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
for (var key in arg) {
|
|
42
|
-
if (hasOwn.call(arg, key) && arg[key]) {
|
|
43
|
-
classes.push(key);
|
|
44
|
-
}
|
|
45
|
-
}
|
|
22
|
+
if (arg) {
|
|
23
|
+
classes = appendClass(classes, parseValue(arg));
|
|
46
24
|
}
|
|
47
25
|
}
|
|
48
26
|
|
|
49
|
-
return classes
|
|
27
|
+
return classes;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function parseValue (arg) {
|
|
31
|
+
if (typeof arg === 'string' || typeof arg === 'number') {
|
|
32
|
+
return arg;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (typeof arg !== 'object') {
|
|
36
|
+
return '';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (Array.isArray(arg)) {
|
|
40
|
+
return classNames.apply(null, arg);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {
|
|
44
|
+
return arg.toString();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
var classes = '';
|
|
48
|
+
|
|
49
|
+
for (var key in arg) {
|
|
50
|
+
if (hasOwn.call(arg, key) && arg[key]) {
|
|
51
|
+
classes = appendClass(classes, key);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
return classes;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function appendClass (value, newClass) {
|
|
59
|
+
if (!newClass) {
|
|
60
|
+
return value;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (value) {
|
|
64
|
+
return value + ' ' + newClass;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return value + newClass;
|
|
50
68
|
}
|
|
51
69
|
|
|
52
70
|
if (module.exports) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../../classnames/index.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../../classnames/index.js"],"sourcesContent":["/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n"],"names":[],"mappings":";;;;;;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AI,GAAG,CAAC,GAAG,CAAC,EAAE;KACtC,OAAO,GAAG,WAAW,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;KACpC;IACD;AACH;GACE,OAAO,OAAO,CAAC;GACf;AACF;AACA,EAAC,SAAS,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE;GACtC,IAAI,CAAC,QAAQ,EAAE;IACd,OAAO,KAAK,CAAC;IACb;AACH;GACE,IAAI,KAAK,EAAE;AACb,IAAG,OAAO,KAAK,GAAG,GAAG,GAAG,QAAQ,CAAC;IAC9B;AACH;AACA,GAAE,OAAO,KAAK,GAAG,QAAQ,CAAC;GACxB;AACF;EACC,IAAqC,MAAM,CAAC,OAAO,EAAE;AACtD,GAAE,UAAU,CAAC,OAAO,GAAG,UAAU,CAAC;GAChC,MAAA,CAAA,OAAA,GAAiB,UAAU,CAAC;AAC9B,GAAE,MAKM;AACR,GAAE,MAAM,CAAC,UAAU,GAAG,UAAU,CAAC;GAC/B;AACF,EAAC,EAAE,EAAA;;;;;;;;","x_google_ignoreList":[0]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coreui/react",
|
|
3
|
-
"version": "5.0.0-rc.
|
|
3
|
+
"version": "5.0.0-rc.3",
|
|
4
4
|
"description": "UI Components Library for React.js",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"test:update": "jest --coverage --updateSnapshot"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@coreui/coreui": "^5.0.0-rc.
|
|
44
|
+
"@coreui/coreui": "^5.0.0-rc.3",
|
|
45
45
|
"@popperjs/core": "^2.11.8",
|
|
46
46
|
"prop-types": "^15.8.1"
|
|
47
47
|
},
|
|
@@ -50,10 +50,10 @@
|
|
|
50
50
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
51
51
|
"@rollup/plugin-typescript": "^11.1.6",
|
|
52
52
|
"@testing-library/jest-dom": "^6.4.2",
|
|
53
|
-
"@testing-library/react": "^14.2.
|
|
53
|
+
"@testing-library/react": "^14.2.2",
|
|
54
54
|
"@types/jest": "^29.5.12",
|
|
55
|
-
"@types/react": "18.2.
|
|
56
|
-
"@types/react-dom": "^18.2.
|
|
55
|
+
"@types/react": "18.2.67",
|
|
56
|
+
"@types/react-dom": "^18.2.22",
|
|
57
57
|
"@types/react-transition-group": "^4.4.10",
|
|
58
58
|
"classnames": "^2.5.1",
|
|
59
59
|
"cross-env": "^7.0.3",
|
|
@@ -62,10 +62,10 @@
|
|
|
62
62
|
"react": "^18.2.0",
|
|
63
63
|
"react-dom": "^18.2.0",
|
|
64
64
|
"react-transition-group": "^4.4.5",
|
|
65
|
-
"rollup": "^4.
|
|
65
|
+
"rollup": "^4.13.0",
|
|
66
66
|
"ts-jest": "^29.1.2",
|
|
67
67
|
"tslib": "^2.6.2",
|
|
68
|
-
"typescript": "^5.4.
|
|
68
|
+
"typescript": "^5.4.3"
|
|
69
69
|
},
|
|
70
70
|
"peerDependencies": {
|
|
71
71
|
"react": ">=17",
|
|
@@ -35,6 +35,13 @@ export interface CBadgeProps extends HTMLAttributes<HTMLDivElement | HTMLSpanEle
|
|
|
35
35
|
* Size the component small.
|
|
36
36
|
*/
|
|
37
37
|
size?: 'sm'
|
|
38
|
+
/**
|
|
39
|
+
* Sets the component's color scheme to one of CoreUI's themed colors, ensuring the text color contrast adheres to the WCAG 4.5:1 contrast ratio standard for accessibility.
|
|
40
|
+
*
|
|
41
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
42
|
+
* @since 5.0.0-rc.3
|
|
43
|
+
*/
|
|
44
|
+
textBgColor?: Colors
|
|
38
45
|
/**
|
|
39
46
|
* Sets the text color of the component to one of CoreUI’s themed colors.
|
|
40
47
|
*
|
|
@@ -55,6 +62,7 @@ export const CBadge: PolymorphicRefForwardingComponent<'span', CBadgeProps> = fo
|
|
|
55
62
|
position,
|
|
56
63
|
shape,
|
|
57
64
|
size,
|
|
65
|
+
textBgColor,
|
|
58
66
|
textColor,
|
|
59
67
|
...rest
|
|
60
68
|
},
|
|
@@ -65,7 +73,7 @@ export const CBadge: PolymorphicRefForwardingComponent<'span', CBadgeProps> = fo
|
|
|
65
73
|
className={classNames(
|
|
66
74
|
'badge',
|
|
67
75
|
{
|
|
68
|
-
[`
|
|
76
|
+
[`bg-${color}`]: color,
|
|
69
77
|
'position-absolute translate-middle': position,
|
|
70
78
|
'top-0': position?.includes('top'),
|
|
71
79
|
'top-100': position?.includes('bottom'),
|
|
@@ -73,6 +81,7 @@ export const CBadge: PolymorphicRefForwardingComponent<'span', CBadgeProps> = fo
|
|
|
73
81
|
'start-0': position?.includes('start'),
|
|
74
82
|
[`badge-${size}`]: size,
|
|
75
83
|
[`text-${textColor}`]: textColor,
|
|
84
|
+
[`text-bg-${textBgColor}`]: textBgColor,
|
|
76
85
|
},
|
|
77
86
|
shape,
|
|
78
87
|
className,
|
|
@@ -94,6 +103,7 @@ CBadge.propTypes = {
|
|
|
94
103
|
position: PropTypes.oneOf(['top-start', 'top-end', 'bottom-end', 'bottom-start']),
|
|
95
104
|
shape: shapePropType,
|
|
96
105
|
size: PropTypes.oneOf(['sm']),
|
|
106
|
+
textBgColor: colorPropType,
|
|
97
107
|
textColor: textColorsPropType,
|
|
98
108
|
}
|
|
99
109
|
|
|
@@ -22,10 +22,17 @@ export interface CCardProps extends HTMLAttributes<HTMLDivElement> {
|
|
|
22
22
|
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'primary-emphasis' | 'secondary-emphasis' | 'success-emphasis' | 'danger-emphasis' | 'warning-emphasis' | 'info-emphasis' | 'light-emphasis' | 'body' | 'body-emphasis' | 'body-secondary' | 'body-tertiary' | 'black' | 'black-50' | 'white' | 'white-50' | string
|
|
23
23
|
*/
|
|
24
24
|
textColor?: string
|
|
25
|
+
/**
|
|
26
|
+
* Sets the component's color scheme to one of CoreUI's themed colors, ensuring the text color contrast adheres to the WCAG 4.5:1 contrast ratio standard for accessibility.
|
|
27
|
+
*
|
|
28
|
+
* @type 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | string
|
|
29
|
+
* @since 5.0.0-rc.3
|
|
30
|
+
*/
|
|
31
|
+
textBgColor?: Colors
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
export const CCard = forwardRef<HTMLDivElement, CCardProps>(
|
|
28
|
-
({ children, className, color, textColor, ...rest }, ref) => {
|
|
35
|
+
({ children, className, color, textBgColor, textColor, ...rest }, ref) => {
|
|
29
36
|
return (
|
|
30
37
|
<div
|
|
31
38
|
className={classNames(
|
|
@@ -33,6 +40,7 @@ export const CCard = forwardRef<HTMLDivElement, CCardProps>(
|
|
|
33
40
|
{
|
|
34
41
|
[`bg-${color}`]: color,
|
|
35
42
|
[`text-${textColor}`]: textColor,
|
|
43
|
+
[`text-bg-${textBgColor}`]: textBgColor,
|
|
36
44
|
},
|
|
37
45
|
className,
|
|
38
46
|
)}
|
|
@@ -49,6 +57,7 @@ CCard.propTypes = {
|
|
|
49
57
|
children: PropTypes.node,
|
|
50
58
|
className: PropTypes.string,
|
|
51
59
|
color: colorPropType,
|
|
60
|
+
textBgColor: colorPropType,
|
|
52
61
|
textColor: PropTypes.string,
|
|
53
62
|
}
|
|
54
63
|
|
|
@@ -21,7 +21,7 @@ export interface CDropdownToggleProps extends Omit<CButtonProps, 'type'> {
|
|
|
21
21
|
/**
|
|
22
22
|
* If a dropdown `variant` is set to `nav-item` then render the toggler as a link instead of a button.
|
|
23
23
|
*
|
|
24
|
-
* @since v5.0.0-rc.
|
|
24
|
+
* @since v5.0.0-rc.3
|
|
25
25
|
*/
|
|
26
26
|
navLink?: boolean
|
|
27
27
|
/**
|
|
@@ -22,7 +22,7 @@ export interface CNavGroupProps extends HTMLAttributes<HTMLDivElement | HTMLLIEl
|
|
|
22
22
|
/**
|
|
23
23
|
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
24
24
|
*
|
|
25
|
-
* @since 5.0.0-rc.
|
|
25
|
+
* @since 5.0.0-rc.3
|
|
26
26
|
*/
|
|
27
27
|
as?: ElementType
|
|
28
28
|
/**
|
|
@@ -16,7 +16,7 @@ export interface CSidebarNavProps extends HTMLAttributes<HTMLUListElement> {
|
|
|
16
16
|
/**
|
|
17
17
|
* Component used for the root node. Either a string to use a HTML element or a component.
|
|
18
18
|
*
|
|
19
|
-
* @since 5.0.0-rc.
|
|
19
|
+
* @since 5.0.0-rc.3
|
|
20
20
|
*/
|
|
21
21
|
as?: ElementType
|
|
22
22
|
/**
|