flowbite-svelte 0.10.1 → 0.10.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/forms/Checkbox.svelte +1 -1
- package/forms/Fileupload.svelte +4 -3
- package/forms/Fileupload.svelte.d.ts +2 -1
- package/forms/FloatingLabelInput.svelte +7 -3
- package/forms/FloatingLabelInput.svelte.d.ts +4 -3
- package/forms/Iconinput.svelte +26 -20
- package/forms/Iconinput.svelte.d.ts +5 -3
- package/forms/Input.svelte +23 -9
- package/forms/Input.svelte.d.ts +9 -8
- package/forms/Radio.svelte +3 -2
- package/forms/Radio.svelte.d.ts +1 -0
- package/forms/Select.svelte +3 -2
- package/forms/Select.svelte.d.ts +1 -0
- package/forms/SingleCheckbox.svelte +13 -4
- package/forms/SingleCheckbox.svelte.d.ts +1 -0
- package/forms/Textarea.svelte +3 -3
- package/forms/Textarea.svelte.d.ts +2 -1
- package/forms/Toggle.svelte +1 -3
- package/modals/ExtraLargeModal.svelte.d.ts +3 -2
- package/modals/LargeModal.svelte.d.ts +3 -2
- package/modals/MediumModal.svelte.d.ts +3 -2
- package/modals/ModalButton.svelte.d.ts +2 -1
- package/modals/SignInModal.svelte.d.ts +2 -1
- package/modals/SmallModal.svelte.d.ts +3 -2
- package/navbar/DropdownNavbar.svelte +4 -1
- package/navbar/DropdownNavbar.svelte.d.ts +3 -1
- package/navbar/Navbar.svelte +4 -1
- package/navbar/Navbar.svelte.d.ts +3 -1
- package/package.json +1 -1
package/README.md
CHANGED
package/forms/Checkbox.svelte
CHANGED
package/forms/Fileupload.svelte
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
<script >export let
|
|
1
|
+
<script >export let value = '';
|
|
2
|
+
export let id = 'user_avatar';
|
|
2
3
|
export let label = 'Upload file';
|
|
3
4
|
export let labelClass = 'block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300" for="user_avatar';
|
|
4
5
|
export let inputClass = 'block w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 cursor-pointer dark:text-gray-400 focus:outline-none focus:border-transparent dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400';
|
|
5
6
|
export let divClass = 'mt-1 text-sm text-gray-500 dark:text-gray-300';
|
|
6
|
-
export let helper;
|
|
7
|
+
export let helper = '';
|
|
7
8
|
</script>
|
|
8
9
|
|
|
9
10
|
<label class={labelClass} for={id}>{label}</label>
|
|
10
|
-
<input class={inputClass} aria-describedby="{id}_help" {id} type="file" />
|
|
11
|
+
<input bind:value class={inputClass} aria-describedby="{id}_help" {id} type="file" />
|
|
11
12
|
{#if helper}
|
|
12
13
|
<div class={divClass} id="{id}_help">{helper}</div>
|
|
13
14
|
{/if}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
+
value?: string;
|
|
4
5
|
id?: string;
|
|
5
6
|
label?: string;
|
|
6
7
|
labelClass?: string;
|
|
7
8
|
inputClass?: string;
|
|
8
9
|
divClass?: string;
|
|
9
|
-
helper
|
|
10
|
+
helper?: string;
|
|
10
11
|
};
|
|
11
12
|
events: {
|
|
12
13
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
<script >export let id;
|
|
2
2
|
export let type;
|
|
3
|
-
export let
|
|
4
|
-
export let
|
|
3
|
+
export let value = '';
|
|
4
|
+
export let name = '';
|
|
5
|
+
export let label = '';
|
|
5
6
|
export let required = false;
|
|
6
7
|
export let divClass = 'relative z-0 mb-6 w-full group';
|
|
7
8
|
export let inputClass = 'block py-2.5 px-0 w-full text-sm text-gray-900 bg-transparent border-0 border-b-2 border-gray-300 appearance-none dark:text-white dark:border-gray-600 dark:focus:border-blue-500 focus:outline-none focus:ring-0 focus:border-blue-600 peer';
|
|
8
9
|
export let labelClass = 'absolute text-sm text-gray-500 dark:text-gray-400 duration-300 transform -translate-y-6 scale-75 top-3 -z-10 origin-[0] peer-focus:left-0 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:translate-y-0 peer-focus:scale-75 peer-focus:-translate-y-6';
|
|
10
|
+
function setType(node) {
|
|
11
|
+
node.type = type;
|
|
12
|
+
}
|
|
9
13
|
</script>
|
|
10
14
|
|
|
11
15
|
<div class={divClass}>
|
|
12
|
-
<input
|
|
16
|
+
<input bind:value use:setType {name} class={inputClass} placeholder=" " {required} />
|
|
13
17
|
<label for={id} class={labelClass}>{label}</label>
|
|
14
18
|
</div>
|
|
@@ -2,9 +2,10 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
id: string;
|
|
5
|
-
type:
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
type: 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
|
6
|
+
value?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
label?: string;
|
|
8
9
|
required?: boolean;
|
|
9
10
|
divClass?: string;
|
|
10
11
|
inputClass?: string;
|
package/forms/Iconinput.svelte
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script >export let label;
|
|
2
2
|
export let id;
|
|
3
3
|
export let type;
|
|
4
|
+
export let value = '';
|
|
4
5
|
export let icon;
|
|
5
|
-
export let helper;
|
|
6
|
-
export let placeholder;
|
|
6
|
+
export let helper = '';
|
|
7
|
+
export let placeholder = '';
|
|
7
8
|
export let noBorder = false;
|
|
8
9
|
export let labelClass = 'block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300';
|
|
9
10
|
export let inputClass = 'rounded-none rounded-r-lg bg-gray-50 border border-gray-300 text-gray-900 focus:ring-blue-500 focus:border-blue-500 block flex-1 min-w-0 w-full text-sm border-gray-300 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500';
|
|
@@ -12,24 +13,29 @@ export let helperClass = 'mt-2 text-sm text-gray-500 dark:text-gray-400';
|
|
|
12
13
|
export let noBorderInputClass = 'bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500';
|
|
13
14
|
export let noBorderDivClass = 'flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none';
|
|
14
15
|
export let iconClass = 'h-4 w-4 mr-2';
|
|
16
|
+
function setType(node) {
|
|
17
|
+
node.type = type;
|
|
18
|
+
}
|
|
15
19
|
</script>
|
|
16
20
|
|
|
17
|
-
<
|
|
18
|
-
{
|
|
19
|
-
|
|
20
|
-
<div class=
|
|
21
|
-
<
|
|
21
|
+
<div class={$$props.class}>
|
|
22
|
+
<label for={id} class={labelClass}>{label}</label>
|
|
23
|
+
{#if noBorder}
|
|
24
|
+
<div class="relative">
|
|
25
|
+
<div class={noBorderDivClass}>
|
|
26
|
+
<svelte:component this={icon} className={iconClass} />
|
|
27
|
+
</div>
|
|
28
|
+
<input bind:value use:setType {id} class={noBorderInputClass} {placeholder} />
|
|
22
29
|
</div>
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<
|
|
29
|
-
</
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{
|
|
33
|
-
{
|
|
34
|
-
|
|
35
|
-
{/if}
|
|
30
|
+
{:else}
|
|
31
|
+
<div class="flex">
|
|
32
|
+
<span class={spanClass}>
|
|
33
|
+
<svelte:component this={icon} className={iconClass} />
|
|
34
|
+
</span>
|
|
35
|
+
<input {type} {id} class={inputClass} {placeholder} />
|
|
36
|
+
</div>
|
|
37
|
+
{/if}
|
|
38
|
+
{#if helper}
|
|
39
|
+
<p class={helperClass}>{@html helper}</p>
|
|
40
|
+
{/if}
|
|
41
|
+
</div>
|
|
@@ -2,12 +2,14 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
import type { SvelteComponent } from 'svelte';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
+
[x: string]: any;
|
|
5
6
|
label: string;
|
|
6
7
|
id: string;
|
|
7
|
-
type:
|
|
8
|
+
type: 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
|
9
|
+
value?: string;
|
|
8
10
|
icon: typeof SvelteComponent;
|
|
9
|
-
helper
|
|
10
|
-
placeholder
|
|
11
|
+
helper?: string;
|
|
12
|
+
placeholder?: string;
|
|
11
13
|
noBorder?: boolean;
|
|
12
14
|
labelClass?: string;
|
|
13
15
|
inputClass?: string;
|
package/forms/Input.svelte
CHANGED
|
@@ -1,22 +1,36 @@
|
|
|
1
1
|
<script >export let type;
|
|
2
|
-
export let
|
|
3
|
-
export let
|
|
4
|
-
export let
|
|
5
|
-
export let
|
|
6
|
-
export let
|
|
2
|
+
export let value = '';
|
|
3
|
+
export let name = '';
|
|
4
|
+
export let id = '';
|
|
5
|
+
export let label = '';
|
|
6
|
+
export let required = false;
|
|
7
|
+
export let placeholder = '';
|
|
7
8
|
export let size = 'text-sm';
|
|
8
9
|
export let inputClass = `bg-gray-50 border border-gray-300 text-gray-900 ${size} rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500`;
|
|
9
10
|
export let labelClass = 'block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300';
|
|
10
|
-
export let divClass = 'mb-6';
|
|
11
11
|
export let disabled = false;
|
|
12
12
|
export let readonly = false;
|
|
13
|
-
export let helper;
|
|
13
|
+
export let helper = '';
|
|
14
14
|
export let helperClass = 'mt-2 text-sm text-gray-500 dark:text-gray-400';
|
|
15
|
+
// you need to this to avoid 2-way binding
|
|
16
|
+
function setType(node) {
|
|
17
|
+
node.type = type;
|
|
18
|
+
}
|
|
15
19
|
</script>
|
|
16
20
|
|
|
17
|
-
<div class={
|
|
21
|
+
<div class={$$props.class}>
|
|
18
22
|
<label for={id} class={labelClass}>{label}</label>
|
|
19
|
-
<input
|
|
23
|
+
<input
|
|
24
|
+
bind:value
|
|
25
|
+
{name}
|
|
26
|
+
use:setType
|
|
27
|
+
{id}
|
|
28
|
+
class={inputClass}
|
|
29
|
+
{placeholder}
|
|
30
|
+
{required}
|
|
31
|
+
{disabled}
|
|
32
|
+
{readonly}
|
|
33
|
+
/>
|
|
20
34
|
{#if helper}
|
|
21
35
|
<p class={helperClass}>{@html helper}</p>
|
|
22
36
|
{/if}
|
package/forms/Input.svelte.d.ts
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
type: 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
|
6
|
+
value?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
id?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
required?: boolean;
|
|
11
|
+
placeholder?: string;
|
|
10
12
|
size?: 'sm:text-md' | 'text-sm' | 'sm:text-xs';
|
|
11
13
|
inputClass?: string;
|
|
12
14
|
labelClass?: string;
|
|
13
|
-
divClass?: string;
|
|
14
15
|
disabled?: boolean;
|
|
15
16
|
readonly?: boolean;
|
|
16
|
-
helper
|
|
17
|
+
helper?: string;
|
|
17
18
|
helperClass?: string;
|
|
18
19
|
};
|
|
19
20
|
events: {
|
package/forms/Radio.svelte
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script >export let
|
|
1
|
+
<script >export let legend = '';
|
|
2
|
+
export let divClass = 'flex items-center mb-4';
|
|
2
3
|
export let inputClass = 'w-4 h-4 border-gray-300 focus:ring-2 focus:ring-blue-300 dark:focus:ring-blue-600 dark:focus:bg-blue-600 dark:bg-gray-700 dark:border-gray-600';
|
|
3
4
|
export let labelClass = 'block ml-2 text-sm font-medium text-gray-900 dark:text-gray-300';
|
|
4
5
|
export let name = 'countries';
|
|
@@ -24,7 +25,7 @@ export let options = [
|
|
|
24
25
|
</script>
|
|
25
26
|
|
|
26
27
|
<fieldset>
|
|
27
|
-
<legend class="sr-only">
|
|
28
|
+
<legend class="sr-only">{legend}</legend>
|
|
28
29
|
{#each options as option}
|
|
29
30
|
<div class={divClass}>
|
|
30
31
|
<input
|
package/forms/Radio.svelte.d.ts
CHANGED
package/forms/Select.svelte
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script >export let
|
|
1
|
+
<script >export let value;
|
|
2
|
+
export let id = 'countries';
|
|
2
3
|
export let name = 'country';
|
|
3
4
|
export let label = 'Select your country';
|
|
4
5
|
export let labelClass = 'block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400';
|
|
@@ -6,6 +7,6 @@ export let selectClass = 'bg-gray-50 border border-gray-300 text-gray-900 text-s
|
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
9
|
<label for="countries" class={labelClass}>{label}</label>
|
|
9
|
-
<select {id} {name} class={selectClass}>
|
|
10
|
+
<select bind:value {id} {name} class={selectClass}>
|
|
10
11
|
<slot />
|
|
11
12
|
</select>
|
package/forms/Select.svelte.d.ts
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
<script >export let
|
|
2
|
-
export let
|
|
1
|
+
<script >export let checked = false;
|
|
2
|
+
export let id;
|
|
3
|
+
export let required = false;
|
|
3
4
|
export let label;
|
|
4
5
|
export let name;
|
|
5
6
|
export let inputClass = 'w-4 h-4 bg-gray-50 rounded border border-gray-300 focus:ring-3 focus:ring-blue-300 dark:bg-gray-700 dark:border-gray-600 dark:focus:ring-blue-600 dark:ring-offset-gray-800';
|
|
6
7
|
export let labelClass = 'font-medium text-gray-900 dark:text-gray-300';
|
|
7
8
|
</script>
|
|
8
9
|
|
|
9
|
-
<div class="flex items-start
|
|
10
|
+
<div class="flex items-start">
|
|
10
11
|
<div class="flex items-center h-5">
|
|
11
|
-
<input
|
|
12
|
+
<input
|
|
13
|
+
bind:checked
|
|
14
|
+
{id}
|
|
15
|
+
aria-describedby={id}
|
|
16
|
+
{name}
|
|
17
|
+
type="checkbox"
|
|
18
|
+
class={inputClass}
|
|
19
|
+
{required}
|
|
20
|
+
/>
|
|
12
21
|
</div>
|
|
13
22
|
<div class="ml-3 text-sm">
|
|
14
23
|
<label for={id} class={labelClass}>{label}</label>
|
package/forms/Textarea.svelte
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script >export let value = '';
|
|
2
2
|
export let id = 'message';
|
|
3
3
|
export let name = 'message';
|
|
4
4
|
export let label = 'Your message';
|
|
@@ -6,12 +6,12 @@ export let rows = 4;
|
|
|
6
6
|
export let placeholder = 'Leave a comment...';
|
|
7
7
|
export let labelClass = 'block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400';
|
|
8
8
|
export let textareaClass = 'block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500';
|
|
9
|
-
export let helper;
|
|
9
|
+
export let helper = '';
|
|
10
10
|
export let helperClass = 'mt-2 text-sm text-gray-500 dark:text-gray-400';
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
13
|
<label for={id} class={labelClass}>{label}</label>
|
|
14
|
-
<textarea {id} {name} {rows} class={textareaClass} {placeholder} />
|
|
14
|
+
<textarea bind:value {id} {name} {rows} class={textareaClass} {placeholder} />
|
|
15
15
|
{#if helper}
|
|
16
16
|
<p class={helperClass}>{@html helper}</p>
|
|
17
17
|
{/if}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
+
value?: string;
|
|
4
5
|
id?: string;
|
|
5
6
|
name?: string;
|
|
6
7
|
label?: string;
|
|
@@ -8,7 +9,7 @@ declare const __propDef: {
|
|
|
8
9
|
placeholder?: string;
|
|
9
10
|
labelClass?: string;
|
|
10
11
|
textareaClass?: string;
|
|
11
|
-
helper
|
|
12
|
+
helper?: string;
|
|
12
13
|
helperClass?: string;
|
|
13
14
|
};
|
|
14
15
|
events: {
|
package/forms/Toggle.svelte
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<script
|
|
2
|
-
// export let props: ToggleType = {
|
|
3
|
-
export let name = 'toggle-example';
|
|
1
|
+
<script >export let name = 'toggle-example';
|
|
4
2
|
export let id = 'toggle-example';
|
|
5
3
|
export let label = 'Toggle me';
|
|
6
4
|
export let checked = false;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Colors } from '../types';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
id?: string;
|
|
5
|
-
btnColor?:
|
|
6
|
-
textColor?:
|
|
6
|
+
btnColor?: Colors;
|
|
7
|
+
textColor?: Colors;
|
|
7
8
|
title?: string;
|
|
8
9
|
btn1: string;
|
|
9
10
|
btn2: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Colors } from '../types';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
id?: string;
|
|
5
|
-
btnColor?:
|
|
6
|
-
textColor?:
|
|
6
|
+
btnColor?: Colors;
|
|
7
|
+
textColor?: Colors;
|
|
7
8
|
title?: string;
|
|
8
9
|
btn1: string;
|
|
9
10
|
btn2: string;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Colors } from '../types';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
id?: string;
|
|
5
|
-
btnColor?:
|
|
6
|
-
textColor?:
|
|
6
|
+
btnColor?: Colors;
|
|
7
|
+
textColor?: Colors;
|
|
7
8
|
title?: string;
|
|
8
9
|
btn1: string;
|
|
9
10
|
btn2: string;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Colors } from '../types';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
id?: string;
|
|
5
|
-
btnSignInColor?:
|
|
6
|
+
btnSignInColor?: Colors;
|
|
6
7
|
titleSignIn?: string;
|
|
7
8
|
lostPasswordLink: string;
|
|
8
9
|
rememberMe?: boolean;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Colors } from '../types';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
id?: string;
|
|
5
|
-
btnColor?:
|
|
6
|
-
textColor?:
|
|
6
|
+
btnColor?: Colors;
|
|
7
|
+
textColor?: Colors;
|
|
7
8
|
title?: string;
|
|
8
9
|
btn1: string;
|
|
9
10
|
btn2: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script >import { page } from '$app/stores';
|
|
1
|
+
<script >import { page, session } from '$app/stores';
|
|
2
2
|
let hidden = true;
|
|
3
3
|
let block = false;
|
|
4
4
|
let activeDropdown = undefined;
|
|
@@ -112,6 +112,9 @@ export let liButtonClass = `flex justify-between items-center py-2 pr-4 pl-3 w-f
|
|
|
112
112
|
{/if}
|
|
113
113
|
{/each}
|
|
114
114
|
</ul>
|
|
115
|
+
{#if $session['user']}
|
|
116
|
+
<slot name="user" />
|
|
117
|
+
{/if}
|
|
115
118
|
</div>
|
|
116
119
|
</div>
|
|
117
120
|
</nav>
|
|
@@ -18,7 +18,9 @@ declare const __propDef: {
|
|
|
18
18
|
events: {
|
|
19
19
|
[evt: string]: CustomEvent<any>;
|
|
20
20
|
};
|
|
21
|
-
slots: {
|
|
21
|
+
slots: {
|
|
22
|
+
user: {};
|
|
23
|
+
};
|
|
22
24
|
};
|
|
23
25
|
export declare type DropdownNavbarProps = typeof __propDef.props;
|
|
24
26
|
export declare type DropdownNavbarEvents = typeof __propDef.events;
|
package/navbar/Navbar.svelte
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<script >import { page } from '$app/stores';
|
|
1
|
+
<script >import { page, session } from '$app/stores';
|
|
2
2
|
export let sitename = 'Svelte Flow';
|
|
3
3
|
export let logo = '/images/mkdir-logo.png';
|
|
4
4
|
export let alt = 'Svelte Flow';
|
|
@@ -61,6 +61,9 @@ export let liLinkClass = `block py-2 pr-4 pl-3 text-gray-700 border-b border-gr
|
|
|
61
61
|
</li>
|
|
62
62
|
{/each}
|
|
63
63
|
</ul>
|
|
64
|
+
{#if $session['user']}
|
|
65
|
+
<slot name="user" />
|
|
66
|
+
{/if}
|
|
64
67
|
</div>
|
|
65
68
|
</div>
|
|
66
69
|
</nav>
|
|
@@ -15,7 +15,9 @@ declare const __propDef: {
|
|
|
15
15
|
events: {
|
|
16
16
|
[evt: string]: CustomEvent<any>;
|
|
17
17
|
};
|
|
18
|
-
slots: {
|
|
18
|
+
slots: {
|
|
19
|
+
user: {};
|
|
20
|
+
};
|
|
19
21
|
};
|
|
20
22
|
export declare type NavbarProps = typeof __propDef.props;
|
|
21
23
|
export declare type NavbarEvents = typeof __propDef.events;
|