diff --git a/packages/core/src/components/ModalNew/layouts/ModalSideBySideLayout/ModalSideBySideLayout.module.scss b/packages/core/src/components/ModalNew/layouts/ModalSideBySideLayout/ModalSideBySideLayout.module.scss new file mode 100644 index 0000000000..4b135c6272 --- /dev/null +++ b/packages/core/src/components/ModalNew/layouts/ModalSideBySideLayout/ModalSideBySideLayout.module.scss @@ -0,0 +1,25 @@ +.layout { + width: 100%; + flex-grow: 1; + overflow: hidden; + + .leftPane { + height: 100%; + width: 60%; + padding-inline: var(--modal-inline-padding); + + .header { + width: 100%; + margin-block: var(--spacing-xl) var(--spacing-large); + } + + .content { + width: 100%; + } + } + + .media { + flex-shrink: 0; + width: 40%; + } +} diff --git a/packages/core/src/components/ModalNew/layouts/ModalSideBySideLayout/ModalSideBySideLayout.tsx b/packages/core/src/components/ModalNew/layouts/ModalSideBySideLayout/ModalSideBySideLayout.tsx new file mode 100644 index 0000000000..b36093ec23 --- /dev/null +++ b/packages/core/src/components/ModalNew/layouts/ModalSideBySideLayout/ModalSideBySideLayout.tsx @@ -0,0 +1,32 @@ +import React, { forwardRef } from "react"; +import cx from "classnames"; +import { getTestId } from "../../../../tests/test-ids-utils"; +import { ComponentDefaultTestId } from "../../../../tests/constants"; +import styles from "./ModalSideBySideLayout.module.scss"; +import { ModalSideBySideLayoutProps } from "./ModalSideBySideLayout.types"; +import Flex from "../../../Flex/Flex"; + +const ModalSideBySideLayout = forwardRef( + ( + { children, className, id, "data-testid": dataTestId }: ModalSideBySideLayoutProps, + ref: React.ForwardedRef + ) => { + const [header, content, media] = React.Children.toArray(children); + return ( + + +
{header}
+
{content}
+
+
{media}
+
+ ); + } +); + +export default ModalSideBySideLayout; diff --git a/packages/core/src/components/ModalNew/layouts/ModalSideBySideLayout/ModalSideBySideLayout.types.ts b/packages/core/src/components/ModalNew/layouts/ModalSideBySideLayout/ModalSideBySideLayout.types.ts new file mode 100644 index 0000000000..1534fd491b --- /dev/null +++ b/packages/core/src/components/ModalNew/layouts/ModalSideBySideLayout/ModalSideBySideLayout.types.ts @@ -0,0 +1,6 @@ +import { VibeComponentProps } from "../../../../types"; +import React from "react"; + +export interface ModalSideBySideLayoutProps extends VibeComponentProps { + children: React.ReactNode; +} diff --git a/packages/core/src/tests/constants.ts b/packages/core/src/tests/constants.ts index 83cc5d3bc7..8b667cb506 100644 --- a/packages/core/src/tests/constants.ts +++ b/packages/core/src/tests/constants.ts @@ -107,7 +107,9 @@ export enum ComponentDefaultTestId { MODAL_NEXT_OVERLAY = "modal-overlay", MODAL_NEXT_HEADER = "modal-header", MODAL_NEXT_CONTENT = "modal-content", + MODAL_NEXT_MEDIA = "modal-media", MODAL_NEXT_BASIC_LAYOUT = "modal-basic-layout", + MODAL_NEXT_SIDE_BY_SIDE_LAYOUT = "modal-side_by_side-layout", FORMATTED_NUMBER = "formatted-number", HIDDEN_TEXT = "hidden-text", DIALOG_CONTENT_CONTAINER = "dialog-content-container",