-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add on_close prop for passing in a callback to perform when Res…
…ponsiveSlideover close is triggered
- Loading branch information
Showing
4 changed files
with
30 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,6 @@ | ||
<script lang="ts"> | ||
import Button from '$lib/ui/Button.svelte'; | ||
import { toast } from '$lib/ui/Toasts.svelte'; | ||
</script> | ||
|
||
# Svelte Pieces | ||
|
||
Install with `npm i -D svelte-pieces`. | ||
|
||
Built using Kitbook, Windicss, and Iconify icons - you don't need Tailwind nor Windi installed for these components to work properly as the classes get generated at packaging time. | ||
|
||
## Smoke Test | ||
<Button onclick={() => toast('hello')}>Push Toast</Button> | ||
Built using Kitbook, UnoCSS, and Iconify icons - you don't need UnoCSS installed for these components to work properly as the classes get generated at packaging time thanks to `@unocss/svelte-scoped`'s [preprocessor](https://unocss.dev/integrations/svelte-scoped#svelte-preprocessor). | ||
|
||
{#await import('$lib/ui/Toasts.svelte') then { default: Toasts }} | ||
<Toasts /> | ||
{/await} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script lang="ts"> | ||
import ShowHide from '$lib/functions/ShowHide.svelte'; | ||
import Button from './Button.svelte'; | ||
import ResponsiveSlideover from './ResponsiveSlideover.svelte'; | ||
|
||
let size: 'sm' | 'md' | 'lg' | 'xl' = 'xl'; | ||
</script> | ||
|
||
<ShowHide let:show let:toggle> | ||
<Button color="primary" onclick={toggle}>Show Slideover</Button> | ||
<Button form="menu" active={size === 'sm'} onclick={() => size = 'sm'}>Size: sm</Button> | ||
<Button form="menu" active={size === 'md'} onclick={() => size = 'md'}>Size: md</Button> | ||
<Button form="menu" active={size === 'lg'} onclick={() => size = 'lg'}>Size: lg</Button> | ||
<Button form="menu" active={size === 'xl'} onclick={() => size = 'xl'}>Size: xl</Button> | ||
|
||
<ResponsiveSlideover showWidth={size} open={show} on_close={toggle}> | ||
<div slot="title">Universal Title</div> | ||
<div class="p-3 border-b font-semibold" slot="heading">Universal Heading</div> | ||
<div class="p-3 border-b font-semibold" slot="desktopHeading">Desktop Heading</div> | ||
<div class="p-3 border-b font-semibold" slot="mobileHeading">Mobile Heading</div> | ||
<div class="p-3 hover:bg-gray-100">Menu Item</div> | ||
<div class="p-3 hover:bg-gray-100">Menu Item</div> | ||
<div class="p-3 hover:bg-gray-100">Menu Item</div> | ||
<div class="p-3 hover:bg-gray-100">Menu Item</div> | ||
</ResponsiveSlideover> | ||
</ShowHide> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters