Skip to content

Commit

Permalink
feat: fill variant in menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
ajbura committed Apr 7, 2024
1 parent 3bbce78 commit 754f296
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
10 changes: 9 additions & 1 deletion src/components/menu/MenuItem.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export const MenuItem = recipe({
alignItems: "center",
justifyContent: "start",
cursor: "pointer",
backgroundColor: Container,
color: OnContainer,

selectors: {
Expand Down Expand Up @@ -69,6 +68,14 @@ export const MenuItem = recipe({
Warning: getVariant("Warning"),
Critical: getVariant("Critical"),
},
fill: {
Soft: {
backgroundColor: Container,
},
None: {
backgroundColor: "transparent",
},
},
size: {
"300": {
vars: {
Expand All @@ -91,6 +98,7 @@ export const MenuItem = recipe({
},
defaultVariants: {
variant: "Surface",
fill: "Soft",
size: "400",
radii: "0",
},
Expand Down
4 changes: 4 additions & 0 deletions src/components/menu/MenuItem.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ export default {
"Critical",
],
},
fill: {
control: "select",
options: ["Soft", "None"],
},
radii: {
control: "select",
options: ["inherit", 0, 300, 400, 500, "Pill"],
Expand Down
3 changes: 2 additions & 1 deletion src/components/menu/MenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export const MenuItem = as<"button", MenuItemProps & css.MenuItemVariants>(
as: AsMenuItem = "button",
className,
variant,
fill,
size,
radii,
before,
Expand All @@ -24,7 +25,7 @@ export const MenuItem = as<"button", MenuItemProps & css.MenuItemVariants>(
ref
) => (
<AsMenuItem
className={classNames(css.MenuItem({ variant, size, radii }), className)}
className={classNames(css.MenuItem({ variant, fill, size, radii }), className)}
data-ui-before={before ? true : undefined}
data-ui-after={after ? true : undefined}
{...props}
Expand Down

0 comments on commit 754f296

Please sign in to comment.