-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(manager-react-components): upgrade ods version 18
ref: MANAGER-14622 Signed-off-by: Alex Boungnaseng <[email protected]>
- Loading branch information
1 parent
3675b01
commit b1f1514
Showing
79 changed files
with
1,251 additions
and
1,638 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
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
54 changes: 24 additions & 30 deletions
54
packages/manager-react-components/src/components/action-banner/action-banner.component.tsx
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 |
---|---|---|
@@ -1,73 +1,67 @@ | ||
import React from 'react'; | ||
import { | ||
OsdsButton, | ||
OsdsLink, | ||
OsdsMessage, | ||
OsdsText, | ||
OdsButton, | ||
OdsLink, | ||
OdsMessage, | ||
OdsText, | ||
} from '@ovhcloud/ods-components/react'; | ||
import { ODS_BUTTON_SIZE, ODS_MESSAGE_TYPE } from '@ovhcloud/ods-components'; | ||
import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core'; | ||
import { | ||
ODS_THEME_COLOR_INTENT, | ||
ODS_THEME_TYPOGRAPHY_SIZE, | ||
} from '@ovhcloud/ods-common-theming'; | ||
ODS_MESSAGE_COLOR, | ||
ODS_MESSAGE_VARIANT, | ||
} from '@ovhcloud/ods-components'; | ||
import { OdsHTMLAnchorElementTarget } from '@ovhcloud/ods-common-core'; | ||
|
||
export type ActionBannerProps = { | ||
message: string; | ||
cta: string; | ||
type?: ODS_MESSAGE_TYPE; | ||
variant?: ODS_MESSAGE_VARIANT; | ||
color?: ODS_MESSAGE_COLOR; | ||
onClick?: () => void; | ||
href?: string; | ||
}; | ||
|
||
export function ActionBanner({ | ||
message, | ||
cta, | ||
type = ODS_MESSAGE_TYPE.info, | ||
color, | ||
onClick, | ||
href, | ||
variant, | ||
}: Readonly<ActionBannerProps>) { | ||
return ( | ||
<OsdsMessage | ||
type={type} | ||
color={(type as unknown) as ODS_THEME_COLOR_INTENT} | ||
<OdsMessage | ||
color={color} | ||
variant={variant} | ||
className={'mt-3 flex-row'} | ||
data-testid="actionBanner-message_container" | ||
> | ||
<div className={'sm:flex sm:flex-row sm:justify-between sm:items-center'}> | ||
<OsdsText | ||
size={ODS_THEME_TYPOGRAPHY_SIZE._400} | ||
color={ODS_THEME_COLOR_INTENT.default} | ||
> | ||
<OdsText> | ||
<span | ||
dangerouslySetInnerHTML={{ | ||
__html: message, | ||
}} | ||
></span> | ||
</OsdsText> | ||
/> | ||
</OdsText> | ||
{onClick && ( | ||
<OsdsButton | ||
<OdsButton | ||
className="sm:mt-0 mt-4 sm:ml-4 ml-0" | ||
data-testid="actionBanner-button" | ||
size={ODS_BUTTON_SIZE.sm} | ||
color={ODS_THEME_COLOR_INTENT.primary} | ||
onClick={onClick} | ||
> | ||
{cta} | ||
</OsdsButton> | ||
label={cta} | ||
/> | ||
)} | ||
{href && ( | ||
<OsdsLink | ||
<OdsLink | ||
className="sm:mt-0 mt-4 sm:ml-4 ml-0" | ||
color={ODS_THEME_COLOR_INTENT.primary} | ||
onClick={() => onClick && onClick()} | ||
href={href} | ||
target={OdsHTMLAnchorElementTarget._blank} | ||
> | ||
{cta} | ||
</OsdsLink> | ||
</OdsLink> | ||
)} | ||
</div> | ||
</OsdsMessage> | ||
</OdsMessage> | ||
); | ||
} |
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
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
Oops, something went wrong.