From 9e5c83f5d55c1389509a56beb30e771cc24865f1 Mon Sep 17 00:00:00 2001 From: Alexandra Goff Date: Fri, 13 Dec 2024 15:01:59 -0500 Subject: [PATCH] fix: recursive spacing --- packages/epo-react-lib/src/atomic/Stack/Stack.stories.tsx | 5 +++++ packages/epo-react-lib/src/atomic/Stack/styles.ts | 8 ++++---- packages/epo-react-lib/src/types/image.ts | 4 ++-- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/packages/epo-react-lib/src/atomic/Stack/Stack.stories.tsx b/packages/epo-react-lib/src/atomic/Stack/Stack.stories.tsx index 293de24a..b3d15883 100644 --- a/packages/epo-react-lib/src/atomic/Stack/Stack.stories.tsx +++ b/packages/epo-react-lib/src/atomic/Stack/Stack.stories.tsx @@ -5,6 +5,11 @@ import { FunctionComponent } from "react"; const meta: Meta = { component: Stack, + argTypes: { + recursive: { + control: "boolean", + }, + }, }; export default meta; diff --git a/packages/epo-react-lib/src/atomic/Stack/styles.ts b/packages/epo-react-lib/src/atomic/Stack/styles.ts index 6200a59b..43276c67 100644 --- a/packages/epo-react-lib/src/atomic/Stack/styles.ts +++ b/packages/epo-react-lib/src/atomic/Stack/styles.ts @@ -7,21 +7,21 @@ export const Stack = styled.div` justify-content: flex-start; &[data-recursive="true"] { - > * { + & * { margin-block: 0; } - > * + * { + & * + * { margin-block-start: var(--size-spacing-stack, 1rem); } } &[data-recursive="false"] { - > * { + & > * { margin-block: 0; } - > * + * { + & > * + * { margin-block-start: var(--size-spacing-stack, 1rem); } } diff --git a/packages/epo-react-lib/src/types/image.ts b/packages/epo-react-lib/src/types/image.ts index faca167a..2e9c69c1 100644 --- a/packages/epo-react-lib/src/types/image.ts +++ b/packages/epo-react-lib/src/types/image.ts @@ -15,8 +15,8 @@ export interface ImageShape { height?: number; url: string; src?: string; - srcSet?: Array; - sizes?: Array; + srcSet?: string | Array; + sizes?: string | Array; priority?: boolean; /** @deprecated */ url2x?: string;