flowbite-svelte 0.9.4 → 0.9.7
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/accordions/AccordionItem.svelte +1 -1
- package/accordions/AccordionItem.svelte.d.ts +1 -1
- package/auth/Confirm.svelte +23 -0
- package/auth/Confirm.svelte.d.ts +19 -0
- package/auth/ForgotPassword.svelte +57 -0
- package/auth/ForgotPassword.svelte.d.ts +21 -0
- package/auth/Login.svelte +128 -0
- package/auth/Login.svelte.d.ts +24 -0
- package/auth/Register.svelte +116 -0
- package/auth/Register.svelte.d.ts +23 -0
- package/auth/Reset.svelte +57 -0
- package/auth/Reset.svelte.d.ts +22 -0
- package/buttons/Button.svelte +16 -15
- package/buttons/Button.svelte.d.ts +3 -2
- package/buttons/ColorShadowButton.svelte +2 -1
- package/buttons/ColorShadowButton.svelte.d.ts +2 -1
- package/buttons/GradientDuotoneButton.svelte +2 -1
- package/buttons/GradientDuotoneButton.svelte.d.ts +2 -1
- package/buttons/GradientMonochromeButton.svelte +2 -1
- package/buttons/GradientMonochromeButton.svelte.d.ts +2 -1
- package/buttons/GradientOutlineButton.svelte +2 -1
- package/buttons/GradientOutlineButton.svelte.d.ts +2 -1
- package/cards/Card.svelte +6 -7
- package/cards/Card.svelte.d.ts +5 -4
- package/cards/CtaCard.svelte +2 -3
- package/cards/CtaCard.svelte.d.ts +1 -0
- package/cards/EcommerceCard.svelte +3 -2
- package/cards/EcommerceCard.svelte.d.ts +2 -1
- package/cards/HorizontalCard.svelte +14 -17
- package/cards/HorizontalCard.svelte.d.ts +8 -3
- package/cards/InteractiveCard.svelte +2 -3
- package/cards/InteractiveCard.svelte.d.ts +3 -2
- package/cards/ListCard.svelte +43 -79
- package/cards/ListCard.svelte.d.ts +9 -40
- package/cards/SignInCard.svelte +114 -111
- package/cards/SignInCard.svelte.d.ts +9 -32
- package/dropdowns/DropdownDefault.svelte +84 -93
- package/dropdowns/DropdownDefault.svelte.d.ts +7 -35
- package/index.d.ts +6 -1
- package/index.js +14 -0
- package/list-group/List.svelte +42 -74
- package/list-group/List.svelte.d.ts +7 -23
- package/navbar/DropdownNavbar.svelte +16 -19
- package/navbar/DropdownNavbar.svelte.d.ts +7 -0
- package/navbar/Navbar.svelte +10 -13
- package/navbar/Navbar.svelte.d.ts +4 -0
- package/package.json +7 -2
- package/spinners/Spinner.svelte +1 -1
- package/spinners/Spinner.svelte.d.ts +1 -1
- package/spinners/SpinnerButton.svelte +1 -1
- package/types.d.ts +19 -5
package/list-group/List.svelte
CHANGED
|
@@ -1,79 +1,47 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
link: "/profile",
|
|
7
|
-
rel: "",
|
|
8
|
-
},
|
|
9
|
-
{
|
|
10
|
-
title: "Settings",
|
|
11
|
-
icon: "",
|
|
12
|
-
link: "/settings",
|
|
13
|
-
rel: "",
|
|
14
|
-
},
|
|
15
|
-
{
|
|
16
|
-
title: "Messages",
|
|
17
|
-
icon: "",
|
|
18
|
-
link: "/message",
|
|
19
|
-
rel: "",
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
title: "Download",
|
|
23
|
-
icon: "",
|
|
24
|
-
link: "/download",
|
|
25
|
-
rel: "",
|
|
26
|
-
},
|
|
27
|
-
];
|
|
28
|
-
// let len = count($lists);
|
|
29
|
-
// top rounded-t-lg border-b border-gray-200
|
|
30
|
-
// middle border-b border-gray-200
|
|
31
|
-
// bottom rounded-b-lg
|
|
32
|
-
const common =
|
|
33
|
-
"inline-flex relative items-center py-2 px-4 w-full text-sm font-medium hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:border-gray-600 dark:hover:bg-gray-600 dark:hover:text-white dark:focus:ring-gray-500 dark:focus:text-white";
|
|
34
|
-
const topClass = `${common} rounded-t-lg border-b border-gray-200`;
|
|
35
|
-
const bottomClass = `${common} rounded-b-lg`;
|
|
36
|
-
const middleClass = `${common} border-b border-gray-200`;
|
|
37
|
-
let listClass;
|
|
1
|
+
<script >export let lists;
|
|
2
|
+
const common = 'inline-flex relative items-center py-2 px-4 w-full text-sm font-medium hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:border-gray-600 dark:hover:bg-gray-600 dark:hover:text-white dark:focus:ring-gray-500 dark:focus:text-white';
|
|
3
|
+
const topClass = `${common} rounded-t-lg border-b border-gray-200`;
|
|
4
|
+
const bottomClass = `${common} rounded-b-lg`;
|
|
5
|
+
const middleClass = `${common} border-b border-gray-200`;
|
|
38
6
|
</script>
|
|
39
7
|
|
|
40
8
|
<div
|
|
41
|
-
|
|
9
|
+
class="w-48 text-gray-900 bg-white rounded-lg border border-gray-200 dark:bg-gray-700 dark:border-gray-600 dark:text-white"
|
|
42
10
|
>
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
11
|
+
{#each lists as { name, icon, href, rel }, i}
|
|
12
|
+
{#if i === 0}
|
|
13
|
+
<button type="button" class={topClass}>
|
|
14
|
+
{#if icon}
|
|
15
|
+
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
16
|
+
{/if}
|
|
17
|
+
{#if href}
|
|
18
|
+
<a {href} {rel}>{name}</a>
|
|
19
|
+
{:else}
|
|
20
|
+
{name} here
|
|
21
|
+
{/if}
|
|
22
|
+
</button>
|
|
23
|
+
{:else if i === lists.length - 1}
|
|
24
|
+
<button type="button" class={bottomClass}>
|
|
25
|
+
{#if icon}
|
|
26
|
+
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
27
|
+
{/if}
|
|
28
|
+
{#if href}
|
|
29
|
+
<a {href} {rel}>{name}</a>
|
|
30
|
+
{:else}
|
|
31
|
+
{name}
|
|
32
|
+
{/if}
|
|
33
|
+
</button>
|
|
34
|
+
{:else}
|
|
35
|
+
<button type="button" class={middleClass}>
|
|
36
|
+
{#if icon}
|
|
37
|
+
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
38
|
+
{/if}
|
|
39
|
+
{#if href}
|
|
40
|
+
<a {href} {rel}>{name}</a>
|
|
41
|
+
{:else}
|
|
42
|
+
{name}
|
|
43
|
+
{/if}
|
|
44
|
+
</button>
|
|
45
|
+
{/if}
|
|
46
|
+
{/each}
|
|
79
47
|
</div>
|
|
@@ -1,33 +1,17 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} ListProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} ListEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} ListSlots */
|
|
4
|
-
export default class List extends SvelteComponentTyped<{
|
|
5
|
-
lists?: {
|
|
6
|
-
title: string;
|
|
7
|
-
icon: string;
|
|
8
|
-
link: string;
|
|
9
|
-
rel: string;
|
|
10
|
-
}[];
|
|
11
|
-
}, {
|
|
12
|
-
[evt: string]: CustomEvent<any>;
|
|
13
|
-
}, {}> {
|
|
14
|
-
}
|
|
15
|
-
export type ListProps = typeof __propDef.props;
|
|
16
|
-
export type ListEvents = typeof __propDef.events;
|
|
17
|
-
export type ListSlots = typeof __propDef.slots;
|
|
18
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { ButtonGroupType } from '../types';
|
|
19
3
|
declare const __propDef: {
|
|
20
4
|
props: {
|
|
21
|
-
lists
|
|
22
|
-
title: string;
|
|
23
|
-
icon: string;
|
|
24
|
-
link: string;
|
|
25
|
-
rel: string;
|
|
26
|
-
}[];
|
|
5
|
+
lists: ButtonGroupType[];
|
|
27
6
|
};
|
|
28
7
|
events: {
|
|
29
8
|
[evt: string]: CustomEvent<any>;
|
|
30
9
|
};
|
|
31
10
|
slots: {};
|
|
32
11
|
};
|
|
12
|
+
export declare type ListProps = typeof __propDef.props;
|
|
13
|
+
export declare type ListEvents = typeof __propDef.events;
|
|
14
|
+
export declare type ListSlots = typeof __propDef.slots;
|
|
15
|
+
export default class List extends SvelteComponentTyped<ListProps, ListEvents, ListSlots> {
|
|
16
|
+
}
|
|
33
17
|
export {};
|
|
@@ -16,21 +16,26 @@ export let logo = '/images/mkdir-logo.png';
|
|
|
16
16
|
export let alt;
|
|
17
17
|
export let textsize = 'text-sm';
|
|
18
18
|
export let menus;
|
|
19
|
+
export let navClass = 'px-2 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700';
|
|
20
|
+
const navDivClass = 'container flex flex-wrap justify-between items-center mx-auto';
|
|
21
|
+
export let spanClass = 'self-center text-lg font-semibold text-gray-900 whitespace-nowrap dark:text-white';
|
|
22
|
+
export let buttonClass = 'inline-flex justify-center items-center ml-3 text-gray-400 rounded-lg md:hidden hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-300 dark:text-gray-400 dark:hover:text-white dark:focus:ring-gray-500';
|
|
23
|
+
export let dropdownDiv = 'z-10 w-44 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 dark:divide-gray-600';
|
|
24
|
+
export let dropdownLinkClassWithChild = `block py-2 px-4 ${textsize} text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-400 dark:hover:text-white`;
|
|
25
|
+
export let dropdownLinkClassWithoutChild = `block py-2 pr-4 pl-3 text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 dark:text-gray-400 dark:hover:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent ${textsize}`;
|
|
26
|
+
export let liButtonClass = `flex justify-between items-center py-2 pr-4 pl-3 w-full ${textsize} font-medium text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 md:w-auto dark:text-gray-400 dark:hover:text-white dark:focus:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent`;
|
|
19
27
|
</script>
|
|
20
28
|
|
|
21
|
-
<nav class=
|
|
22
|
-
<div class=
|
|
29
|
+
<nav class={navClass}>
|
|
30
|
+
<div class={navDivClass}>
|
|
23
31
|
<a href="/" class="flex">
|
|
24
32
|
<img src={logo} {alt} />
|
|
25
|
-
<span
|
|
26
|
-
class="self-center text-lg font-semibold text-gray-900 whitespace-nowrap dark:text-white"
|
|
27
|
-
>{sitename}</span
|
|
28
|
-
>
|
|
33
|
+
<span class={spanClass}>{sitename}</span>
|
|
29
34
|
</a>
|
|
30
35
|
<button
|
|
31
36
|
on:click={handleClickbtn}
|
|
32
37
|
type="button"
|
|
33
|
-
class=
|
|
38
|
+
class={buttonClass}
|
|
34
39
|
aria-controls="mobile-menu-2"
|
|
35
40
|
aria-expanded="false"
|
|
36
41
|
>
|
|
@@ -63,9 +68,7 @@ export let menus;
|
|
|
63
68
|
{#each menus as { id, name, href, rel, child }}
|
|
64
69
|
{#if child}
|
|
65
70
|
<li>
|
|
66
|
-
<button
|
|
67
|
-
on:click={() => handleDropdown(id)}
|
|
68
|
-
class="flex justify-between items-center py-2 pr-4 pl-3 w-full {textsize} font-medium text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 md:w-auto dark:text-gray-400 dark:hover:text-white dark:focus:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent"
|
|
71
|
+
<button on:click={() => handleDropdown(id)} class={liButtonClass}
|
|
69
72
|
>{name}
|
|
70
73
|
<svg
|
|
71
74
|
class="ml-1 w-4 h-4"
|
|
@@ -84,18 +87,13 @@ export let menus;
|
|
|
84
87
|
<div
|
|
85
88
|
class:hidden
|
|
86
89
|
class:block
|
|
87
|
-
class=
|
|
90
|
+
class={dropdownDiv}
|
|
88
91
|
style="position: absolute; margin: 0px;"
|
|
89
92
|
>
|
|
90
93
|
<ul class="py-1" aria-labelledby="dropdownLargeButton">
|
|
91
94
|
{#each child as item}
|
|
92
95
|
<li>
|
|
93
|
-
<a
|
|
94
|
-
href={item.href}
|
|
95
|
-
{rel}
|
|
96
|
-
class="block py-2 px-4 text-{textsize} text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-400 dark:hover:text-white"
|
|
97
|
-
>{item.name}</a
|
|
98
|
-
>
|
|
96
|
+
<a href={item.href} {rel} class={dropdownLinkClassWithChild}>{item.name}</a>
|
|
99
97
|
</li>
|
|
100
98
|
{/each}
|
|
101
99
|
</ul>
|
|
@@ -108,8 +106,7 @@ export let menus;
|
|
|
108
106
|
class:active={$page.url.pathname === href}
|
|
109
107
|
{href}
|
|
110
108
|
{rel}
|
|
111
|
-
class=
|
|
112
|
-
>{name}</a
|
|
109
|
+
class={dropdownLinkClassWithoutChild}>{name}</a
|
|
113
110
|
>
|
|
114
111
|
</li>
|
|
115
112
|
{/if}
|
|
@@ -7,6 +7,13 @@ declare const __propDef: {
|
|
|
7
7
|
alt: string;
|
|
8
8
|
textsize?: string;
|
|
9
9
|
menus: NavbarType[];
|
|
10
|
+
navClass?: string;
|
|
11
|
+
spanClass?: string;
|
|
12
|
+
buttonClass?: string;
|
|
13
|
+
dropdownDiv?: string;
|
|
14
|
+
dropdownLinkClassWithChild?: string;
|
|
15
|
+
dropdownLinkClassWithoutChild?: string;
|
|
16
|
+
liButtonClass?: string;
|
|
10
17
|
};
|
|
11
18
|
events: {
|
|
12
19
|
[evt: string]: CustomEvent<any>;
|
package/navbar/Navbar.svelte
CHANGED
|
@@ -8,21 +8,23 @@ const handleClickbtn = () => {
|
|
|
8
8
|
barHidden = !barHidden;
|
|
9
9
|
};
|
|
10
10
|
export let menus;
|
|
11
|
+
export let navClass = 'px-2 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700';
|
|
12
|
+
const navDivClass = 'container flex flex-wrap justify-between items-center mx-auto';
|
|
13
|
+
export let spanClass = 'self-center text-lg font-semibold text-gray-900 whitespace-nowrap dark:text-white';
|
|
14
|
+
export let buttonClass = 'inline-flex justify-center items-center ml-3 text-gray-400 rounded-lg md:hidden hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-300 dark:text-gray-400 dark:hover:text-white dark:focus:ring-gray-500';
|
|
15
|
+
export let liLinkClass = `block py-2 pr-4 pl-3 text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 dark:text-gray-400 dark:hover:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent ${textsize}`;
|
|
11
16
|
</script>
|
|
12
17
|
|
|
13
|
-
<nav class=
|
|
14
|
-
<div class=
|
|
18
|
+
<nav class={navClass}>
|
|
19
|
+
<div class={navDivClass}>
|
|
15
20
|
<a href="/" class="flex">
|
|
16
21
|
<img src={logo} {alt} />
|
|
17
|
-
<span
|
|
18
|
-
class="self-center text-lg font-semibold text-gray-900 whitespace-nowrap dark:text-white"
|
|
19
|
-
>{sitename}</span
|
|
20
|
-
>
|
|
22
|
+
<span class={spanClass}>{sitename}</span>
|
|
21
23
|
</a>
|
|
22
24
|
<button
|
|
23
25
|
on:click={handleClickbtn}
|
|
24
26
|
type="button"
|
|
25
|
-
class=
|
|
27
|
+
class={buttonClass}
|
|
26
28
|
aria-controls="mobile-menu-2"
|
|
27
29
|
aria-expanded="false"
|
|
28
30
|
>
|
|
@@ -54,12 +56,7 @@ export let menus;
|
|
|
54
56
|
<ul class="flex flex-col mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium">
|
|
55
57
|
{#each menus as { name, href, rel }}
|
|
56
58
|
<li>
|
|
57
|
-
<a
|
|
58
|
-
class:active={$page.url.pathname === href}
|
|
59
|
-
{href}
|
|
60
|
-
{rel}
|
|
61
|
-
class="block py-2 pr-4 pl-3 text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 dark:text-gray-400 dark:hover:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent {textsize}"
|
|
62
|
-
>{name}</a
|
|
59
|
+
<a class:active={$page.url.pathname === href} {href} {rel} class={liLinkClass}>{name}</a
|
|
63
60
|
>
|
|
64
61
|
</li>
|
|
65
62
|
{/each}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.7",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Shinichi Okada",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"homepage": "https://github.com/shinokada/flowbite-svelte",
|
|
12
12
|
"license": "MIT",
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@codewithshin/svelte-sidebar": "^0.2
|
|
14
|
+
"@codewithshin/svelte-sidebar": "^0.4.2",
|
|
15
15
|
"@codewithshin/svelte-simpleicons": "^0.2.2",
|
|
16
16
|
"@codewithshin/svelte-utterances": "^0.1.2",
|
|
17
17
|
"@playwright/test": "^1.19.1",
|
|
@@ -74,6 +74,11 @@
|
|
|
74
74
|
"./alerts/Alert.svelte": "./alerts/Alert.svelte",
|
|
75
75
|
"./alerts/BorderAlert.svelte": "./alerts/BorderAlert.svelte",
|
|
76
76
|
"./alerts/InfoAlert.svelte": "./alerts/InfoAlert.svelte",
|
|
77
|
+
"./auth/Confirm.svelte": "./auth/Confirm.svelte",
|
|
78
|
+
"./auth/ForgotPassword.svelte": "./auth/ForgotPassword.svelte",
|
|
79
|
+
"./auth/Login.svelte": "./auth/Login.svelte",
|
|
80
|
+
"./auth/Register.svelte": "./auth/Register.svelte",
|
|
81
|
+
"./auth/Reset.svelte": "./auth/Reset.svelte",
|
|
77
82
|
"./badges/Badge.svelte": "./badges/Badge.svelte",
|
|
78
83
|
"./badges/BadgeIcon.svelte": "./badges/BadgeIcon.svelte",
|
|
79
84
|
"./badges/BadgeLink.svelte": "./badges/BadgeLink.svelte",
|
package/spinners/Spinner.svelte
CHANGED
package/types.d.ts
CHANGED
|
@@ -60,12 +60,26 @@ export interface NavbarType {
|
|
|
60
60
|
rel?: string;
|
|
61
61
|
child?: NavbarType[];
|
|
62
62
|
}
|
|
63
|
-
export interface DropdownLinkType {
|
|
64
|
-
name: string;
|
|
65
|
-
href: string;
|
|
66
|
-
rel?: string;
|
|
67
|
-
}
|
|
68
63
|
export interface SocialMediaLinkType {
|
|
69
64
|
parent: string;
|
|
70
65
|
children?: LinkType[];
|
|
71
66
|
}
|
|
67
|
+
export interface DropdownType {
|
|
68
|
+
name: string;
|
|
69
|
+
href: string;
|
|
70
|
+
divider: boolean;
|
|
71
|
+
}
|
|
72
|
+
export interface ListCardType {
|
|
73
|
+
img: ImgType;
|
|
74
|
+
field1: string;
|
|
75
|
+
field2?: string;
|
|
76
|
+
field3?: string;
|
|
77
|
+
}
|
|
78
|
+
export declare type AuthFunctionType = () => Promise<string>;
|
|
79
|
+
export declare type ButtonType = 'button' | 'submit' | 'reset';
|
|
80
|
+
export interface AuthFieldType {
|
|
81
|
+
label: string;
|
|
82
|
+
fieldtype: string;
|
|
83
|
+
required?: boolean;
|
|
84
|
+
placeholder?: string;
|
|
85
|
+
}
|