Skip to content

Commit 00770c6

Browse files
committed
feat: Add xl gap
1 parent 672e61d commit 00770c6

1 file changed

Lines changed: 34 additions & 6 deletions

File tree

app/configurator/components/chart-controls/section.tsx

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export const ControlSection = forwardRef<
160160
type ControlSectionContentProps = {
161161
children: ReactNode;
162162
px?: "md" | "none";
163-
gap?: "lg" | "md" | "none";
163+
gap?: "xl" | "lg" | "md" | "none";
164164
} & Omit<BoxProps, "children">;
165165

166166
const useControlSectionContentStyles = makeStyles<
@@ -170,12 +170,40 @@ const useControlSectionContentStyles = makeStyles<
170170
controlSectionContent: {
171171
display: "flex",
172172
flexDirection: "column",
173-
gap: ({ gap }) => theme.spacing(gap === "lg" ? 3 : gap === "md" ? 2 : 0),
173+
gap: ({ gap }) => {
174+
switch (gap) {
175+
case "xl":
176+
return theme.spacing(4);
177+
case "lg":
178+
return theme.spacing(3);
179+
case "md":
180+
return theme.spacing(2);
181+
case "none":
182+
case undefined:
183+
return 0;
184+
default:
185+
const _exhaustiveCheck: never = gap;
186+
return _exhaustiveCheck;
187+
}
188+
},
174189
minWidth: 0,
175-
paddingLeft: ({ px }) => (px === "none" ? 0 : theme.spacing(4)),
176-
paddingTop: theme.spacing(2),
177-
paddingRight: ({ px }) => (px === "none" ? 0 : theme.spacing(4)),
178-
paddingBottom: theme.spacing(4),
190+
padding: ({ px: _px }) => {
191+
const px: string = (() => {
192+
switch (_px) {
193+
case "none":
194+
return "0px";
195+
case "md":
196+
return theme.spacing(4);
197+
case undefined:
198+
return "0px";
199+
default:
200+
const _exhaustiveCheck: never = _px;
201+
return _exhaustiveCheck;
202+
}
203+
})();
204+
205+
return `${theme.spacing(2)} ${px} ${theme.spacing(4)}`;
206+
},
179207
},
180208
}));
181209

0 commit comments

Comments
 (0)