Skip to content

Commit 797a08c

Browse files
authored
Merge pull request #4069 from IntersectMBO/test
v2.0.35.2
2 parents de2e9f0 + 3021fce commit 797a08c

File tree

17 files changed

+549
-434
lines changed

17 files changed

+549
-434
lines changed

govtool/frontend/package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

govtool/frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
"@emotion/styled": "^11.11.0",
2828
"@emurgo/cardano-serialization-lib-asmjs": "^14.1.1",
2929
"@hookform/resolvers": "^3.3.1",
30-
"@intersect.mbo/govtool-outcomes-pillar-ui": "v1.5.7",
30+
"@intersect.mbo/govtool-outcomes-pillar-ui": "v1.5.8",
3131
"@intersect.mbo/intersectmbo.org-icons-set": "^1.0.8",
32-
"@intersect.mbo/pdf-ui": "1.0.13-beta",
32+
"@intersect.mbo/pdf-ui": "1.0.14-beta",
3333
"@mui/icons-material": "^5.14.3",
3434
"@mui/material": "^5.14.4",
3535
"@noble/ed25519": "^2.3.0",
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import * as React from "react";
2+
import { Chip, ChipProps, IconButton } from "@mui/material";
3+
import { IconX } from "@intersect.mbo/intersectmbo.org-icons-set";
4+
5+
interface ChipButtonProps
6+
extends Omit<ChipProps, "color" | "variant" | "deleteIcon"> {
7+
label: React.ReactNode;
8+
onDelete: () => void;
9+
bgColor?: string;
10+
deleteIconPosition?: "left" | "right";
11+
iconSize?: number;
12+
testId?: string;
13+
}
14+
15+
const ChipButton: React.FC<ChipButtonProps> = ({
16+
label,
17+
onDelete,
18+
bgColor = "#B9CCF5",
19+
deleteIconPosition = "left",
20+
iconSize = 14,
21+
testId,
22+
sx,
23+
...rest
24+
}) => (
25+
<Chip
26+
{...rest}
27+
label={label}
28+
onDelete={onDelete}
29+
data-testid={testId}
30+
deleteIcon={
31+
<IconButton
32+
disableRipple
33+
sx={{ p: "4px", "&:hover": { backgroundColor: "transparent" } }}
34+
>
35+
<IconX style={{ width: iconSize, height: iconSize, color: "#222" }} />
36+
</IconButton>
37+
}
38+
sx={{
39+
backgroundColor: bgColor,
40+
borderRadius: 999,
41+
height: "auto",
42+
py: 0.75,
43+
pl: 1.75,
44+
pr: 2.25,
45+
display: "flex",
46+
flexDirection: deleteIconPosition === "right" ? "row" : "row-reverse",
47+
gap: 0.5,
48+
"& .MuiChip-label": {
49+
fontSize: 12,
50+
fontWeight: 400,
51+
color: "#000",
52+
whiteSpace: "nowrap",
53+
overflow: "hidden",
54+
textOverflow: "ellipsis",
55+
px: 0,
56+
py: 0,
57+
},
58+
"& .MuiChip-deleteIcon": { m: 0 },
59+
...(sx as object),
60+
}}
61+
/>
62+
);
63+
64+
export default ChipButton;

0 commit comments

Comments
 (0)