-
Notifications
You must be signed in to change notification settings - Fork 5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* BannerTip to TS * removing actionButtonProps control from storybook file * fixing console errors in storybook * BannerTip docs fixes, prop fixes and test updates --------- Co-authored-by: georgewrmarshall <[email protected]>
- Loading branch information
1 parent
8b93092
commit 9d59ec5
Showing
10 changed files
with
147 additions
and
160 deletions.
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
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
4 changes: 0 additions & 4 deletions
4
ui/components/component-library/banner-tip/banner-tip.constants.ts
This file was deleted.
Oops, something went wrong.
This file was deleted.
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
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,59 @@ | ||
import React from 'react'; | ||
import classnames from 'classnames'; | ||
import { | ||
AlignItems, | ||
BorderColor, | ||
Display, | ||
} from '../../../helpers/constants/design-system'; | ||
import { BannerBase, Box } from '..'; | ||
import { BoxProps, PolymorphicRef } from '../box'; | ||
import { BannerBaseProps } from '../banner-base'; | ||
import { | ||
BannerTipComponent, | ||
BannerTipLogoType, | ||
BannerTipProps, | ||
} from './banner-tip.types'; | ||
|
||
export const BannerTip: BannerTipComponent = React.forwardRef( | ||
<C extends React.ElementType = 'div'>( | ||
{ | ||
children, | ||
className = '', | ||
logoType = BannerTipLogoType.Greeting, | ||
logoWrapperProps, | ||
logoProps, | ||
startAccessory, | ||
...props | ||
}: BannerTipProps<C>, | ||
ref?: PolymorphicRef<C>, | ||
) => ( | ||
<BannerBase | ||
ref={ref} | ||
startAccessory={ | ||
startAccessory || ( | ||
<Box | ||
display={Display.Flex} | ||
alignItems={AlignItems.center} | ||
{...logoWrapperProps} | ||
> | ||
<Box | ||
as="img" | ||
src={`images/fox-${logoType}.png`} | ||
alt={logoType} | ||
{...(logoProps as BoxProps<C>)} | ||
className={classnames( | ||
'mm-banner-tip--logo', | ||
logoProps?.className ?? '', | ||
)} | ||
/> | ||
</Box> | ||
) | ||
} | ||
borderColor={BorderColor.borderDefault} | ||
className={classnames('mm-banner-tip', className)} | ||
{...(props as BannerBaseProps<C>)} | ||
> | ||
{children} | ||
</BannerBase> | ||
), | ||
); |
Oops, something went wrong.