@@ -120,56 +120,62 @@ export interface CheckboxProps {
120120 children ?: ReactNode
121121}
122122
123- export interface TippyCustomizedProps extends Pick < TippyProps , 'appendTo' > {
124- theme : TippyTheme
125- visible ?: boolean
126- heading ?: ReactNode | string
127- headingInfo ?: ReactNode | string
128- noHeadingBorder ?: boolean
129- infoTextHeading ?: string
130- hideHeading ?: boolean
131- placement ?: TippyProps [ 'placement' ]
132- className ?: string
133- Icon ?: React . FunctionComponent < React . SVGProps < SVGSVGElement > >
134- iconPath ?: string
135- iconClass ?: string
136- iconSize ?: number // E.g. 16, 20, etc.. Currently, there are around 12 sizes supported. Check `icons.css` or `base.scss` for supported sizes or add new size (class names starts with `icon-dim-`).
137- onImageLoadError ?: ( e ) => void
138- onClose ?: ( ) => void
139- infoText ?: React . ReactNode
140- showCloseButton ?: boolean
141- arrow ?: boolean
142- interactive ?: boolean
143- showOnCreate ?: boolean
144- trigger ?: string
145- animation ?: string
146- duration ?: number
147- additionalContent ?: ReactNode
148- documentationLink ?: keyof typeof DOCUMENTATION
149- documentationLinkText ?: string
150- children : React . ReactElement < any >
151- disableClose ?: boolean
123+ export type TippyWithBaseDocLinkTypes < T extends boolean > = {
124+ isExternalLink ?: T
152125 isEnterprise ?: boolean
153- isExternalLink ?: boolean
154- }
155-
156- export interface InfoIconTippyProps
157- extends Pick <
158- TippyCustomizedProps ,
159- | 'heading'
160- | 'infoText'
161- | 'iconClass'
162- | 'documentationLinkText'
163- | 'additionalContent'
164- | 'placement'
165- | 'Icon'
166- | 'headingInfo'
167- | 'documentationLink'
168- | 'isEnterprise'
169- | 'isExternalLink'
126+ documentationLink : T extends true ? string : keyof typeof DOCUMENTATION
127+ }
128+
129+ export type TippyCustomizedProps < T extends boolean > = Pick < TippyProps , 'appendTo' > &
130+ TippyWithBaseDocLinkTypes < T > & {
131+ theme : TippyTheme
132+ visible ?: boolean
133+ heading ?: ReactNode | string
134+ headingInfo ?: ReactNode | string
135+ noHeadingBorder ?: boolean
136+ infoTextHeading ?: string
137+ hideHeading ?: boolean
138+ placement ?: TippyProps [ 'placement' ]
139+ className ?: string
140+ Icon ?: React . FunctionComponent < React . SVGProps < SVGSVGElement > >
141+ iconPath ?: string
142+ iconClass ?: string
143+ iconSize ?: number // E.g. 16, 20, etc.. Currently, there are around 12 sizes supported. Check `icons.css` or `base.scss` for supported sizes or add new size (class names starts with `icon-dim-`).
144+ onImageLoadError ?: ( e ) => void
145+ onClose ?: ( ) => void
146+ infoText ?: React . ReactNode
147+ showCloseButton ?: boolean
148+ arrow ?: boolean
149+ interactive ?: boolean
150+ showOnCreate ?: boolean
151+ trigger ?: string
152+ animation ?: string
153+ duration ?: number
154+ additionalContent ?: ReactNode
155+ documentationLinkText ?: string
156+ children : React . ReactElement < any >
157+ disableClose ?: boolean
158+ }
159+
160+ export interface InfoIconTippyProps < T extends boolean = false >
161+ extends Partial <
162+ Pick <
163+ TippyCustomizedProps < T > ,
164+ | 'heading'
165+ | 'infoText'
166+ | 'iconClass'
167+ | 'documentationLinkText'
168+ | 'additionalContent'
169+ | 'placement'
170+ | 'Icon'
171+ | 'headingInfo'
172+ | 'documentationLink'
173+ | 'isEnterprise'
174+ | 'isExternalLink'
175+ >
170176 > {
171177 dataTestid ?: string
172- children ?: TippyCustomizedProps [ 'children' ]
178+ children ?: TippyCustomizedProps < T > [ 'children' ]
173179 iconClassName ?: string
174180 buttonPadding ?: string
175181}
0 commit comments