-
Notifications
You must be signed in to change notification settings - Fork 73
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BD-46] feat: defined types for Paragon exports #2177
Closed
PKulkoRaccoonGang
wants to merge
16
commits into
openedx:master
from
raccoongang:Peter_Kulko/define-types-for-Paragon-exports
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
111f3b7
feat: defined types for Paragon exports
PKulkoRaccoonGang fc96cea
feat: writing type definition for components
PKulkoRaccoonGang 171cee4
feat: added file d.ts for Search Field, Pagination, Menu, ProductTour…
PKulkoRaccoonGang 4b5b29f
refactor: code refactoring
PKulkoRaccoonGang 2c91f4c
feat: added Form types
PKulkoRaccoonGang cc5887b
feat: created file d.ts for Form and DataTable components
PKulkoRaccoonGang 418baf9
feat: added types for Dropzone and hooks
PKulkoRaccoonGang ac0bb51
refactor: code refactoring
PKulkoRaccoonGang c033eaa
feat: more declaration file for components
b3d7d05
refactor: refactoring
PKulkoRaccoonGang 91cd820
fix: PR comment update
ba2a10a
refactor: after review
PKulkoRaccoonGang b0102a6
fix: remove .d.ts where .tsx file is present
15d08f6
fix: fix lint and types
72069f0
fix: change to ComponentType
9797403
fix: update package-lock.json
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ dependent-usage-analyzer/ | |
build-scss.js | ||
component-generator/ | ||
example/ | ||
*.d.ts |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
import BaseAlert, { AlertProps } from 'react-bootstrap/Alert'; | ||
|
||
declare const ALERT_CLOSE_LABEL_TEXT: string; | ||
export interface BaseAlertProps extends AlertProps { | ||
PKulkoRaccoonGang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
icon?: React.ReactElement, | ||
actions?: Array<React.ReactElement>, | ||
dismissible?: boolean, | ||
onClose?: () => void, | ||
closeLabel?: React.ReactElement, | ||
stacked?: boolean, | ||
} | ||
declare const Alert: React.ForwardRefExoticComponent<BaseAlertProps> & { | ||
Link: typeof BaseAlert.Link; | ||
Heading: typeof BaseAlert.Heading; | ||
}; | ||
export { ALERT_CLOSE_LABEL_TEXT }; | ||
export default Alert; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react'; | ||
|
||
export interface AnnotationProps { | ||
className?: string, | ||
variant?: 'error' | 'success' | 'warning' | 'light' | 'dark', | ||
children?: React.ReactNode, | ||
arrowPlacement?: 'top' | 'right' | 'bottom' | 'left', | ||
} | ||
declare const Annotation: React.ForwardRefExoticComponent<AnnotationProps>; | ||
PKulkoRaccoonGang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
export default Annotation; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
|
||
export interface AvatarProps { | ||
alt?: string, | ||
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl' | 'xxl' | 'huge', | ||
src?: string, | ||
} | ||
declare const Avatar: React.FC<AvatarProps>; | ||
export default Avatar; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
|
||
export interface AvatarButtonProps { | ||
alt?: string, | ||
size?: 'xs' | 'sm' | 'md', | ||
src?: string, | ||
} | ||
declare const AvatarButton: React.FC<AvatarButtonProps>; | ||
export default AvatarButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
import { BadgeProps } from 'react-bootstrap/Badge'; | ||
|
||
interface IBadge extends BadgeProps { | ||
children?: React.ReactNode, | ||
} | ||
|
||
declare const Badge: React.ForwardRefExoticComponent<IBadge>; | ||
export default Badge; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import React from 'react'; | ||
|
||
export interface BreadcrumbProps { | ||
links: Array<{ | ||
label: string, | ||
href?: string, | ||
className?: string, | ||
}>, | ||
PKulkoRaccoonGang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
activeLabel?: string, | ||
spacer?: React.ReactElement, | ||
clickHandler?: Function, | ||
PKulkoRaccoonGang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
variant?: 'light' | 'dark', | ||
isMobile?: boolean, | ||
ariaLabel?: string, | ||
linkAs?: React.ElementType, | ||
} | ||
declare const Breadcrumb: React.FC<BreadcrumbProps>; | ||
export default Breadcrumb; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import { ButtonProps } from 'react-bootstrap/Button'; | ||
import { ButtonGroupProps, ButtonToolbarProps } from "react-bootstrap"; | ||
PKulkoRaccoonGang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
import { BsPrefixRefForwardingComponent } from "react-bootstrap/helpers"; | ||
|
||
export interface BaseButtonProps extends ButtonProps { | ||
PKulkoRaccoonGang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
iconBefore?: React.ReactElement, | ||
iconAfter?: React.ReactElement, | ||
} | ||
|
||
declare type Button = BsPrefixRefForwardingComponent<'button', BaseButtonProps>; | ||
declare type ButtonGroup = BsPrefixRefForwardingComponent<'div', ButtonGroupProps>; | ||
declare type ButtonToolbar = BsPrefixRefForwardingComponent<'div', ButtonToolbarProps>; | ||
|
||
declare const Button: Button; | ||
declare const ButtonGroup: ButtonGroup; | ||
declare const ButtonToolbar: ButtonToolbar; | ||
export { ButtonGroup, ButtonToolbar }; | ||
export default Button; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
|
||
export interface CardBodyProps { | ||
className?: string, | ||
children?: React.ReactNode, | ||
} | ||
declare const CardBody: React.ForwardRefExoticComponent<CardBodyProps>; | ||
export default CardBody; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import React from 'react'; | ||
|
||
export interface CardCarouselProps { | ||
ariaLabel: string, | ||
children: React.ReactNode, | ||
title?: React.ReactNode, | ||
subtitle?: React.ReactNode, | ||
columnSizes?: { | ||
xs?: number, | ||
sm?: number, | ||
md?: number, | ||
lg?: number, | ||
xl?: number, | ||
}, | ||
hasInteractiveChildren?: boolean, | ||
canScrollHorizontal?: boolean, | ||
disableOpacityMasks?: boolean, | ||
onScrollPrevious?: Function, | ||
onScrollNext?: Function, | ||
PKulkoRaccoonGang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
CardCarouselControls?: React.ElementType, | ||
} | ||
declare const CardCarousel: React.ForwardRefExoticComponent<CardCarouselProps>; | ||
export default CardCarousel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import React from 'react'; | ||
|
||
declare const CardCarouselControls: React.FC; | ||
export default CardCarouselControls; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import React from 'react'; | ||
|
||
export interface CardCarouselHeaderProps { | ||
title?: React.ReactNode, | ||
subtitle?: React.ReactNode, | ||
} | ||
declare const CardCarouselHeader: React.FC<CardCarouselHeaderProps>; | ||
export default CardCarouselHeader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
export interface CardCarouselItemsProps { | ||
children: React.ReactNode, | ||
} | ||
declare const CardCarouselItems: React.FC<CardCarouselItemsProps>; | ||
export default CardCarouselItems; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
|
||
export interface CardCarouselProviderProps { | ||
columnSizes?: { | ||
xs?: number, | ||
sm?: number, | ||
md?: number, | ||
lg?: number, | ||
xl?: number, | ||
}, | ||
hasInteractiveChildren?: boolean, | ||
canScrollHorizontal?: boolean, | ||
CardCarouselControls?: React.ElementType, | ||
children: React.ReactNode, | ||
} | ||
declare const CardCarouselProvider: React.FC<CardCarouselProviderProps>; | ||
declare const CardCarouselContext: React.Context<{}>; | ||
export { CardCarouselContext }; | ||
export default CardCarouselProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from "react"; | ||
|
||
export interface CardCarouselSubtitleProps { | ||
as?: React.ElementType | string | ||
className?: string, | ||
children: React.ReactNode, | ||
} | ||
declare const CardCarouselSubtitle: React.FC<CardCarouselSubtitleProps>; | ||
export default CardCarouselSubtitle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import React from 'react'; | ||
|
||
export interface CardCarouselTitleProps { | ||
as?: React.ElementType | string | ||
className?: string, | ||
children: React.ReactNode, | ||
} | ||
declare const CardCarouselTitle: React.FC<CardCarouselTitleProps>; | ||
export default CardCarouselTitle; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import CardCarousel from "./CardCarousel"; | ||
|
||
export default CardCarousel; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import React from 'react'; | ||
|
||
export interface CardContextProviderProps { | ||
orientation?: 'horizontal' | 'vertical', | ||
isLoading?: boolean, | ||
variant?: 'light' | 'dark' | 'muted', | ||
children?: React.ReactNode, | ||
} | ||
declare const CardContextProvider: React.FC<CardContextProviderProps>; | ||
declare const CardContext: React.Context<{}>; | ||
export { CardContextProvider }; | ||
export default CardContext; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
|
||
export declare const CARD_DECK_ITEM_CLASS_NAME = 'pgn__card-deck-card-item'; | ||
export interface CardDeckProps { | ||
columnSizes?: { | ||
xs?: number, | ||
sm?: number, | ||
md?: number, | ||
lg?: number, | ||
xl?: number, | ||
}, | ||
PKulkoRaccoonGang marked this conversation as resolved.
Show resolved
Hide resolved
|
||
hasInteractiveChildren?: boolean, | ||
canScrollHorizontal?: boolean, | ||
hasOverflowScrollItems?: boolean, | ||
className?: string, | ||
children: React.ReactNode, | ||
} | ||
declare const CardDeck: React.ForwardRefExoticComponent<CardDeckProps>; | ||
export default CardDeck; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import React from 'react'; | ||
|
||
export interface CardDividerProps { | ||
className?: string, | ||
} | ||
declare const CardDivider: React.ForwardRefExoticComponent<CardDividerProps>; | ||
export default CardDivider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
|
||
export interface CardFooterProps { | ||
isStacked?: boolean, | ||
textElement?: React.ReactNode, | ||
skeletonHeight?: number, | ||
skeletonWidth?: number, | ||
orientation?: 'horizontal' | 'vertical', | ||
className?: string, | ||
children?: React.ReactNode, | ||
} | ||
declare const CardFooter: React.ForwardRefExoticComponent<CardFooterProps>; | ||
export default CardFooter; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React from 'react'; | ||
|
||
export interface CardGridProps { | ||
className?: string, | ||
children?: React.ReactNode, | ||
columnSizes?: { | ||
xs?: number, | ||
sm?: number, | ||
md?: number, | ||
lg?: number, | ||
xl?: number, | ||
}, | ||
} | ||
declare const CardGrid: React.FC<CardGridProps>; | ||
export default CardGrid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
|
||
export interface CardHeaderProps { | ||
actions?: React.ReactNode, | ||
size?: 'sm' | 'md', | ||
subtitle?: React.ReactNode, | ||
title?: React.ReactNode, | ||
skeletonHeight?: number, | ||
skeletonWidth?: number, | ||
className?: string, | ||
} | ||
declare const CardHeader: React.ForwardRefExoticComponent<CardHeaderProps>; | ||
export default CardHeader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
|
||
export interface CardImageCapProps { | ||
src?: string, | ||
fallbackSrc?: string, | ||
srcAlt?: string, | ||
logoSrc?: string, | ||
fallbackLogoSrc?: string, | ||
logoAlt?: string, | ||
skeletonHeight?: number, | ||
skeletonWidth?: number, | ||
logoSkeleton?: boolean, | ||
logoSkeletonHeight?: number, | ||
logoSkeletonWidth?: number, | ||
className?: string, | ||
children?: React.ReactNode, | ||
} | ||
declare const CardImageCap: React.ForwardRefExoticComponent<CardImageCapProps>; | ||
export default CardImageCap; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import React from 'react'; | ||
|
||
export interface CardSectionProps { | ||
title?: React.ReactNode, | ||
actions?: React.ReactNode, | ||
muted?: boolean, | ||
skeletonHeight?: number, | ||
skeletonWidth?: number, | ||
className?: string, | ||
children?: React.ReactNode, | ||
} | ||
declare const CardSection: React.ForwardRefExoticComponent<CardSectionProps>; | ||
export default CardSection; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
|
||
export interface CardStatusProps { | ||
variant?: 'success' | 'primary' | 'warning' | 'danger', | ||
icon?: React.ReactElement, | ||
title?: React.ReactNode, | ||
className?: string, | ||
children?: React.ReactNode, | ||
} | ||
declare const CardStatus: React.ForwardRefExoticComponent<CardStatusProps>; | ||
export default CardStatus; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[clarification] Can you expand on why the
ActionRowProps
interface is defined in both thisindex.tsx
file and theindex.d.ts
file?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
.d.ts
forActionRow
since it has.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@monteri [clarification] So, the introduction of the
.d.ts
files are only necessary if the component is not already written in.tsx
? I imagine we would eventually intend to migrate our other components'.jsx
files to.tsx
files. If we do that, what would happen to the.d.ts
files? Would they remain, or get moved into the migrated.tsx
files?I guess I'm just wondering about consistency around where we define types across components (i.e., always included in the
.d.ts
, always included in the.tsx
, or similar).