- Lorem ipsum dolor sit amet consectetur adipisicing elit. Nobis nam minima non modi consequuntur corporis est
- itaque, exercitationem amet, fugiat optio, facilis repellendus inventore vero perferendis. Possimus porro eaque
- facere.
-
-
-
-
Grid content
-
- Lorem ipsum dolor sit amet consectetur adipisicing elit. Nobis nam minima non modi consequuntur corporis est
- itaque, exercitationem amet, fugiat optio, facilis repellendus inventore vero perferendis. Possimus porro eaque
- facere.
-
-
-
-);
diff --git a/packages/components/src/Grid/Grid.style.tsx b/packages/components/src/Grid/Grid.style.tsx
deleted file mode 100644
index b4775fb27..000000000
--- a/packages/components/src/Grid/Grid.style.tsx
+++ /dev/null
@@ -1,12 +0,0 @@
-import styled from 'styled-components';
-import { theme } from '@interlay/theme';
-
-export const GridContainer = styled.div`
- display: grid;
- gap: ${theme.spacing.spacing5};
- grid-template-columns: repeat(4, 1fr);
-
- @media screen and (min-width: 48em) {
- grid-template-columns: repeat(12, 1fr);
- }
-`;
diff --git a/packages/components/src/Grid/Grid.tsx b/packages/components/src/Grid/Grid.tsx
deleted file mode 100644
index c3ab5371e..000000000
--- a/packages/components/src/Grid/Grid.tsx
+++ /dev/null
@@ -1,13 +0,0 @@
-import { GridContainer } from './Grid.style';
-
-interface GridProps {
- children: React.ReactNode;
- className?: string;
-}
-
-const Grid = ({ className, children }: GridProps): JSX.Element => (
- {children}
-);
-
-export { Grid };
-export type { GridProps };
diff --git a/packages/components/src/Grid/GridItem.style.tsx b/packages/components/src/Grid/GridItem.style.tsx
deleted file mode 100644
index 44e438bf5..000000000
--- a/packages/components/src/Grid/GridItem.style.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import styled from 'styled-components';
-
-import { GridItemProps } from './GridItem';
-
-export const GridItemContainer = styled.div`
- grid-column: ${(props) =>
- props.mobile.start ? `${props.mobile.start} / span ${props.mobile.span}` : `span ${props.mobile.span}`};
- grid-row: ${(props) => props.mobile.row || 'auto'};
- justify-self: ${(props) => props.mobile.justify || 'auto'};
-
- @media (min-width: 48em) {
- grid-column: ${(props) =>
- props.desktop.start ? `${props.desktop.start} / span ${props.desktop.span}` : `span ${props.desktop.span}`};
- grid-row: ${(props) => props.desktop.row || 'auto'};
- justify-self: ${(props) => props.desktop.justify || 'auto'};
- }
-`;
diff --git a/packages/components/src/Grid/GridItem.tsx b/packages/components/src/Grid/GridItem.tsx
deleted file mode 100644
index 3ecdfe568..000000000
--- a/packages/components/src/Grid/GridItem.tsx
+++ /dev/null
@@ -1,30 +0,0 @@
-import { GridItemContainer } from './GridItem.style';
-
-type Justify = 'start' | 'center' | 'end';
-
-type GridColumnsWide = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
-type GridColumnsNarrow = 1 | 2 | 3 | 4;
-
-interface GridItemProps extends React.HTMLAttributes {
- mobile: {
- span: GridColumnsNarrow;
- start?: GridColumnsNarrow;
- row?: number;
- justify?: Justify;
- };
- desktop: {
- span: GridColumnsWide;
- start?: GridColumnsWide;
- row?: number;
- justify?: Justify;
- };
-}
-
-const GridItem = ({ mobile, desktop, className, children }: GridItemProps): JSX.Element => (
-
- {children}
-
-);
-
-export { GridItem };
-export type { GridItemProps };
diff --git a/packages/components/src/Grid/__tests__/Grid.test.tsx b/packages/components/src/Grid/__tests__/Grid.test.tsx
deleted file mode 100644
index ae83a76f5..000000000
--- a/packages/components/src/Grid/__tests__/Grid.test.tsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import { render } from '@testing-library/react';
-
-import { Grid, GridItem } from '..';
-
-describe('Grid', () => {
- it('should render correctly', () => {
- const wrapper = render(
-
-
- item
-
-
- );
-
- expect(() => wrapper.unmount()).not.toThrow();
- });
-});
diff --git a/packages/components/src/Grid/index.ts b/packages/components/src/Grid/index.ts
deleted file mode 100644
index 4de7077e0..000000000
--- a/packages/components/src/Grid/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
-export type { GridProps } from './Grid';
-export { Grid } from './Grid';
-export type { GridItemProps } from './GridItem';
-export { GridItem } from './GridItem';
diff --git a/packages/components/src/Input/BaseInput.tsx b/packages/components/src/Input/BaseInput.tsx
index b57347883..f4370a9e7 100644
--- a/packages/components/src/Input/BaseInput.tsx
+++ b/packages/components/src/Input/BaseInput.tsx
@@ -1,4 +1,4 @@
-import { Spacing, InputSizes } from '@interlay/themev2';
+import { Spacing, InputSizes } from '@interlay/theme';
import { FocusEvent, forwardRef, InputHTMLAttributes, ReactNode, TextareaHTMLAttributes } from 'react';
import { Field, FieldProps, useFieldProps } from '../Field';
diff --git a/packages/components/src/Input/Input.style.tsx b/packages/components/src/Input/Input.style.tsx
index 89d515409..200d7e5b8 100644
--- a/packages/components/src/Input/Input.style.tsx
+++ b/packages/components/src/Input/Input.style.tsx
@@ -1,4 +1,4 @@
-import { InputSizes, Spacing } from '@interlay/themev2';
+import { InputSizes, Spacing } from '@interlay/theme';
import styled, { css } from 'styled-components';
type BaseInputProps = {
@@ -93,6 +93,7 @@ const StyledAdornment = styled.div`
position: absolute;
// to not allow adornment to take more than 50% of the input. We might want to reduce this in the future.
max-width: 50%;
+ ${({ theme }) => theme.input.adornment};
`;
const StyledAdornmentRight = styled(StyledAdornment)`
diff --git a/packages/components/src/List/List.style.tsx b/packages/components/src/List/List.style.tsx
index 8a2e2c324..65d0df300 100644
--- a/packages/components/src/List/List.style.tsx
+++ b/packages/components/src/List/List.style.tsx
@@ -1,23 +1,26 @@
-import styled, { css } from 'styled-components';
-import { theme } from '@interlay/theme';
+import styled, { CSSProperties, css } from 'styled-components';
import { Flex } from '../Flex';
-const StyledList = styled(Flex)``;
+type StyledListProps = {
+ $maxHeight?: CSSProperties['maxHeight'];
+};
+
+const StyledList = styled(Flex)`
+ max-height: ${({ $maxHeight }) => $maxHeight};
+`;
type StyledListItemProps = {
$isDisabled: boolean;
$isHovered: boolean;
- $isInteractable: boolean;
+ $isInteraButtonble: boolean;
$isFocusVisible: boolean;
};
const StyledListItem = styled.div`
flex: 1;
align-self: stretch;
- padding: ${theme.spacing.spacing3};
- color: ${theme.colors.textPrimary};
- cursor: ${({ $isInteractable }) => $isInteractable && 'pointer'};
+ cursor: ${({ $isInteraButtonble }) => $isInteraButtonble && 'pointer'};
outline: ${({ $isFocusVisible }) => !$isFocusVisible && 'none'};
opacity: ${({ $isDisabled }) => $isDisabled && 0.5};
white-space: nowrap;
diff --git a/packages/components/src/List/List.tsx b/packages/components/src/List/List.tsx
index 91b69476c..c471d6d82 100644
--- a/packages/components/src/List/List.tsx
+++ b/packages/components/src/List/List.tsx
@@ -2,9 +2,9 @@ import { AriaGridListOptions, useGridList } from '@react-aria/gridlist';
import { mergeProps } from '@react-aria/utils';
import { ListProps as StatelyListProps, useListState } from '@react-stately/list';
import { forwardRef } from 'react';
-import { ListVariants } from '@interlay/theme';
import { Selection } from '@react-types/shared';
import { useDOMRef } from '@interlay/hooks';
+import { CSSProperties } from 'styled-components';
import { FlexProps } from '../Flex';
@@ -12,7 +12,7 @@ import { StyledList } from './List.style';
import { ListItem } from './ListItem';
type Props = {
- variant?: ListVariants;
+ maxHeight?: CSSProperties['maxHeight'];
};
type InheritAttrs = Omit<
@@ -28,7 +28,7 @@ type ListProps = Props & NativeAttrs & InheritAttrs;
const List = forwardRef(
(
{
- variant = 'primary',
+ maxHeight,
direction = 'column',
onSelectionChange,
selectionMode,
@@ -59,12 +59,7 @@ const List = forwardRef(
const { gridProps } = useGridList(ariaProps, state, listRef);
return (
-
+
{[...state.collection].map((item) => (
))}
diff --git a/packages/components/src/List/ListItem.tsx b/packages/components/src/List/ListItem.tsx
index d7931ade3..386b394c4 100644
--- a/packages/components/src/List/ListItem.tsx
+++ b/packages/components/src/List/ListItem.tsx
@@ -23,9 +23,9 @@ const ListItem = ({ item, state }: InternalProps): JSX.Elem
const ref = useRef(null);
const { rowProps, gridCellProps, isDisabled } = useGridListItem({ node: item }, state, ref);
- const isInteractable = state.selectionManager.selectionMode !== 'none' && !isDisabled;
+ const isInteraButtonble = state.selectionManager.selectionMode !== 'none' && !isDisabled;
- const { isHovered, hoverProps } = useHover({ isDisabled: !isInteractable });
+ const { isHovered, hoverProps } = useHover({ isDisabled: !isInteraButtonble });
const { focusProps, isFocusVisible } = useFocusRing();
const props = useMemo(
@@ -40,7 +40,7 @@ const ListItem = ({ item, state }: InternalProps): JSX.Elem
$isDisabled={isDisabled}
$isFocusVisible={isFocusVisible}
$isHovered={isHovered}
- $isInteractable={isInteractable}
+ $isInteraButtonble={isInteraButtonble}
>
{item.rendered}
diff --git a/packages/components/src/Meter/Meter.tsx b/packages/components/src/Meter/Meter.tsx
index 7efc91839..06c7652c2 100644
--- a/packages/components/src/Meter/Meter.tsx
+++ b/packages/components/src/Meter/Meter.tsx
@@ -60,7 +60,7 @@ const Meter = ({
$variant={variant}
alignItems='center'
direction='column'
- gap='spacing1'
+ gap='xs'
justifyContent='center'
>
diff --git a/packages/components/src/Modal/Modal.stories.tsx b/packages/components/src/Modal/Modal.stories.tsx
index 4c54b2a0d..b29b55501 100644
--- a/packages/components/src/Modal/Modal.stories.tsx
+++ b/packages/components/src/Modal/Modal.stories.tsx
@@ -1,7 +1,7 @@
import { Meta, StoryObj } from '@storybook/react';
import { useState } from 'react';
-import { CTA } from '../CTA';
+import { Button } from '../Button';
import { Modal, ModalProps } from './Modal';
import { ModalHeader } from './ModalHeader';
@@ -15,7 +15,7 @@ const Render = ({ title, footer, children, ...args }: StoryProps) => {
return (
<>
- setState(true)}>Open Modal
+
setState(false)}>
{title && (
<>
@@ -25,7 +25,7 @@ const Render = ({ title, footer, children, ...args }: StoryProps) => {
{children}
{footer && (
- Procced
+
)}
@@ -203,3 +203,125 @@ export const ScrollBehaviour: StoryObj = {
)
}
};
+
+export const MaxHeight: StoryObj = {
+ args: {
+ title: 'Title',
+ footer: true,
+ maxHeight: '400px',
+ children: (
+ <>
+ Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam.
+ Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque
+ nisl consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in,
+ egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna,
+ vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus
+ ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent
+ commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum.
+ Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac,
+ vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur
+ purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac
+ consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras
+ mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi
+ leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl
+ consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in,
+ egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna,
+ vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus
+ ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent
+ commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum.
+ Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac,
+ vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur
+ purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac
+ consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras
+ mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi
+ leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl
+ consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in,
+ egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna,
+ vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus
+ ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent
+ commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum.
+ Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac,
+ vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur
+ purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac
+ consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras
+ mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi
+ leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl
+ consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in,
+ egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna,
+ vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus
+ ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent
+ commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum.
+ Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac,
+ vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur
+ purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac
+ consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras
+ mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi
+ leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl
+ consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in,
+ egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna,
+ vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus
+ ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent
+ commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum.
+ Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac,
+ vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur
+ purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac
+ consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras
+ mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi
+ leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl
+ consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in,
+ egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna,
+ vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus
+ ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent
+ commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum.
+ Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac,
+ vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur
+ purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac
+ consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras
+ mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi
+ leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl
+ consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in,
+ egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna,
+ vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus
+ ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent
+ commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum.
+ Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac,
+ vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur
+ purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac
+ consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras
+ mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi
+ leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl
+ consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in,
+ egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna,
+ vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus
+ ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent
+ commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum.
+ Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac,
+ vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur
+ purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac
+ consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras
+ mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi
+ leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl
+ consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in,
+ egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna,
+ vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus
+ ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent
+ commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum.
+ Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac,
+ vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur
+ purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac
+ consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras
+ mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi
+ leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl
+ consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in,
+ egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna,
+ vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum. Cras justo odio, dapibus
+ ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent
+ commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur purus sit amet fermentum.
+ Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac consectetur ac,
+ vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Cras mattis consectetur
+ purus sit amet fermentum. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Morbi leo risus, porta ac
+ consectetur ac, vestibulum at eros. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.
+ >
+ )
+ }
+};
diff --git a/packages/components/src/Modal/Modal.style.tsx b/packages/components/src/Modal/Modal.style.tsx
index 837df6536..86e658221 100644
--- a/packages/components/src/Modal/Modal.style.tsx
+++ b/packages/components/src/Modal/Modal.style.tsx
@@ -1,5 +1,5 @@
import styled, { CSSProperties } from 'styled-components';
-import { DialogSize } from '@interlay/themev2';
+import { DialogSize } from '@interlay/theme';
import { overlayCSS } from '../utils/overlay';
import { Dialog, DialogBody } from '../Dialog';
@@ -11,11 +11,11 @@ type StyledWrapperProps = {
type StyledModalProps = {
$isOpen?: boolean;
$size: DialogSize;
+ $maxHeight?: CSSProperties['maxHeight'];
};
type StyledDialogProps = {
$isOpen?: boolean;
- $maxHeight?: CSSProperties['maxHeight'];
};
type StyledModalBodyProps = {
@@ -36,6 +36,8 @@ const StyledWrapper = styled.div`
align-items: ${({ $placement }) => ($placement === 'center' ? 'center' : 'flex-start')};
`;
+//FIXME: on very small screen (height) the modal could overflow when max-heigh is set
+// might not need the max-heigh property
const StyledModal = styled.div`
transform: ${({ $isOpen }) => ($isOpen ? 'translateY(0)' : `translateY(20px)`)};
${({ $isOpen }) => overlayCSS(!!$isOpen)}
@@ -54,11 +56,12 @@ const StyledModal = styled.div`
margin: ${({ theme }) => `${theme.spacing('7xl')} ${theme.spacing('xl')}`};
max-width: ${({ theme, $size }) => theme.dialog.size[$size].maxWidth};
width: 100%;
+ max-height: ${({ theme, $maxHeight }) => $maxHeight || `calc(100dvh - ${theme.spacing('10xl')})`};
`;
const StyledDialog = styled(Dialog)`
pointer-events: ${({ $isOpen }) => !$isOpen && 'none'};
- max-height: ${({ theme, $maxHeight }) => $maxHeight || `calc(100dvh - ${theme.spacing('10xl')})`};
+ max-height: inherit;
`;
const StyledDialogBody = styled(DialogBody)`
diff --git a/packages/components/src/Modal/Modal.tsx b/packages/components/src/Modal/Modal.tsx
index d4ce048ea..375e1b77c 100644
--- a/packages/components/src/Modal/Modal.tsx
+++ b/packages/components/src/Modal/Modal.tsx
@@ -1,6 +1,6 @@
import { forwardRef, useRef } from 'react';
import { useDOMRef } from '@interlay/hooks';
-import { DialogSize } from '@interlay/themev2';
+import { DialogSize } from '@interlay/theme';
import { CSSProperties } from 'styled-components';
import { DialogProps } from '../Dialog';
@@ -64,6 +64,7 @@ const Modal = forwardRef(
isDismissable={isDismissable}
isKeyboardDismissDisabled={isKeyboardDismissDisabled}
isOpen={isOpen}
+ maxHeight={maxHeight}
placement={placement}
shouldCloseOnBlur={shouldCloseOnBlur}
shouldCloseOnInteractOutside={handleShouldCloseOnInteractOutside}
@@ -71,7 +72,7 @@ const Modal = forwardRef(
wrapperRef={wrapperRef}
onClose={onClose}
>
-
+
{children}
diff --git a/packages/components/src/Modal/ModalWrapper.tsx b/packages/components/src/Modal/ModalWrapper.tsx
index 5331ed2fe..90a97c3fc 100644
--- a/packages/components/src/Modal/ModalWrapper.tsx
+++ b/packages/components/src/Modal/ModalWrapper.tsx
@@ -2,7 +2,8 @@ import { AriaModalOverlayProps, AriaOverlayProps, useModalOverlay } from '@react
import { mergeProps } from '@react-aria/utils';
import { OverlayTriggerState } from '@react-stately/overlays';
import { forwardRef, ReactNode, RefObject } from 'react';
-import { DialogSize } from '@interlay/themev2';
+import { DialogSize } from '@interlay/theme';
+import { CSSProperties } from 'styled-components';
import { Underlay } from '../Overlay/Underlay';
@@ -15,6 +16,7 @@ type Props = {
onClose: () => void;
wrapperRef: RefObject;
size: DialogSize;
+ maxHeight?: CSSProperties['maxHeight'];
};
type InheritAttrs = Omit;
@@ -34,6 +36,7 @@ const ModalWrapper = forwardRef(
shouldCloseOnBlur,
wrapperRef,
size,
+ maxHeight,
...props
},
ref
@@ -57,7 +60,13 @@ const ModalWrapper = forwardRef(