Skip to content

Commit

Permalink
fix: add types for divier and field
Browse files Browse the repository at this point in the history
  • Loading branch information
Birkbjo committed Sep 6, 2023
1 parent b1b35d4 commit 73b2ab3
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 0 deletions.
10 changes: 10 additions & 0 deletions components/divider/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as React from 'react'

export interface DividerProps {
className?: string
dataTest?: string
dense?: boolean
margin?: string
}

export const Divider: React.FC<DividerProps>
97 changes: 97 additions & 0 deletions components/field/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
import * as React from 'react'

export interface FieldProps {
children?: React.ReactNode
className?: string
dataTest?: string
/**
* Disabled status, shown when mouse is over label
*/
disabled?: boolean
/**
* Field status. Mutually exclusive with `valid` and `warning` props
*/
error?: boolean
/**
* Useful text within the field
*/
helpText?: string
/**
* Label at the top of the field
*/
label?: string
/**
* `name` will become the target of the `for`/`htmlFor` attribute on the `<label>` element
*/
name?: string
/**
* Inidcates this field is required
*/
required?: boolean
/**
* Field status. Mutually exclusive with `error` and `warning` props
*/
valid?: boolean
/**
* Feedback given related to validation status of field
*/
validationText?: string
/**
* Field status. Mutually exclusive with `valid` and `error` props
*/
warning?: boolean
}

export const Field: React.FC<FieldProps>

export interface FieldGroupProps {
children?: React.ReactNode
className?: string
dataTest?: string
/**
* Disables the form controls within
*/
disabled?: boolean
/**
* Applies 'error' styling to validation text for feedback. Mutually exclusive with `warning` and `valid` props
*/
error?: boolean
/**
* Useful instructions for the user
*/
helpText?: string
/**
* Labels the Field Group
*/
label?: string
/**
* Name associate with the Field Group. Passed in object as argument to event handlers
*/
name?: string
/**
* Adds an asterisk to indicate this field is required
*/
required?: boolean
/**
* Applies 'valid' styling to validation text for feedback. Mutually exclusive with `warning` and `error` props
*/
valid?: boolean
/**
* Adds text at the bottom of the field to provide validation feedback. Acquires styles from `valid`, `warning` and `error` statuses
*/
validationText?: string
/**
* Applies 'warning' styling to validation text for feedback. Mutually exclusive with `valid` and `error` props
*/
warning?: boolean
}

export const FieldGroup: React.FC<FieldGroupProps>

export interface FieldSetProps {
children?: React.ReactNode
className?: string
dataTest?: string
}

export const FieldSet: React.FC<FieldSetProps>

0 comments on commit 73b2ab3

Please sign in to comment.