Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"remarkable": "^2.0.1",
"svelte-confetti": "^1.4.0",
"three": "^0.181.2",
Comment thread
greptile-apps[bot] marked this conversation as resolved.
"tippy.js": "^6.3.7"
"tippy.js": "^6.3.7",
"zod": "^3.25.76"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need zod?

},
Comment thread
ArhanAnsari marked this conversation as resolved.
"devDependencies": {
"@eslint/compat": "^1.4.1",
Expand Down
79 changes: 51 additions & 28 deletions src/lib/components/cardGrid.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,62 @@

export let overflow = true;
export let hideFooter = false;
export let interactive = false;
export let gap: 'none' | 'xxxs' | 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl' | 'xxxl' = 'l';
</script>

<Card.Base>
<Layout.Stack gap="xl" justifyContent="space-around">
<div class="card-grid-content">
<Layout.Stack gap="xxs" class="card-grid-main">
<Typography.Title size="s" truncate><slot name="title" /></Typography.Title>
{#if $$slots.default}
<Typography.Text>
<slot />
</Typography.Text>
{/if}
</Layout.Stack>
<div class="card-grid-aside" style:overflow={overflow ? 'visible' : 'hidden'}>
<Layout.Stack {gap}>
<slot name="aside" />
</Layout.Stack>
<div class="card-grid-wrapper" class:interactive>
<Card.Base>
<Layout.Stack gap="xl" justifyContent="space-around">
<div class="card-grid-content">
<div class="card-grid-main">
<Layout.Stack gap="xxs">
<Typography.Title size="s" truncate><slot name="title" /></Typography.Title>
{#if $$slots.default}
<Typography.Text>
<slot />
</Typography.Text>
{/if}
</Layout.Stack>
</div>
<div class="card-grid-aside" style:overflow={overflow ? 'visible' : 'hidden'}>
<Layout.Stack {gap}>
<slot name="aside" />
</Layout.Stack>
</div>
</div>
</div>
{#if $$slots.actions && !hideFooter}
<span
style="margin-left: calc(-1* var(--space-9));margin-right: calc(-1* var(--space-9));width:auto;">
<Divider />
</span>
<Layout.Stack direction="row-reverse">
<slot name="actions" />
</Layout.Stack>
{/if}
</Layout.Stack>
</Card.Base>
{#if $$slots.actions && !hideFooter}
<span
style="margin-left: calc(-1* var(--space-9));margin-right: calc(-1* var(--space-9));width:auto;">
<Divider />
</span>
<Layout.Stack direction="row-reverse">
<slot name="actions" />
</Layout.Stack>
{/if}
</Layout.Stack>
</Card.Base>
</div>

<style>
.card-grid-wrapper.interactive :global(.card) {
transition:
transform 200ms cubic-bezier(0.4, 0, 0.2, 1),
box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1);
cursor: pointer;
}

.card-grid-wrapper.interactive :global(.card:hover) {
will-change: transform, box-shadow;
transform: translateY(-2px);
box-shadow: var(--shadow-md, 0 8px 20px rgba(0, 0, 0, 0.12));
}

.card-grid-wrapper.interactive :global(.card:active) {
transform: translateY(0);
box-shadow: var(--shadow-sm, 0 4px 10px rgba(0, 0, 0, 0.08));
}

.card-grid-content {
display: grid;
gap: var(--space-10);
Expand All @@ -55,4 +78,4 @@
grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}
}
</style>
</style>
Loading