Skip to content

Commit

Permalink
fix(:label:) fixing type annotations
Browse files Browse the repository at this point in the history
react-docgen-typescript was removing color from the prop list
  • Loading branch information
atomicpages committed Sep 9, 2020
1 parent 0523b81 commit d285de7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/components/checkbox/useIndeterminate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@ export const useIndeterminate = ({
typeof indeterminateFromProps !== 'undefined'
) {
ref.current.checked = indeterminateFromProps;

// fix needs to come from pretty-checkbox
// ref.current.indeterminate = indeterminateFromProps;

setStatus(indeterminateFromProps);
}
}, [indeterminateFromProps, state]);
Expand Down
4 changes: 2 additions & 2 deletions src/typings/PCRCommonProps.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as React from 'react';

type Colors = 'primary' | 'success' | 'info' | 'warning' | 'danger';
export type Colors = 'primary' | 'success' | 'info' | 'warning' | 'danger';
type ColorsOutline = 'primary-o' | 'success-o' | 'info-o' | 'warning-o' | 'danger-o';

export type CommonProps<S> = React.InputHTMLAttributes<HTMLInputElement> & {
export type CommonProps<S> = Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color'> & {
/**
* Set true to enable locked mode.
*/
Expand Down
9 changes: 7 additions & 2 deletions src/typings/PCRSwitchProps.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
import { CommonProps } from './PCRCommonProps';
import { CommonProps, Colors } from './PCRCommonProps';

type Shape = 'fill' | 'slim';

export type PCRSwitchProps<S = any> = Omit<CommonProps<S>, 'variation' | 'animation'> & {
export type PCRSwitchProps<S = any> = Omit<CommonProps<S>, 'variation' | 'animation' | 'color'> & {
/**
* The shape of the Switch.
*/
shape?: Shape;

/**
* Choose a color. Note: solid colors only for switch.
*/
color: Colors;

/**
* Switch has built-in animations. Do not specify
* an animation.
Expand Down

0 comments on commit d285de7

Please sign in to comment.