diff --git a/playbook/app/pb_kits/playbook/pb_toggle/_toggle.jsx b/playbook/app/pb_kits/playbook/pb_toggle/_toggle.tsx similarity index 61% rename from playbook/app/pb_kits/playbook/pb_toggle/_toggle.jsx rename to playbook/app/pb_kits/playbook/pb_toggle/_toggle.tsx index d2a7626c86..b6040d7fc8 100644 --- a/playbook/app/pb_kits/playbook/pb_toggle/_toggle.jsx +++ b/playbook/app/pb_kits/playbook/pb_toggle/_toggle.tsx @@ -1,5 +1,3 @@ -// @flow - import React from 'react' import classnames from 'classnames' import type { InputCallback } from '../types' @@ -10,20 +8,20 @@ import { buildDataProps, } from '../utilities/props' -import { globalProps } from '../utilities/globalProps' +import { GlobalProps, globalProps } from '../utilities/globalProps' type Props = { - aria?: object, + aria?: { [key: string]: string }, checked?: boolean, - children?: React.Node, + children?: React.ReactNode | React.ReactNode[], className?: string, - data?: object, + data?: { [key: string]: string }, id?: string, name?: string, onChange?: InputCallback, size?: "sm" | "md", value?: string, -} +} & GlobalProps const Toggle = ({ aria = {}, @@ -33,7 +31,7 @@ const Toggle = ({ data = {}, id, name, - onChange = () => {}, + onChange = () => { }, size = 'sm', value, ...props @@ -51,24 +49,24 @@ const Toggle = ({ return (