Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
… into feat-code-example
  • Loading branch information
TorstenDittmann committed Oct 10, 2022
2 parents 083b6d6 + 31c61a8 commit 1f68b1e
Show file tree
Hide file tree
Showing 102 changed files with 2,314 additions and 1,976 deletions.
774 changes: 338 additions & 436 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,42 +19,42 @@
},
"dependencies": {
"@aw-labs/appwrite-console": "^6.0.0",
"@aw-labs/icons": "0.0.0-55",
"@aw-labs/ui": "0.0.0-55",
"echarts": "^5.3.3",
"@aw-labs/icons": "0.0.0-58",
"@aw-labs/ui": "0.0.0-58",
"echarts": "^5.4.0",
"prismjs": "^1.29.0",
"tippy.js": "^6.3.7",
"web-vitals": "^2.1.4"
},
"devDependencies": {
"@playwright/test": "^1.25.2",
"@sveltejs/adapter-auto": "1.0.0-next.74",
"@sveltejs/kit": "1.0.0-next.483",
"@sveltejs/vite-plugin-svelte": "^1.0.5",
"@testing-library/dom": "^8.17.1",
"@playwright/test": "^1.26.1",
"@sveltejs/adapter-auto": "1.0.0-next.80",
"@sveltejs/kit": "1.0.0-next.509",
"@sveltejs/vite-plugin-svelte": "^1.0.8",
"@testing-library/dom": "^8.18.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/svelte": "3.1.3",
"@testing-library/user-event": "^14.4.3",
"@types/gtag.js": "^0.0.11",
"@types/prismjs": "^1.26.0",
"@typescript-eslint/eslint-plugin": "^5.37.0",
"@typescript-eslint/parser": "^5.37.0",
"@vitest/ui": "^0.23.2",
"eslint": "^8.23.1",
"@types/gtag.js": "^0.0.12",
"@typescript-eslint/eslint-plugin": "^5.39.0",
"@typescript-eslint/parser": "^5.39.0",
"@vitest/ui": "^0.23.4",
"eslint": "^8.24.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-svelte3": "^4.0.0",
"pre-commit": "^1.2.2",
"prettier": "^2.7.1",
"prettier-plugin-svelte": "^2.7.0",
"sass": "^1.54.9",
"prettier-plugin-svelte": "^2.7.1",
"sass": "^1.55.0",
"svelte": "^3.50.1",
"svelte-check": "^2.9.0",
"svelte-check": "^2.9.1",
"svelte-jester": "^2.3.2",
"svelte-preprocess": "^4.10.7",
"tslib": "^2.4.0",
"typescript": "^4.7.4",
"vite": "^3.1.1",
"vitest": "^0.23.2"
"typescript": "^4.8.4",
"vite": "^3.1.4",
"vitest": "^0.23.4"
},
"type": "module",
"pre-commit": [
Expand Down
20 changes: 20 additions & 0 deletions src/lib/components/cardContainer.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<script lang="ts">
import { Empty } from '$lib/components';
import { cardLimit } from '$lib/stores/layout';
export let offset = 0;
export let limit = $cardLimit;
export let total = 0;
</script>

<ul
class="grid-box common-section u-margin-block-start-32"
style={`--grid-gap:1.5rem; --grid-item-size:${total > 3 ? '22rem' : '25rem'};`}>
<slot />

{#if limit + offset > total && (total % 2 !== 0 || total % 4 === 0)}
<Empty isButton on:click>
<slot name="empty" />
</Empty>
{/if}
</ul>
20 changes: 1 addition & 19 deletions src/lib/components/collapsible.svelte
Original file line number Diff line number Diff line change
@@ -1,21 +1,3 @@
<ul class="collapsible">
<li class="collapsible-item">
<details class="collapsible-wrapper">
<summary class="collapsible-button">
<span class="text">
<slot name="header" />
</span>
<span class="collapsible-button-optional">
<slot name="subheader" />
</span>
<div class="icon">
<span class="icon-plus" aria-hidden="true" />
<span class="icon-minus" aria-hidden="true" />
</div>
</summary>
<p class="collapsible-content">
<slot />
</p>
</details>
</li>
<slot />
</ul>
14 changes: 14 additions & 0 deletions src/lib/components/collapsibleItem.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<li class="collapsible-item">
<details class="collapsible-wrapper">
<summary class="collapsible-button">
<span class="text"><slot name="title" /></span>
<span class="collapsible-button-optional"><slot name="subtitle" /></span>
<div class="icon">
<span class="icon-cheveron-down" aria-hidden="true" />
</div>
</summary>
<div class="collapsible-content">
<slot />
</div>
</details>
</li>
43 changes: 43 additions & 0 deletions src/lib/components/customId.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<script lang="ts">
import { InnerModal } from '$lib/components';
import { InputText } from '$lib/elements/forms';
export let show = false;
export let name: string;
export let id: string;
$: if (!show) {
id = null;
}
$: if (!id?.length) {
id = null;
}
</script>

<InnerModal bind:show>
<svelte:fragment slot="title">{name} ID</svelte:fragment>
<svelte:fragment slot="subtitle">
Enter a custom {name} ID. Leave blank for a randomly generated one.
</svelte:fragment>
<svelte:fragment slot="content">
<div class="form">
<InputText
id="id"
label="Custom ID"
showLabel={false}
placeholder="Enter ID"
autofocus={true}
bind:value={id} />

<div class="u-flex u-gap-4 u-margin-block-start-8 u-small">
<span
class="icon-info u-cross-center u-margin-block-start-2 u-line-height-1 u-icon-small"
aria-hidden="true" />
<span class="text u-line-height-1-5">
Allowed characters: alphanumeric, hyphen, non-leading underscore, period
</span>
</div>
</div>
</svelte:fragment>
</InnerModal>
3 changes: 2 additions & 1 deletion src/lib/components/dropListItem.svelte
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<script lang="ts">
export let disabled = false;
export let icon: string = null;
</script>

<li class="drop-list-item">
<button class="drop-button" on:click|preventDefault>
<button class="drop-button" on:click|preventDefault {disabled}>
<span class="text"><slot /></span>
{#if icon}
<span class={`icon-${icon}`} aria-hidden="true" />
Expand Down
50 changes: 41 additions & 9 deletions src/lib/components/empty.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<script lang="ts">
import { app } from '$lib/stores/app';
import { Button } from '$lib/elements/forms';
import EmptyLight from '$lib/images/empty-light.svg';
import EmptyDark from '$lib/images/empty-dark.svg';
Expand All @@ -12,17 +13,48 @@
on:click
class="card u-grid u-cross-center u-width-full-line dashed"
class:common-section={single}>
<div class="u-flex u-flex-vertical u-cross-center">
{#if $app.themeInUse === 'dark'}
<img src={EmptyDark} alt="create" aria-hidden="true" />
{:else}
<img src={EmptyLight} alt="create" aria-hidden="true" />
{/if}
<slot />
</div>
{#if single}
<div class="u-flex u-flex-vertical u-cross-center u-gap-24">
{#if $app.themeInUse === 'dark'}
<img src={EmptyDark} alt="create" aria-hidden="true" />
{:else}
<img src={EmptyLight} alt="create" aria-hidden="true" />
{/if}
<slot />
</div>
{:else}
<div class="u-flex u-cross-center u-flex-vertical u-main-center u-flex">
<div class="common-section">
<Button secondary round>
<i class="icon-plus" />
</Button>
</div>
<div class="common-section">
<slot />
</div>
</div>
{/if}
</button>
{:else}
<article class="card u-grid u-cross-center u-width-full-line" class:common-section={single}>
<slot />
{#if single}
<div class="u-flex u-flex-vertical u-cross-center u-gap-24">
{#if $app.themeInUse === 'dark'}
<img src={EmptyDark} alt="create" aria-hidden="true" />
{:else}
<img src={EmptyLight} alt="create" aria-hidden="true" />
{/if}
<slot />
</div>
{:else}
<div class="common-section u-main-center u-flex">
<Button secondary round>
<i class="icon-plus" />
</Button>
</div>
<div class="common-section">
<slot />
</div>
{/if}
</article>
{/if}
22 changes: 22 additions & 0 deletions src/lib/components/emptySearch.svelte
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script lang="ts">
import { app } from '$lib/stores/app';
import Light from '$lib/images/search-light.svg';
import Dark from '$lib/images/search-dark.svg';
import Pagination from './pagination.svelte';
</script>

<article class="card u-grid u-cross-center u-width-full-line common-section">
<div class="u-flex u-flex-vertical u-cross-center u-gap-24">
{#if $app.themeInUse === 'dark'}
<img src={Dark} alt="create" aria-hidden="true" />
{:else}
<img src={Light} alt="create" aria-hidden="true" />
{/if}
<slot />
</div>
</article>

<div class="u-flex u-margin-block-start-32 u-main-space-between">
<p class="text">Total results: 0</p>
<Pagination limit={1} offset={0} sum={0} />
</div>
7 changes: 7 additions & 0 deletions src/lib/components/gridItem1.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@
</div>
</div>
</a>

<style>
/* TODO: remove this when ui library is updated*/
.grid-item-1 {
min-block-size: calc(182 / 16 * 1rem);
}
</style>
5 changes: 5 additions & 0 deletions src/lib/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export { default as Modal } from './modal.svelte';
export { default as Pagination } from './pagination.svelte';
export { default as Card } from './card.svelte';
export { default as CardGrid } from './cardGrid.svelte';
export { default as CardContainer } from './cardContainer.svelte';
export { default as InnerModal } from './innerModal.svelte';
export { default as Tile } from './tile.svelte';
export { default as Tiles } from './tiles.svelte';
Expand All @@ -12,10 +13,12 @@ export { default as UploadBox } from './uploadBox.svelte';
export { default as List } from './list.svelte';
export { default as ListItem } from './listItem.svelte';
export { default as Empty } from './empty.svelte';
export { default as EmptySearch } from './emptySearch.svelte';
export { default as DropList } from './dropList.svelte';
export { default as DropListItem } from './dropListItem.svelte';
export { default as DropListLink } from './dropListLink.svelte';
export { default as Collapsible } from './collapsible.svelte';
export { default as CollapsibleItem } from './collapsibleItem.svelte';
export { default as DropTabs } from './dropTabs.svelte';
export { default as DropTabsItem } from './dropTabsItem.svelte';
export { default as Avatar } from './avatar.svelte';
Expand All @@ -28,3 +31,5 @@ export { default as Steps } from './steps.svelte';
export { default as Step } from './step.svelte';
export { default as Code } from './code.svelte';
export { default as Json } from './json.svelte';
export { default as CustomId } from './customId.svelte';
export { default as Secret } from './secret.svelte';
2 changes: 1 addition & 1 deletion src/lib/components/modal.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
};
const closeModal = () => {
if (closable) {
show = false;
dispatch('close');
show = false;
}
};
Expand Down
Loading

0 comments on commit 1f68b1e

Please sign in to comment.