Skip to content

Commit

Permalink
fix: fix code snippets on component docs
Browse files Browse the repository at this point in the history
  • Loading branch information
soykje committed Jun 19, 2023
1 parent 85732c1 commit f2e8163
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 24 deletions.
31 changes: 17 additions & 14 deletions packages/components/form-field/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { FC } from 'react'

import { FormField as Root, FormFieldProps } from './FormField'
import { FormFieldErrorMessage, FormFieldErrorMessageProps } from './FormFieldErrorMessage'
import { FormFieldHelperMessage, FormFieldHelperMessageProps } from './FormFieldHelperMessage'
import { FormFieldLabel, FormFieldLabelProps } from './FormFieldLabel'
import {
FormFieldRequiredIndicator,
FormFieldRequiredIndicatorProps,
} from './FormFieldRequiredIndicator'
import { FormFieldState, FormFieldStateProps } from './FormFieldState'
import { FormField as Root, type FormFieldProps } from './FormField'
import { FormFieldErrorMessage } from './FormFieldErrorMessage'
import { FormFieldHelperMessage } from './FormFieldHelperMessage'
import { FormFieldLabel } from './FormFieldLabel'
import { FormFieldRequiredIndicator } from './FormFieldRequiredIndicator'
import { FormFieldState } from './FormFieldState'

export { type FormFieldProps } from './FormField'
export { type FormFieldErrorMessageProps } from './FormFieldErrorMessage'
Expand All @@ -17,12 +14,18 @@ export { type FormFieldHelperMessageProps } from './FormFieldHelperMessage'
export { type FormFieldLabelProps } from './FormFieldLabel'
export { type FormFieldRequiredIndicatorProps } from './FormFieldRequiredIndicator'

FormFieldLabel.displayName = 'FormField.Label'
FormFieldState.displayName = 'FormField.State'
FormFieldErrorMessage.displayName = 'FormField.ErrorMessage'
FormFieldHelperMessage.displayName = 'FormField.HelperMessage'
FormFieldRequiredIndicator.displayName = 'FormField.RequiredIndicator'

export const FormField: FC<FormFieldProps> & {
Label: FC<FormFieldLabelProps>
State: FC<FormFieldStateProps>
ErrorMessage: FC<FormFieldErrorMessageProps>
HelperMessage: FC<FormFieldHelperMessageProps>
RequiredIndicator: FC<FormFieldRequiredIndicatorProps>
Label: typeof FormFieldLabel
State: typeof FormFieldState
ErrorMessage: typeof FormFieldErrorMessage
HelperMessage: typeof FormFieldHelperMessage
RequiredIndicator: typeof FormFieldRequiredIndicator
} = Object.assign(Root, {
Label: FormFieldLabel,
State: FormFieldState,
Expand Down
2 changes: 2 additions & 0 deletions packages/components/label/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { LabelRequiredIndicator } from './LabelRequiredIndicator'
export type { LabelProps } from './Label'
export type { LabelRequiredIndicatorProps } from './LabelRequiredIndicator'

LabelRequiredIndicator.displayName = 'Label.RequiredIndicator'

export const Label: typeof Root & {
RequiredIndicator: typeof LabelRequiredIndicator
} = Object.assign(Root, {
Expand Down
10 changes: 6 additions & 4 deletions packages/components/radio-group/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { FC } from 'react'
import type { FC } from 'react'

import { Radio, RadioProps } from './Radio'
import { RadioGroup as Root, RadioGroupProps } from './RadioGroup'
import { Radio } from './Radio'
import { RadioGroup as Root, type RadioGroupProps } from './RadioGroup'

export { type RadioGroupProps } from './RadioGroup'
export { type RadioProps } from './Radio'

Radio.displayName = 'RadioGroup.Radio'

export const RadioGroup: FC<RadioGroupProps> & {
Radio: FC<RadioProps>
Radio: typeof Radio
} = Object.assign(Root, {
Radio,
})
16 changes: 10 additions & 6 deletions packages/components/tabs/src/Tabs.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import type { FC } from 'react'

import { TabsContent as Content, type TabsContentProps } from './TabsContent'
import { TabsList as List, type TabsListProps } from './TabsList'
import { TabsContent as Content } from './TabsContent'
import { TabsList as List } from './TabsList'
import { TabsRoot as Root, type TabsRootProps } from './TabsRoot'
import { TabsTrigger as Trigger, type TabsTriggerProps } from './TabsTrigger'
import { TabsTrigger as Trigger } from './TabsTrigger'

List.displayName = 'Tabs.List'
Trigger.displayName = 'Tabs.Trigger'
Content.displayName = 'Tabs.Content'

export const Tabs: FC<TabsRootProps> & {
List: FC<TabsListProps>
Trigger: FC<TabsTriggerProps>
Content: FC<TabsContentProps>
List: typeof List
Trigger: typeof Trigger
Content: typeof Content
} = Object.assign(Root, {
List,
Trigger,
Expand Down

0 comments on commit f2e8163

Please sign in to comment.