diff --git a/types/wix-style-react/Button.d.ts b/types/wix-style-react/Button.d.ts new file mode 100644 index 0000000000..62b68e44e8 --- /dev/null +++ b/types/wix-style-react/Button.d.ts @@ -0,0 +1,31 @@ +import * as React from 'react'; + +export interface ButtonProps { + as?: any; + className?: string; + skin?: ButtonSkin; + priority?: ButtonPriority; + size?: ButtonSize; + onClick?: React.MouseEventHandler; + fullWidth?: boolean; + suffixIcon?: React.ReactElement; + prefixIcon?: React.ReactElement; + disabled?: boolean; + dataHook?: string; +} + +export default class Button extends React.Component {} + +export type ButtonSkin = + | 'standard' + | 'inverted' + | 'destructive' + | 'premium' + | 'dark' + | 'light' + | 'transparent' + | 'premium-light'; + +export type ButtonPriority = 'primary' | 'secondary'; + +export type ButtonSize = 'tiny' | 'small' | 'medium' | 'large'; diff --git a/types/wix-style-react/Text.d.ts b/types/wix-style-react/Text.d.ts new file mode 100644 index 0000000000..b0e0a2a2fd --- /dev/null +++ b/types/wix-style-react/Text.d.ts @@ -0,0 +1,27 @@ +import * as React from 'react'; + +export interface TextProps { + showTooltip?: boolean; + ellipsed?: boolean; + tagName?: string; + className?: string; + size?: TextSize; + secondary?: boolean; + skin?: TextSkin; + light?: boolean; + weight?: TextWeight; +} + +declare const Text: React.SFC; +export default Text; + +export type TextSize = 'tiny' | 'small' | 'medium'; + +export type TextSkin = + | 'standard' + | 'error' + | 'success' + | 'premium' + | 'disabled'; + +export type TextWeight = 'thin' | 'normal' | 'bold'; diff --git a/types/wix-style-react/index.d.ts b/types/wix-style-react/index.d.ts new file mode 100644 index 0000000000..727b11a3bc --- /dev/null +++ b/types/wix-style-react/index.d.ts @@ -0,0 +1,8 @@ +// Type definitions for wix-style-react 6.17 +// Project: https://github.com/wix/wix-style-react +// Definitions by: Gilad Segal +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped`; +// TypeScript Version: 3.5 + +export { default as Button, ButtonProps } from './Button'; +export { default as Text, TextProps } from './Text'; diff --git a/types/wix-style-react/test/Button-tests.tsx b/types/wix-style-react/test/Button-tests.tsx new file mode 100644 index 0000000000..3a961a6d7d --- /dev/null +++ b/types/wix-style-react/test/Button-tests.tsx @@ -0,0 +1,24 @@ +import * as React from 'react'; +import Button from 'wix-style-react/Button'; + +function ButtonWithMandatoryProps() { + return