Skip to content

Commit 2bc8d2f

Browse files
committed
refactor: update props and types
1 parent aa3a400 commit 2bc8d2f

32 files changed

+130
-113
lines changed

packages/coreui-react/src/components/alert/CAlert.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44
import { Transition } from 'react-transition-group'
55

6-
import { Colors, colorPropType } from '../Types'
76
import { CCloseButton } from '../close-button/CCloseButton'
87

98
import { useForkedRef } from '../../hooks'
9+
import { colorPropType } from '../../props'
10+
import type { Colors } from '../../types'
1011

1112
export interface CAlertProps extends HTMLAttributes<HTMLDivElement> {
1213
/**

packages/coreui-react/src/components/avatar/CAvatar.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@ import React, { forwardRef, HTMLAttributes } from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44

5-
import {
6-
Colors,
7-
Shapes,
8-
TextColors,
9-
colorPropType,
10-
shapePropType,
11-
textColorsPropType,
12-
} from '../Types'
5+
import { colorPropType, shapePropType, textColorsPropType } from '../../props'
6+
import type { Colors, Shapes, TextColors } from '../../types'
137

148
export interface CAvatarProps extends HTMLAttributes<HTMLDivElement> {
159
/**

packages/coreui-react/src/components/badge/CBadge.tsx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,8 @@ import React, { ElementType, forwardRef, HTMLAttributes } from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44

5-
import {
6-
Colors,
7-
Shapes,
8-
TextColors,
9-
colorPropType,
10-
shapePropType,
11-
textColorsPropType,
12-
} from '../Types'
5+
import { colorPropType, shapePropType, textColorsPropType } from '../../props'
6+
import type { Colors, Shapes, TextColors } from '../../types'
137

148
export interface CBadgeProps extends HTMLAttributes<HTMLDivElement | HTMLSpanElement> {
159
/**

packages/coreui-react/src/components/button/CButton.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@ import React, { ElementType, forwardRef } from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44

5-
import { Colors, Shapes, colorPropType } from '../Types'
65
import { CLink, CLinkProps } from '../link/CLink'
76

7+
import { colorPropType } from '../../props'
8+
import type { Colors, Shapes } from '../../types'
9+
810
export interface CButtonProps extends Omit<CLinkProps, 'size'> {
911
/**
1012
* Toggle the active state for the component.

packages/coreui-react/src/components/callout/CCallout.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import React, { forwardRef, HTMLAttributes } from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44

5-
import { Colors, colorPropType } from '../Types'
5+
import { colorPropType } from '../../props'
6+
import type { Colors } from '../../types'
67

78
export interface CCalloutProps extends HTMLAttributes<HTMLDivElement> {
89
/**

packages/coreui-react/src/components/card/CCard.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ import React, { forwardRef, HTMLAttributes } from 'react'
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44

5-
import { Colors, colorPropType } from '../Types'
5+
import { colorPropType } from '../../props'
6+
import type { Colors } from '../../types'
67

78
export interface CCardProps extends HTMLAttributes<HTMLDivElement> {
89
/**

packages/coreui-react/src/components/dropdown/CDropdown.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ import PropTypes from 'prop-types'
1212
import classNames from 'classnames'
1313
import { Manager } from 'react-popper'
1414

15-
import { Placements, placementPropType } from '../Types'
1615
import { useForkedRef } from '../../hooks'
16+
import { placementPropType } from '../../props'
17+
import type { Placements } from '../../types'
1718

1819
export type Directions = 'start' | 'end'
1920

packages/coreui-react/src/components/dropdown/CDropdownMenu.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@ import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44
import { Popper, PopperChildrenProps } from 'react-popper'
55

6-
import { Placements } from '../Types'
76
import { Alignments, CDropdownContext } from './CDropdown'
87

8+
import type { Placements } from '../../types'
9+
910
export interface CDropdownMenuProps
1011
extends HTMLAttributes<HTMLDivElement | HTMLUListElement>,
1112
Omit<

packages/coreui-react/src/components/dropdown/CDropdownToggle.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44
import { Reference } from 'react-popper'
55

6-
import { useForkedRef } from '../../hooks'
7-
8-
import { Triggers, triggerPropType } from '../Types'
9-
106
import { CButton, CButtonProps } from '../button/CButton'
117
import { CDropdownContext } from './CDropdown'
128

9+
import { useForkedRef } from '../../hooks'
10+
import { triggerPropType } from '../../props'
11+
import type { Triggers } from '../../types'
12+
1313
export interface CDropdownToggleProps extends Omit<CButtonProps, 'type'> {
1414
/**
1515
* Enables pseudo element caret on toggler.

packages/coreui-react/src/components/form/CFormCheck.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import React, { forwardRef, InputHTMLAttributes, ReactNode, useEffect, useRef }
22
import PropTypes from 'prop-types'
33
import classNames from 'classnames'
44

5-
import { useForkedRef } from '../../hooks'
6-
import { Colors, Shapes } from '../Types'
7-
85
import { CFormControlValidation, CFormControlValidationProps } from './CFormControlValidation'
96
import { CFormLabel } from './CFormLabel'
107

8+
import { useForkedRef } from '../../hooks'
9+
import type { Colors, Shapes } from '../../types'
10+
1111
export type ButtonObject = {
1212
/**
1313
* Sets the color context of the component to one of CoreUI’s themed colors.

0 commit comments

Comments
 (0)