Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"dependencies": {
"@ai-sdk/svelte": "^1.1.24",
"@appwrite.io/console": "https://pkg.vc/-/@appwrite/@appwrite.io/console@67539a6",
"@appwrite.io/pink-icons": "0.25.0",
"@appwrite.io/pink-icons": "^0.25.0",
"@appwrite.io/pink-icons-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-icons-svelte@bfe7ce3",
"@appwrite.io/pink-legacy": "^1.0.3",
"@appwrite.io/pink-svelte": "https://pkg.vc/-/@appwrite/@appwrite.io/pink-svelte@8dcaa17",
Expand All @@ -46,7 +46,8 @@
"remarkable": "^2.0.1",
"svelte-confetti": "^1.4.0",
"three": "^0.181.2",
"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?

},
"devDependencies": {
"@eslint/compat": "^1.4.1",
Expand Down
3 changes: 3 additions & 0 deletions src/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ namespace App {
type?: string;
}
}

declare module '@appwrite.io/pink-legacy';
declare module '@appwrite.io/pink-icons';
111 changes: 67 additions & 44 deletions src/lib/components/cardGrid.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,56 +3,79 @@

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-content {
display: grid;
gap: var(--space-10);
align-items: start;
grid-template-columns: minmax(0, 1fr);
}
.card-grid-wrapper.interactive {
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-main,
.card-grid-aside {
min-width: 0;
}
.card-grid-wrapper.interactive:hover {
will-change: transform, box-shadow;
transform: translateY(-2px);
box-shadow: var(--shadow-md, 0 8px 20px rgba(0, 0, 0, 0.12));
}

@media (min-width: 769px) {
.card-grid-content {
column-gap: var(--space-13);
row-gap: var(--space-10);
grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}
.card-grid-wrapper.interactive: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);
align-items: start;
grid-template-columns: minmax(0, 1fr);
}

.card-grid-main,
.card-grid-aside {
min-width: 0;
}

@media (min-width: 769px) {
.card-grid-content {
column-gap: var(--space-13);
row-gap: var(--space-10);
grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
}
</style>
}
</style>