Skip to content

Commit 3296300

Browse files
committed
fix: add padding none to Card, add optional children to Toggle
1 parent 73252cf commit 3296300

File tree

7 files changed

+10
-7
lines changed

7 files changed

+10
-7
lines changed

src/generatedFileList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ export const fileList = [
130130
"src/lib/typography/span/Span.svelte",
131131
"src/lib/utils/CloseButton.svelte",
132132
"src/lib/video/Video.svelte"
133-
] as const;
133+
] as const;

src/lib/cards/Card.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
@props:reverse: boolean = false;
4242
@props:img: {
4343
src: string | undefined | null;
44-
@props:padding: "sm" | "lg" | "md" | "xl" | "xs" | undefined = "lg";
44+
@props:padding: "sm" | "lg" | "md" | "xl" | "xs" | "none" | undefined = "lg";
4545
@props:size: "sm" | "md" | "lg" | "xl" | "xs" | undefined = "sm";
4646
@props:class: string;
4747
@props:imgClass: string;

src/lib/cards/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { card } from "./theme";
55

66
// type CardSizeType = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
77
type CardSizeType = "sm" | "md" | "lg" | "xl" | "xs" | undefined;
8-
type PaddingType = "sm" | "lg" | "md" | "xl" | "xs" | undefined;
8+
type PaddingType = "sm" | "lg" | "md" | "xl" | "xs" | "none" | undefined;
99
type ShadowType = "sm" | "normal" | "lg" | "md" | "xl" | "2xl" | "inner" | undefined;
1010
type ColorType = "gray" | "primary" | "secondary" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | undefined;
1111

src/lib/cards/theme.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ export const card = tv({
5151
sm: { content: "p-4 md:p-6" },
5252
md: { content: "p-4 sm:p-5 md:p-7" },
5353
lg: { content: "p-4 sm:p-6 md:p-8" },
54-
xl: { content: "p-4 sm:p-8 md:p-10" }
54+
xl: { content: "p-4 sm:p-8 md:p-10" },
55+
none: { content: "p-0" }
5556
},
5657
horizontal: {
5758
true: {

src/lib/forms/toggle/Toggle.svelte

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
{/if}
1414
<input type="checkbox" bind:checked {value} aria-describedby={aria_describedby} {...restProps} {disabled} class={input({ class: inputClass })} />
1515
<span class={span({ class: spanClass })}></span>
16-
{@render children()}
16+
{#if children}
17+
{@render children()}
18+
{/if}
1719
</Label>
1820

1921
<!--

src/lib/forms/toggle/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ type SizeType = "default" | "small" | "large" | undefined;
77
type ToggleColor = "primary" | "secondary" | "gray" | "red" | "orange" | "amber" | "yellow" | "lime" | "green" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "indigo" | "violet" | "purple" | "fuchsia" | "pink" | "rose" | undefined;
88

99
interface ToggleProps extends HTMLInputAttributes {
10-
children: Snippet;
10+
children?: Snippet;
1111
leftLabel?: Snippet;
1212
toggleSize?: SizeType;
1313
value?: string | number;

src/routes/component-data/Card.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
],
3939
[
4040
"padding",
41-
"\"sm\" | \"lg\" | \"md\" | \"xl\" | \"xs\" | undefined",
41+
"\"sm\" | \"lg\" | \"md\" | \"xl\" | \"xs\" | \"none\" | undefined",
4242
"\"lg\""
4343
],
4444
[

0 commit comments

Comments
 (0)