diff --git a/src/components/Button/Button.styles.ts b/src/components/Button/Button.styles.ts index 080e3de5..82a61cfe 100644 --- a/src/components/Button/Button.styles.ts +++ b/src/components/Button/Button.styles.ts @@ -328,6 +328,8 @@ export const buttonCSS = ( borderStyle: "solid", color: btnStyles.enabled.text, boxShadow: btnStyles.enabled.shadow, + boxSizing: "border-box", + gap: 4, "& .buttonIcon": { display: "flex", height: 16, diff --git a/src/components/Button/index.tsx b/src/components/Button/index.tsx index 6c3340c8..59168cd5 100644 --- a/src/components/Button/index.tsx +++ b/src/components/Button/index.tsx @@ -93,18 +93,6 @@ const Button: FC< padding: paddingValue, "& .button-label": { whiteSpace: fullWidth ? "normal" : "nowrap", - marginRight: - !hasLabel || !icon - ? 0 - : label !== "" && iconLocation === "end" - ? "4px" - : 0, - marginLeft: - !hasLabel || !icon - ? 0 - : label !== "" && iconLocation === "start" - ? "4px" - : 0, }, }); @@ -138,7 +126,7 @@ const Button: FC< > {icon && iconLocation === "start" && iconToPlace} - {(children || label?.trim() !== "") && ( + {hasLabel && ( {children} {children && label ? " " : ""} diff --git a/src/components/ExpandMenu/ExpandMenu.stories.tsx b/src/components/ExpandMenu/ExpandMenu.stories.tsx index 0477d8b5..4678db43 100644 --- a/src/components/ExpandMenu/ExpandMenu.stories.tsx +++ b/src/components/ExpandMenu/ExpandMenu.stories.tsx @@ -449,6 +449,373 @@ LongOptionsList.args = { ), }; +export const ExpandMenuWithLabel = Template.bind({}); +ExpandMenuWithLabel.args = { + id: "expand-button", + icon: , + label: "Options", + children: ( + + { + console.log("click1"); + }} + icon={} + > + Option 1 + + { + console.log("click2"); + }} + icon={} + > + Option 2 + + { + console.log("click3"); + }} + icon={} + > + Display Object Versions + + { + console.log("click4"); + }} + className={"danger"} + icon={} + > + Option 4 + + + { + console.log("click5"); + }} + icon={} + disabled + > + Disabled Option + + + { + console.log("click1"); + }} + icon={} + > + Option 5 + + { + console.log("click2"); + }} + icon={} + > + Option 6 + + { + console.log("click3"); + }} + icon={} + > + Display Object Versions + + { + console.log("click4"); + }} + className={"danger"} + icon={} + > + Option 8 + + + { + console.log("click5"); + }} + icon={} + disabled + > + Disabled Option + + { + console.log("click1"); + }} + icon={} + > + Option 5 + + { + console.log("click2"); + }} + icon={} + > + Option 6 + + { + console.log("click3"); + }} + icon={} + > + Display Object Versions + + { + console.log("click4"); + }} + className={"danger"} + icon={} + > + Option 8 + + + { + console.log("click5"); + }} + icon={} + disabled + > + Disabled Option + + + ), +}; + +export const CompactButton = Template.bind({}); +CompactButton.args = { + id: "expand-button", + icon: , + label: "Options", + compact: true, + children: ( + + { + console.log("click1"); + }} + icon={} + > + Option 1 + + { + console.log("click2"); + }} + icon={} + > + Option 2 + + { + console.log("click3"); + }} + icon={} + > + Display Object Versions + + { + console.log("click4"); + }} + className={"danger"} + icon={} + > + Option 4 + + + { + console.log("click5"); + }} + icon={} + disabled + > + Disabled Option + + + { + console.log("click1"); + }} + icon={} + > + Option 5 + + { + console.log("click2"); + }} + icon={} + > + Option 6 + + { + console.log("click3"); + }} + icon={} + > + Display Object Versions + + { + console.log("click4"); + }} + className={"danger"} + icon={} + > + Option 8 + + + { + console.log("click5"); + }} + icon={} + disabled + > + Disabled Option + + { + console.log("click1"); + }} + icon={} + > + Option 5 + + { + console.log("click2"); + }} + icon={} + > + Option 6 + + { + console.log("click3"); + }} + icon={} + > + Display Object Versions + + { + console.log("click4"); + }} + className={"danger"} + icon={} + > + Option 8 + + + { + console.log("click5"); + }} + icon={} + disabled + > + Disabled Option + + + ), +}; + export const ListDividersWithInputOptions = Template.bind({}); ListDividersWithInputOptions.args = { id: "expand-button", diff --git a/src/components/ExpandMenu/index.tsx b/src/components/ExpandMenu/index.tsx index f52a871d..6abf07ae 100644 --- a/src/components/ExpandMenu/index.tsx +++ b/src/components/ExpandMenu/index.tsx @@ -50,19 +50,14 @@ const ExpandMenu: FC< if (dropArrow) { secondary = expandedMenu ? ( - - ) : ( + ) : ( + ); }