Skip to content

Commit d285de7

Browse files
committed
fix(:label:) fixing type annotations
react-docgen-typescript was removing color from the prop list
1 parent 0523b81 commit d285de7

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

src/components/checkbox/useIndeterminate.ts

+4
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export const useIndeterminate = ({
3535
typeof indeterminateFromProps !== 'undefined'
3636
) {
3737
ref.current.checked = indeterminateFromProps;
38+
39+
// fix needs to come from pretty-checkbox
40+
// ref.current.indeterminate = indeterminateFromProps;
41+
3842
setStatus(indeterminateFromProps);
3943
}
4044
}, [indeterminateFromProps, state]);

src/typings/PCRCommonProps.d.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import * as React from 'react';
22

3-
type Colors = 'primary' | 'success' | 'info' | 'warning' | 'danger';
3+
export type Colors = 'primary' | 'success' | 'info' | 'warning' | 'danger';
44
type ColorsOutline = 'primary-o' | 'success-o' | 'info-o' | 'warning-o' | 'danger-o';
55

6-
export type CommonProps<S> = React.InputHTMLAttributes<HTMLInputElement> & {
6+
export type CommonProps<S> = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color'> & {
77
/**
88
* Set true to enable locked mode.
99
*/

src/typings/PCRSwitchProps.d.ts

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
1-
import { CommonProps } from './PCRCommonProps';
1+
import { CommonProps, Colors } from './PCRCommonProps';
22

33
type Shape = 'fill' | 'slim';
44

5-
export type PCRSwitchProps<S = any> = Omit<CommonProps<S>, 'variation' | 'animation'> & {
5+
export type PCRSwitchProps<S = any> = Omit<CommonProps<S>, 'variation' | 'animation' | 'color'> & {
66
/**
77
* The shape of the Switch.
88
*/
99
shape?: Shape;
1010

11+
/**
12+
* Choose a color. Note: solid colors only for switch.
13+
*/
14+
color: Colors;
15+
1116
/**
1217
* Switch has built-in animations. Do not specify
1318
* an animation.

0 commit comments

Comments
 (0)