File tree Expand file tree Collapse file tree 11 files changed +107
-71
lines changed
Expand file tree Collapse file tree 11 files changed +107
-71
lines changed Original file line number Diff line number Diff line change 11import type { Meta , StoryObj } from '@storybook/react-vite'
2- import MessageContainer from './MessageContainer'
2+ import { MessageContainer } from './MessageContainer'
33
44const meta = {
55 title : 'Components/Containers/MessageContainer' ,
Original file line number Diff line number Diff line change @@ -2,17 +2,19 @@ import { cn } from '@/utils'
22import { LoadingContainer } from '../LoadingContainer/LoadingContainer'
33import { HorizontalContainer } from '../HorizontalContainer/HorizontalContainer'
44
5- export default function MessageContainer ( {
6- children,
7- className,
8- wrap = false ,
9- isLoading = false ,
10- } : {
5+ export interface MessageContainerProps {
116 children : React . ReactNode
127 className ?: string
138 wrap ?: boolean
149 isLoading ?: boolean
15- } ) {
10+ }
11+
12+ export function MessageContainer ( {
13+ children,
14+ className,
15+ wrap = false ,
16+ isLoading = false ,
17+ } : MessageContainerProps ) {
1618 return (
1719 < HorizontalContainer
1820 data-component = "MessageContainer"
Original file line number Diff line number Diff line change @@ -8,12 +8,19 @@ import {
88import React from 'react'
99
1010import { cn } from '@/utils'
11- import type { Position } from '@/types'
1211
1312import './Tooltip.css'
1413
15- export type TooltipSide = Extract < Position , 'top' | 'bottom' | 'left' | 'right' >
16- export type TooltipAlign = Extract < Position , 'center' | 'start' | 'end' >
14+ export interface TooltipProps {
15+ trigger : React . ReactNode
16+ children : React . ReactNode
17+ side ?: 'top' | 'bottom' | 'left' | 'right'
18+ align ?: 'center' | 'start' | 'end'
19+ delayDuration ?: number
20+ sideOffset ?: number
21+ alignOffset ?: number
22+ className ?: string
23+ }
1724
1825export function Tooltip ( {
1926 delayDuration = 200 ,
@@ -24,16 +31,7 @@ export function Tooltip({
2431 trigger,
2532 children,
2633 className,
27- } : {
28- trigger : React . ReactNode
29- children : React . ReactNode
30- side ?: TooltipSide
31- align ?: TooltipAlign
32- delayDuration ?: number
33- sideOffset ?: number
34- alignOffset ?: number
35- className ?: string
36- } ) {
34+ } : TooltipProps ) {
3735 return (
3836 < TooltipProvider delayDuration = { delayDuration } >
3937 < TooltipRoot >
Original file line number Diff line number Diff line change 11import { cn } from '@/utils'
22import React from 'react'
33
4+ export interface DescriptionProps {
5+ children ?: React . ReactNode
6+ className ?: string
7+ }
8+
49export function Description ( {
510 children,
611 className,
712 ...props
8- } : {
9- children ?: React . ReactNode
10- className ?: string
11- } ) {
13+ } : DescriptionProps ) {
1214 return (
1315 < div
1416 data-component = "Description"
Original file line number Diff line number Diff line change @@ -3,16 +3,18 @@ import { getHeadlineTextSize } from './help'
33import type { HeadlineLevel } from '@/types'
44import { cn } from '@/utils'
55
6+ export interface HeadlineProps {
7+ level : HeadlineLevel
8+ children : React . ReactNode
9+ className ?: string
10+ }
11+
612export function Headline ( {
713 level = 1 ,
814 children,
915 className,
1016 ...props
11- } : {
12- level : HeadlineLevel
13- children : React . ReactNode
14- className ?: string
15- } ) {
17+ } : HeadlineProps ) {
1618 const Tag = `h${ level } ` as keyof JSX . IntrinsicElements
1719
1820 return (
Original file line number Diff line number Diff line change @@ -6,6 +6,18 @@ import { getTextSize } from './help'
66import type { Size } from '@/types'
77import { Tooltip } from '../Tooltip/Tooltip'
88
9+ export interface InformationProps {
10+ children ?: React . ReactNode
11+ className ?: string
12+ classNameTooltip ?: string
13+ side ?: 'right' | 'left'
14+ size ?: Size
15+ sideOffset ?: number
16+ delayDuration ?: number
17+ info ?: React . ReactNode
18+ infoIcon ?: React . ReactNode
19+ }
20+
921export function Information ( {
1022 children,
1123 className,
@@ -22,17 +34,7 @@ export function Information({
2234 />
2335 ) ,
2436 ...props
25- } : {
26- children ?: React . ReactNode
27- className ?: string
28- classNameTooltip ?: string
29- side ?: 'right' | 'left'
30- size ?: Size
31- sideOffset ?: number
32- delayDuration ?: number
33- info ?: React . ReactNode
34- infoIcon ?: React . ReactNode
35- } ) {
37+ } : InformationProps ) {
3638 return (
3739 < div
3840 data-component = "Information"
Original file line number Diff line number Diff line change 11import { cn } from '@/utils'
22
3- export function Tagline ( {
4- className,
5- children,
6- ...props
7- } : {
3+ export interface TaglineProps {
84 className ?: string
95 children ?: React . ReactNode
10- } ) {
6+ }
7+
8+ export function Tagline ( { className, children, ...props } : TaglineProps ) {
119 return (
1210 < div
1311 data-component = "Tagline"
Original file line number Diff line number Diff line change 11import { cn } from '@/utils'
22
3- export function Text ( {
4- className,
5- children,
6- ...props
7- } : {
3+ export interface TextProps {
84 className ?: string
95 children ?: React . ReactNode
10- } ) {
6+ }
7+
8+ export function Text ( { className, children, ...props } : TextProps ) {
119 return (
1210 < div
1311 data-component = "Text"
Original file line number Diff line number Diff line change @@ -5,9 +5,19 @@ import { VerticalContainer } from '../VerticalContainer/VerticalContainer'
55import { HorizontalContainer } from '../HorizontalContainer/HorizontalContainer'
66import { Badge } from '../Badge/Badge'
77import { cn } from '@/utils'
8- import MessageContainer from '../MessageContainer/MessageContainer'
8+ import { MessageContainer } from '../MessageContainer/MessageContainer'
99import { Input } from '../Input/Input'
1010
11+ export interface FilterableListProps < TItem > {
12+ items : TItem [ ]
13+ filterOptions ?: IFuseOptions < TItem >
14+ disabled ?: boolean
15+ placeholder ?: string
16+ autoFocus ?: boolean
17+ className ?: string
18+ children : ( options : TItem [ ] , resetSearch : ( ) => void ) => React . ReactNode
19+ }
20+
1121export function FilterableList < TItem > ( {
1222 items,
1323 disabled,
@@ -16,15 +26,7 @@ export function FilterableList<TItem>({
1626 filterOptions,
1727 className,
1828 children,
19- } : {
20- items : TItem [ ]
21- filterOptions ?: IFuseOptions < TItem >
22- disabled ?: boolean
23- placeholder ?: string
24- autoFocus ?: boolean
25- className ?: string
26- children : ( options : TItem [ ] , resetSearch : ( ) => void ) => React . ReactNode
27- } ) {
29+ } : FilterableListProps < TItem > ) {
2830 const [ search , setSearch ] = React . useState ( '' )
2931
3032 const fuse = new Fuse ( items , filterOptions )
Original file line number Diff line number Diff line change @@ -6,19 +6,21 @@ import { Button } from '../Button/Button'
66import { ScrollContainer } from '../ScrollContainer/ScrollContainer'
77import { VerticalContainer } from '../VerticalContainer/VerticalContainer'
88
9+ export interface VirtualListProps < TItem > {
10+ items : TItem [ ]
11+ estimatedListItemHeight : number
12+ renderListItem : ( item : TItem ) => React . ReactNode
13+ isSelected ?: ( item : TItem ) => boolean
14+ className ?: string
15+ }
16+
917export function VirtualList < TItem > ( {
1018 items,
1119 estimatedListItemHeight,
1220 renderListItem,
1321 isSelected,
1422 className,
15- } : {
16- items : TItem [ ]
17- estimatedListItemHeight : number
18- renderListItem : ( item : TItem ) => React . ReactNode
19- isSelected ?: ( item : TItem ) => boolean
20- className ?: string
21- } ) {
23+ } : VirtualListProps < TItem > ) {
2224 const scrollableAreaRef = React . useRef < HTMLDivElement > ( null )
2325
2426 const [ activeItemIndex ] = React . useMemo ( ( ) => {
You can’t perform that action at this time.
0 commit comments