Skip to content

Commit df8c4c0

Browse files
committed
refactor: remove cssModules functionality
1 parent 54f6aef commit df8c4c0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

91 files changed

+236
-473
lines changed

src/CAlert.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React, { useState, useEffect, useRef } from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
4-
import { mapToCssModules } from './Shared/helper.js'
54
import CFade from './CFade'
65
import CButtonClose from './CButtonClose'
76

@@ -10,7 +9,6 @@ const CAlert = props => {
109
let {
1110
children,
1211
className,
13-
cssModule,
1412
//
1513
onShowChange,
1614
closeButton,
@@ -22,14 +20,14 @@ const CAlert = props => {
2220
} = props
2321

2422
//render
25-
const classes = mapToCssModules(classNames(
23+
const classes = classNames(
2624
className,
2725
'alert',
2826
{
2927
[`alert-${color}`]: color,
3028
'alert-dismissible': closeButton
3129
}
32-
), cssModule)
30+
)
3331

3432
const alertTransition = {
3533
...CFade.defaultProps,
@@ -76,7 +74,6 @@ const CAlert = props => {
7674
CAlert.propTypes = {
7775
children: PropTypes.node,
7876
className: PropTypes.string,
79-
cssModule: PropTypes.object,
8077
//
8178
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
8279
onShowChange: PropTypes.func,

src/CBadge.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
4-
import { tagPropType, mapToCssModules } from './Shared/helper.js'
4+
import { tagPropType } from './Shared/helper.js'
55
import CLink from './CLink'
66

77
//component - CoreUI / CBadge
@@ -11,7 +11,6 @@ const CBadge = props => {
1111
let {
1212
tag,
1313
className,
14-
cssModule,
1514
//
1615
innerRef,
1716
color,
@@ -21,14 +20,14 @@ const CBadge = props => {
2120

2221
// render
2322

24-
const classes = mapToCssModules(classNames(
23+
const classes = classNames(
2524
className,
2625
'badge',
2726
{
2827
[`badge-${color}`]: color,
2928
[`badge-${shape}`]: shape
3029
}
31-
), cssModule)
30+
)
3231

3332
const Tag = attributes.to || attributes.href ? CLink : tag
3433
const ref = { [`${typeof Tag === 'string' ? 'ref': 'innerRef'}`]: innerRef }
@@ -42,7 +41,6 @@ const CBadge = props => {
4241
CBadge.propTypes = {
4342
tag: tagPropType,
4443
className: PropTypes.string,
45-
cssModule: PropTypes.object,
4644
//
4745
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
4846
color: PropTypes.string,

src/CBrand.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
4-
import { tagPropType, mapToCssModules } from './Shared/helper.js'
4+
import { tagPropType } from './Shared/helper.js'
55
import CLink from './CLink'
66

77
//component - CoreUI / CBrand
@@ -10,15 +10,14 @@ const CBrand = props => {
1010
const {
1111
tag,
1212
className,
13-
cssModule,
1413
//
1514
innerRef,
1615
...attributes
1716
} = props
1817

1918
//render
2019

21-
const classes = mapToCssModules(classNames(className), cssModule)
20+
const classes = classNames(className)
2221

2322
const Tag = attributes.to || attributes.href ? CLink : tag
2423
const ref = { [`${typeof Tag === 'string' ? 'ref': 'innerRef'}`]: innerRef}
@@ -30,7 +29,6 @@ const CBrand = props => {
3029
CBrand.propTypes = {
3130
tag: tagPropType,
3231
children: PropTypes.node,
33-
cssModule: PropTypes.object,
3432
className: PropTypes.oneOfType([PropTypes.string, PropTypes.array]),
3533
//
3634
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string])

src/CBreadcrumb.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
4-
import { mapToCssModules } from './Shared/helper.js'
54

65
//component - CoreUI / CBreadcrumb
76

@@ -10,12 +9,11 @@ const CBreadcrumb = props => {
109
const {
1110
className,
1211
innerRef,
13-
cssModule,
1412
//
1513
...attributes
1614
} = props
1715

18-
const classes = mapToCssModules(classNames(className, 'breadcrumb'), cssModule)
16+
const classes = classNames(className, 'breadcrumb')
1917

2018
//render
2119
return (
@@ -26,7 +24,6 @@ const CBreadcrumb = props => {
2624
CBreadcrumb.propTypes = {
2725
children: PropTypes.node,
2826
className: PropTypes.string,
29-
cssModule: PropTypes.object,
3027
//
3128
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
3229
}

src/CBreadcrumbItem.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
4-
import { mapToCssModules } from './Shared/helper.js'
54

65
//component - CoreUI / CBreadcrumbItem
76

87
const CBreadcrumbItem = props => {
98

109
const {
1110
className,
12-
cssModule,
1311
//
1412
innerRef,
1513
active,
@@ -18,11 +16,11 @@ const CBreadcrumbItem = props => {
1816

1917
//render
2018

21-
const classes = mapToCssModules(classNames(
19+
const classes = classNames(
2220
className,
2321
active ? 'active' : false,
2422
'breadcrumb-item'
25-
), cssModule)
23+
)
2624

2725
return (
2826
<li
@@ -38,7 +36,6 @@ const CBreadcrumbItem = props => {
3836

3937
CBreadcrumbItem.propTypes = {
4038
className: PropTypes.string,
41-
cssModule: PropTypes.object,
4239
//
4340
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
4441
active: PropTypes.bool

src/CBreadcrumbRouter.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
4-
import { mapToCssModules } from './Shared/helper.js'
54
import { CBreadcrumb, CBreadcrumbItem } from './index'
65
import { Link, useLocation } from 'react-router-dom';
76

@@ -34,7 +33,6 @@ const CBreadcrumbRouter = props => {
3433

3534
const {
3635
className,
37-
cssModule,
3836
//
3937
innerRef,
4038
routes,
@@ -47,7 +45,7 @@ const CBreadcrumbRouter = props => {
4745

4846
//render
4947

50-
const classes = mapToCssModules(classNames(className), cssModule)
48+
const classes = classNames(className)
5149

5250
return (
5351
<CBreadcrumb
@@ -66,7 +64,6 @@ const CBreadcrumbRouter = props => {
6664

6765
CBreadcrumbRouter.propTypes = {
6866
className: PropTypes.string,
69-
cssModule: PropTypes.object,
7067
//
7168
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
7269
routes: PropTypes.array

src/CButton.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
4-
import { tagPropType, mapToCssModules } from './Shared/helper.js'
4+
import { tagPropType } from './Shared/helper.js'
55
import CLink from './CLink'
66
//component - CoreUI / CButton
77

@@ -10,7 +10,6 @@ const CButton = props => {
1010
let {
1111
tag: Tag,
1212
className,
13-
cssModule,
1413
//
1514
innerRef,
1615
onClick,
@@ -30,7 +29,7 @@ const CButton = props => {
3029
const isLink = attributes.to || attributes.href
3130

3231
//render
33-
const classes = mapToCssModules(classNames(
32+
const classes = classNames(
3433
className,
3534
'btn',
3635
variant || color ? `btn${variant ? '-' + variant : ''}-${color}` : false,
@@ -40,7 +39,7 @@ const CButton = props => {
4039
pressed ? 'btn-pressed' : false,
4140
{ 'active': active && !isLink,
4241
'disabled': disabled && !isLink }
43-
), cssModule)
42+
)
4443

4544

4645
if (isLink) {
@@ -66,7 +65,6 @@ const CButton = props => {
6665

6766
CButton.propTypes = {
6867
tag: tagPropType,
69-
cssModule: PropTypes.object,
7068
className: PropTypes.string,
7169
//
7270
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),

src/CButtonClose.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
4-
import { mapToCssModules } from './Shared/helper.js'
54

65
//component - CoreUI / CButtonClose
76

@@ -10,7 +9,6 @@ const CButtonClose = props => {
109
const {
1110
children,
1211
className,
13-
cssModule,
1412
//
1513
buttonClass,
1614
innerRef,
@@ -19,10 +17,10 @@ const CButtonClose = props => {
1917

2018
//render
2119

22-
const classes = mapToCssModules(classNames(
20+
const classes = classNames(
2321
buttonClass,
2422
className
25-
), cssModule)
23+
)
2624

2725
return (
2826
<button
@@ -40,7 +38,6 @@ const CButtonClose = props => {
4038
CButtonClose.propTypes = {
4139
children: PropTypes.node,
4240
className: PropTypes.string,
43-
cssModule: PropTypes.object,
4441
//
4542
buttonClass: PropTypes.string,
4643
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),

src/CButtonGroup.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
4-
import { mapToCssModules } from './Shared/helper.js'
54

65
//component - CoreUI / CButtonGroup
76

87
const CButtonGroup = props => {
98

109
const {
1110
className,
12-
cssModule,
1311
//
1412
innerRef,
1513
size,
@@ -19,11 +17,11 @@ const CButtonGroup = props => {
1917

2018
//render
2119

22-
const classes = mapToCssModules(classNames(
20+
const classes = classNames(
2321
className,
2422
size ? 'btn-group-' + size : false,
2523
vertical ? 'btn-group-vertical' : 'btn-group'
26-
), cssModule)
24+
)
2725

2826
return (
2927
<div
@@ -37,7 +35,6 @@ const CButtonGroup = props => {
3735

3836
CButtonGroup.propTypes = {
3937
className: PropTypes.string,
40-
cssModule: PropTypes.object,
4138
//
4239
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
4340
size: PropTypes.oneOf(['', 'sm', 'lg']),

src/CButtonToolbar.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import React from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
4-
import { mapToCssModules } from './Shared/helper.js'
54

65
//component - CoreUI / CButtonToolbar
76

87
const CButtonToolbar = props=>{
98

109
const {
1110
className,
12-
cssModule,
1311
//
1412
innerRef,
1513
justify,
@@ -18,11 +16,11 @@ const CButtonToolbar = props=>{
1816

1917
//render
2018

21-
const classes = mapToCssModules(classNames(
19+
const classes = classNames(
2220
className,
2321
'btn-toolbar',
2422
{ [`justify-content-${justify}`]: justify }
25-
), cssModule)
23+
)
2624

2725
return (
2826
<div
@@ -38,7 +36,6 @@ const CButtonToolbar = props=>{
3836

3937
CButtonToolbar.propTypes = {
4038
className: PropTypes.string,
41-
cssModule: PropTypes.object,
4239
//
4340
innerRef: PropTypes.oneOfType([PropTypes.object, PropTypes.func, PropTypes.string]),
4441
role: PropTypes.string,

0 commit comments

Comments
 (0)