Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove SpaceProps from ButtonProps #1309

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/khaki-falcons-drum.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vygruppen/spor-react": major
---

The Button component has been updated to remove SpaceProps from its ButtonProps interface. This change eliminates direct support for spacing-related properties (e.g., margin, padding).
10 changes: 7 additions & 3 deletions packages/spor-react/src/button/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@ import {
ButtonProps as ChakraButtonProps,
Flex,
forwardRef,
SpaceProps,
useButtonGroup,
useStyleConfig,
} from "@chakra-ui/react";
import React from "react";
import { createTexts, useTranslation } from "../i18n";
import { ColorInlineLoader } from "../loader";

export type ButtonProps = Exclude<
ChakraButtonProps,
"colorScheme" | "loadingText" | "size" | "variant"
export type ButtonProps = Omit<
Exclude<
ChakraButtonProps,
"colorScheme" | "loadingText" | "size" | "variant"
>,
keyof SpaceProps
> & {
/**
* The size of the button.
Expand Down
2 changes: 0 additions & 2 deletions packages/spor-react/src/modal/FullScreenDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ const DrawerCloseButton = () => {
onClick={onClose}
aria-label={t(texts.close)}
width="fit-content"
marginLeft="auto"
>
{t(texts.close)}
</Button>
Expand Down Expand Up @@ -196,7 +195,6 @@ const DrawerBackButton = () => {
onClick={onClose}
aria-label={t(texts.backAriaLabel)}
width="fit-content"
marginLeft="auto"
>
{t(texts.back)}
</Button>
Expand Down
Loading