diff --git a/src/Fields/index.stories.tsx b/src/Fields/index.stories.tsx index 4784480b..5bde02a2 100644 --- a/src/Fields/index.stories.tsx +++ b/src/Fields/index.stories.tsx @@ -242,7 +242,7 @@ function TextAreaStory() { const textAreaRequiredRef = useRef(null); const textAreaStyledRef = useRef(null); return ( - + = function PropsHavePriority( fontSize: args.fontSize, }} > - + Props get passed directly to the components and have priority. @@ -167,7 +167,7 @@ export const PropsHavePriority: Story = function PropsHavePriority( function SupportedComponents() { return ( - + = function Default(args) { export const Block: Story = function Block(args) { return ( - + - + - + - + - + - + diff --git a/src/Space/index.tsx b/src/Space/index.tsx index cb2c8cd3..691fac90 100644 --- a/src/Space/index.tsx +++ b/src/Space/index.tsx @@ -4,24 +4,25 @@ import styled, { css } from 'styled-components'; export { SpaceSize } from 'antd/lib/space'; -export type SpaceProps = AntdSpaceProps & { +export type SpaceProps = Omit & { block?: boolean; + vertical?: boolean; }; -const TRANSIENT_PROPS: Array = ['block'] satisfies Array< +const TRANSIENT_PROPS: Array = ['block', 'vertical'] satisfies Array< keyof SpaceProps >; -export const Space: React.FC = styled(AntdSpace).withConfig({ - shouldForwardProp: (prop) => !TRANSIENT_PROPS.includes(prop), -})` +export const Space: React.FC = styled(AntdSpace) + .withConfig({ + shouldForwardProp: (prop) => !TRANSIENT_PROPS.includes(prop), + }) + .attrs((props) => ({ + direction: props.vertical ? 'vertical' : 'horizontal', + }))` ${(props: SpaceProps) => props.block && css` display: flex; `}; `; - -export function VSpace(props: SpaceProps) { - return ; -} diff --git a/src/UserDetailsPopover/UserDetails.tsx b/src/UserDetailsPopover/UserDetails.tsx index ee4937dd..c94b248b 100644 --- a/src/UserDetailsPopover/UserDetails.tsx +++ b/src/UserDetailsPopover/UserDetails.tsx @@ -28,7 +28,7 @@ export function UserDetails({ user }: UserDetailsProps) { const fullName = joinNonEmpty([firstname, lastname], ' '); const showFullName = !inactive && fullName; return ( - + diff --git a/src/UserDetailsPopover/index.stories.tsx b/src/UserDetailsPopover/index.stories.tsx index 0e8844d9..4aebf7fa 100644 --- a/src/UserDetailsPopover/index.stories.tsx +++ b/src/UserDetailsPopover/index.stories.tsx @@ -33,7 +33,7 @@ export const Default: Story = function Link(args) { const [visible, setVisible] = useState(false); return (