Skip to content

Commit

Permalink
Merge branch 'main' into feature/428-CheckboxGroupStorybook
Browse files Browse the repository at this point in the history
  • Loading branch information
TimRoe authored Oct 2, 2024
2 parents 3fee8c3 + 21478cd commit e65a646
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import React, { FC, Fragment } from 'react'
import { Checkbox } from '../Checkbox/Checkbox'
import { ComponentWrapper } from '../../wrapper'
import { Error, Header, Hint } from '../shared/FormText'
import { FormElementProps } from '../../types/forms'
import { FormElementProps, TextWithA11y } from '../../types'
import { Spacer } from '../Spacer/Spacer'
import { TextWithA11y } from '../../types'
import { useTheme } from '../../utils'

type TextWithA11yAndValue = TextWithA11y & {
Expand Down
10 changes: 4 additions & 6 deletions packages/components/src/components/shared/FormText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@ import { useTranslation } from 'react-i18next'
import React, { FC } from 'react'

import { StringOrTextWithA11y } from '../../types/common'
import { getA11yLabel, getDisplayText } from '../../utils'
import { useTheme } from '../../utils'
import { getA11yLabel, getDisplayText, useTheme } from '../../utils'

type FormTextProps = {
/** String to display or TextWithA11y object with string and a11y label */
Expand Down Expand Up @@ -45,15 +44,14 @@ const fontDescription = {
fontSize: 16,
lineHeight: 22,
}

/**
* Header text element commonly used in form components
*/
export type HeaderProps = FormTextProps & {
/** True to display (*Required) label next to header */
required?: boolean
}

/**
* Header text element commonly used in form components
*/
export const Header: FC<HeaderProps> = ({ text, required }) => {
const theme = useTheme()
const { t } = useTranslation()
Expand Down

0 comments on commit e65a646

Please sign in to comment.