Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

feat(Text): add prop interfaces #154

Merged
merged 4 commits into from
Aug 31, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
22 changes: 21 additions & 1 deletion src/components/Text/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,30 @@ import * as React from 'react'

import { childrenExist, customPropTypes, UIComponent } from '../../lib'

import { Extendable } from '../../../types/utils'
import { ComponentVariablesInput, IComponentPartStylesInput } from '../../../types/theme'

export interface ITextProps {
as: any
atMention: boolean
className: string
content: any
disabled: boolean
error: boolean
important: boolean
size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2x' | '3x' | '4x'
weight: 'light' | 'semilight' | 'regular' | 'semibold' | 'bold'
success: boolean
timestamp: boolean
truncated: boolean
styles: IComponentPartStylesInput
variables: ComponentVariablesInput
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kuzhelov shouldn't all these be optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, exactly - updating..

}

/**
* A component containing text
*/
class Text extends UIComponent<any, any> {
class Text extends UIComponent<Extendable<ITextProps>, any> {
static className = 'ui-text'

static displayName = 'Text'
Expand Down
3 changes: 2 additions & 1 deletion src/themes/teams/components/Text/textStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { Sizes, Weights } from '../../../../lib/enums'
import { ICSSInJSStyle } from '../../../../../types/theme'
import { truncateStyle } from '../../../../styles/customCSS'
import { ITextVariables } from './textVariables'
import { ITextProps } from '../../../../components/Text/Text'

export interface TextStylesParams {
props: any
props: ITextProps
variables: ITextVariables
}

Expand Down