Skip to content

Commit 88accef

Browse files
authored
feat(Modal): remove component (#780)
1 parent 0d92a2f commit 88accef

File tree

9 files changed

+58
-457
lines changed

9 files changed

+58
-457
lines changed

.changeset/late-horses-play.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cube-dev/ui-kit": patch
3+
---
4+
5+
Add side border radius to the header and the footer of the menus.

.changeset/quick-cougars-hammer.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cube-dev/ui-kit": minor
3+
---
4+
5+
Remove legacy Modal component.

src/components/actions/Menu/Menu.stories.tsx

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1799,6 +1799,43 @@ export const SubMenuCustomization = () => {
17991799
);
18001800
};
18011801

1802+
export const WithHeaderAndFooter = (props) => {
1803+
return (
1804+
<div style={{ padding: '20px', width: '340px' }}>
1805+
<Menu
1806+
id="menu-header-footer"
1807+
{...props}
1808+
header="Menu Header"
1809+
footer="Menu Footer"
1810+
headerStyles={{ fill: '#light' }}
1811+
footerStyles={{ fill: '#light' }}
1812+
>
1813+
<Menu.Item key="item1" icon={<IconReload />}>
1814+
First Item
1815+
</Menu.Item>
1816+
<Menu.Item key="item2" icon={<IconBook />}>
1817+
Second Item
1818+
</Menu.Item>
1819+
<Menu.Item key="item3" icon={<IconPlus />}>
1820+
Third Item
1821+
</Menu.Item>
1822+
<Menu.Item key="item4" icon={<IconBulb />}>
1823+
Fourth Item
1824+
</Menu.Item>
1825+
</Menu>
1826+
</div>
1827+
);
1828+
};
1829+
1830+
WithHeaderAndFooter.parameters = {
1831+
docs: {
1832+
description: {
1833+
story:
1834+
'Menu with both header and footer sections, both styled with light fill background.',
1835+
},
1836+
},
1837+
};
1838+
18021839
export const ComprehensivePopoverSynchronization = () => {
18031840
const MyMenuComponent = ({ onAction }) => (
18041841
<Menu width="200px" onAction={onAction}>

src/components/actions/Menu/Menu.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@ import {
1414
Styles,
1515
} from '../../../tasty';
1616
import { mergeProps } from '../../../utils/react';
17-
import { CubeBlockProps } from '../../Block';
1817
import { Item } from '../../Item';
19-
import {
20-
CubeTooltipProviderProps,
21-
TooltipProvider,
22-
} from '../../overlays/Tooltip/TooltipProvider';
2318

2419
import { useMenuContext } from './context';
2520
import { MenuItem } from './MenuItem';

src/components/actions/Menu/styled.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export const StyledHeader = tasty(Space, {
7979
height: 'min $size',
8080
boxSizing: 'border-box',
8181
border: 'bottom',
82+
radius: '1cr top',
8283

8384
$size: {
8485
'': '$size-md',
@@ -110,6 +111,7 @@ export const StyledFooter = tasty(Space, {
110111
},
111112
boxSizing: 'border-box',
112113
border: 'top',
114+
radius: '1cr bottom',
113115
},
114116
});
115117

src/components/fields/FilterPicker/FilterPicker.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,14 @@ export const FilterPicker = forwardRef(function FilterPicker<T extends object>(
10071007
>
10081008
{renderTrigger}
10091009
{(close) => (
1010-
<Dialog display="grid" styles={{ gridRows: '1sf', ...popoverStyles }}>
1010+
<Dialog
1011+
display="grid"
1012+
styles={{
1013+
gridRows: '1sf',
1014+
width: '30x max-content 50vw',
1015+
...popoverStyles,
1016+
}}
1017+
>
10111018
<FocusScope restoreFocus>
10121019
<FilterListBox
10131020
autoFocus

0 commit comments

Comments
 (0)