flowbite-svelte 0.12.0 → 0.12.3
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 +82 -27
- package/alerts/Alert.svelte.d.ts +1 -1
- package/cards/InteractiveCard.svelte +3 -3
- package/index.d.ts +5 -0
- package/index.js +6 -3
- package/modals/ExtraLargeModal.svelte +2 -2
- package/modals/ExtraLargeModal.svelte.d.ts +2 -1
- package/modals/LargeModal.svelte +2 -2
- package/modals/LargeModal.svelte.d.ts +2 -1
- package/modals/MediumModal.svelte +2 -2
- package/modals/MediumModal.svelte.d.ts +2 -1
- package/modals/SignInModal.svelte +2 -2
- package/modals/SignInModal.svelte.d.ts +2 -1
- package/modals/SmallModal.svelte +2 -2
- package/modals/SmallModal.svelte.d.ts +2 -1
- package/navbar/DropdownNavbar.svelte +10 -42
- package/navbar/NavDropdown.svelte +41 -0
- package/navbar/NavDropdown.svelte.d.ts +22 -0
- package/navbar/Navbar.svelte +2 -2
- package/navbar/Navbar.svelte.d.ts +1 -1
- package/package.json +9 -1
- package/sidebars/Sidebar.svelte +2 -49
- package/sidebars/SidebarDropdown.svelte +50 -0
- package/sidebars/SidebarDropdown.svelte.d.ts +17 -0
- package/tabs/FullWidthTabs.svelte +31 -0
- package/tabs/FullWidthTabs.svelte.d.ts +18 -0
- package/tabs/IconTabs.svelte +24 -0
- package/tabs/IconTabs.svelte.d.ts +18 -0
- package/tabs/InteractiveTabHead.svelte +53 -0
- package/tabs/InteractiveTabHead.svelte.d.ts +37 -0
- package/tabs/InteractiveTabs.svelte +1 -1
- package/tabs/TabContent.svelte +32 -0
- package/tabs/TabContent.svelte.d.ts +36 -0
- package/tabs/UnderlineTabs.svelte +20 -0
- package/tabs/UnderlineTabs.svelte.d.ts +18 -0
- package/tabs/tabStore.d.ts +2 -0
- package/tabs/tabStore.js +2 -0
- package/types.d.ts +11 -1
package/README.md
CHANGED
|
@@ -4,84 +4,139 @@
|
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
|
-
[Getting started](https://flowbite-svelte.vercel.app/getting-started)
|
|
7
|
+
- [Getting started](https://flowbite-svelte.vercel.app/getting-started)
|
|
8
|
+
- [About](https://flowbite-svelte.vercel.app/about)
|
|
9
|
+
- [Type list](https://flowbite-svelte.vercel.app/type-list)
|
|
10
|
+
- [CLI](https://flowbite-svelte.vercel.app/cli)
|
|
8
11
|
|
|
9
12
|
## Accordion components
|
|
10
13
|
|
|
11
|
-
[
|
|
14
|
+
- [Default accordion](https://flowbite-svelte.vercel.app/accordions/default)
|
|
15
|
+
- [Icon accordion](https://flowbite-svelte.vercel.app/accordions/icon-accordion)
|
|
12
16
|
|
|
13
|
-
##
|
|
17
|
+
## Alert components
|
|
14
18
|
|
|
15
|
-
[
|
|
19
|
+
- [Default alert](https://flowbite-svelte.vercel.app/alerts/default-alert)
|
|
20
|
+
- [Border alert](https://flowbite-svelte.vercel.app/alerts/border-alert)
|
|
21
|
+
- [Information alert](https://flowbite-svelte.vercel.app/alerts/information-alert)
|
|
22
|
+
- [Animation alert](https://flowbite-svelte.vercel.app/alerts/animation)
|
|
16
23
|
|
|
17
|
-
##
|
|
24
|
+
## Avatar components
|
|
18
25
|
|
|
19
|
-
[
|
|
26
|
+
- [Avatar](https://flowbite-svelte.vercel.app/avatar)
|
|
20
27
|
|
|
21
28
|
## Badges components
|
|
22
29
|
|
|
23
|
-
[
|
|
30
|
+
- [Default badge](https://flowbite-svelte.vercel.app/badges/default)
|
|
31
|
+
- [Icon badge](https://flowbite-svelte.vercel.app/badges/badge-icon)
|
|
32
|
+
- [Link badge](https://flowbite-svelte.vercel.app/badges/badge-link)
|
|
24
33
|
|
|
25
34
|
## Button group compnents
|
|
26
35
|
|
|
27
|
-
[
|
|
36
|
+
- [Default button group](https://flowbite-svelte.vercel.app/button-groups/default)
|
|
37
|
+
- [Outline button group](https://flowbite-svelte.vercel.app/button-groups/outline)
|
|
28
38
|
|
|
29
39
|
## Button components
|
|
30
40
|
|
|
31
|
-
[
|
|
41
|
+
- [Setup](https://flowbite-svelte.vercel.app/buttons/setup)
|
|
42
|
+
- [Default Button](https://flowbite-svelte.vercel.app/buttons/default)
|
|
43
|
+
- [Colored Shadow Button](https://flowbite-svelte.vercel.app/buttons/colored-shadow)
|
|
44
|
+
- [Gradient Duotone Button](https://flowbite-svelte.vercel.app/buttons/gradient-duotone)
|
|
45
|
+
- [Gradient Monochrome Button](https://flowbite-svelte.vercel.app/buttons/gradient-monochrome)
|
|
46
|
+
- [Gradietn Outline Button](https://flowbite-svelte.vercel.app/buttons/gradient-outline)
|
|
47
|
+
- [Outlined Button](https://flowbite-svelte.vercel.app/buttons/outlined)
|
|
48
|
+
- [Rounded Button](https://flowbite-svelte.vercel.app/buttons/rounded)
|
|
32
49
|
|
|
33
50
|
## Card components
|
|
34
51
|
|
|
35
|
-
[
|
|
52
|
+
- [Default Card](https://flowbite-svelte.vercel.app/cards/card)
|
|
53
|
+
- [CTA Card](https://flowbite-svelte.vercel.app/cards/cta)
|
|
54
|
+
- [Ecommerce Card](https://flowbite-svelte.vercel.app/cards/ecommerce)
|
|
55
|
+
- [Horizontal Card](https://flowbite-svelte.vercel.app/cards/horizontal)
|
|
56
|
+
- [Interactive Card](https://flowbite-svelte.vercel.app/cards/interactive)
|
|
57
|
+
- [List Card](https://flowbite-svelte.vercel.app/cards/list)
|
|
58
|
+
- [Signin Card](https://flowbite-svelte.vercel.app/cards/signin)
|
|
36
59
|
|
|
37
|
-
## Dark mode
|
|
60
|
+
## Dark mode components
|
|
38
61
|
|
|
39
|
-
[Dark mode](https://flowbite-svelte.vercel.app/darkmode)
|
|
62
|
+
- [Dark mode](https://flowbite-svelte.vercel.app/darkmode)
|
|
40
63
|
|
|
41
64
|
## Dropdown components
|
|
42
65
|
|
|
43
|
-
[Dropdowns](https://flowbite-svelte.vercel.app/dropdowns)
|
|
66
|
+
- [Dropdowns](https://flowbite-svelte.vercel.app/dropdowns)
|
|
44
67
|
|
|
45
68
|
## Form components
|
|
46
69
|
|
|
47
|
-
[Forms](https://flowbite-svelte.vercel.app/forms)
|
|
70
|
+
- [Forms](https://flowbite-svelte.vercel.app/forms)
|
|
48
71
|
|
|
49
|
-
## Footer
|
|
72
|
+
## Footer components
|
|
50
73
|
|
|
51
|
-
[Footer](https://flowbite-svelte.vercel.app/footer)
|
|
74
|
+
- [Default Footer](https://flowbite-svelte.vercel.app/footer/default)
|
|
75
|
+
- [Footer with Logo](https://flowbite-svelte.vercel.app/footer/logo)
|
|
76
|
+
- [Footer with Sitemap](https://flowbite-svelte.vercel.app/footer/sitemap)
|
|
77
|
+
- [Footer with Socialmedia](https://flowbite-svelte.vercel.app/footer/socialmedia)
|
|
52
78
|
|
|
53
|
-
## Icons
|
|
79
|
+
## Icons components
|
|
54
80
|
|
|
55
|
-
[
|
|
81
|
+
- [Heroicons](https://flowbite-svelte.vercel.app/icons/heroicons)
|
|
82
|
+
- [Simpleicons](https://flowbite-svelte.vercel.app/icons/simple-icons)
|
|
56
83
|
|
|
57
|
-
## List group
|
|
84
|
+
## List group components
|
|
58
85
|
|
|
59
|
-
[List group](https://flowbite-svelte.vercel.app/list-group)
|
|
86
|
+
- [List group](https://flowbite-svelte.vercel.app/list-group)
|
|
60
87
|
|
|
61
88
|
## Modal components
|
|
62
89
|
|
|
63
|
-
[
|
|
90
|
+
- [Small Modal](https://flowbite-svelte.vercel.app/modals/small)
|
|
91
|
+
- [Medium Modal](https://flowbite-svelte.vercel.app/modals/medium)
|
|
92
|
+
- [Large Modal](https://flowbite-svelte.vercel.app/modals/large)
|
|
93
|
+
- [Extra Large Modal](https://flowbite-svelte.vercel.app/modals/extra-large)
|
|
94
|
+
- [Signin Modal](https://flowbite-svelte.vercel.app/modals/signin)
|
|
95
|
+
- [All Modals](https://flowbite-svelte.vercel.app/modals/all-modals)
|
|
64
96
|
|
|
65
97
|
## Navbar components
|
|
66
98
|
|
|
67
|
-
[
|
|
99
|
+
- [Default Navbar](https://flowbite-svelte.vercel.app/navbars/default)
|
|
100
|
+
- [Dropdown Navbar](https://flowbite-svelte.vercel.app/navbars/dropdown)
|
|
101
|
+
|
|
102
|
+
## Pagination components
|
|
103
|
+
|
|
104
|
+
- [Pagination](https://flowbite-svelte.vercel.app/paginations)
|
|
68
105
|
|
|
69
106
|
## Sidebar components
|
|
70
107
|
|
|
71
|
-
[Sidebar](https://flowbite-svelte.vercel.app/sidebars)
|
|
108
|
+
- [Sidebar](https://flowbite-svelte.vercel.app/sidebars)
|
|
72
109
|
|
|
73
110
|
## Spinner components
|
|
74
111
|
|
|
75
|
-
[
|
|
112
|
+
- [Default Spinner](https://flowbite-svelte.vercel.app/spinners/default)
|
|
113
|
+
- [Button Spinner](https://flowbite-svelte.vercel.app/spinners/button-spinner)
|
|
76
114
|
|
|
77
115
|
## Tab components
|
|
78
116
|
|
|
79
|
-
[Tabs](https://flowbite-svelte.vercel.app/tabs)
|
|
117
|
+
- [Default Tabs](https://flowbite-svelte.vercel.app/tabs/default-tabs)
|
|
118
|
+
- [Underline Tabs](https://flowbite-svelte.vercel.app/tabs/underline-tabs)
|
|
119
|
+
- [Icon Tabs](https://flowbite-svelte.vercel.app/tabs/icon-tabs)
|
|
120
|
+
- [Full width Tabs](https://flowbite-svelte.vercel.app/tabs/full-width-tabs)
|
|
121
|
+
- [Interactive Tabs](https://flowbite-svelte.vercel.app/tabs/interactive-tabs)
|
|
122
|
+
- [Interactive Tabs 2](https://flowbite-svelte.vercel.app/tabs/interactive-tabs-2)
|
|
123
|
+
- [Multiple Interactive Tabs](https://flowbite-svelte.vercel.app/tabs/multiple-interactive-tabs)
|
|
124
|
+
- [Pill Tabs](https://flowbite-svelte.vercel.app/tabs/pilltabs)
|
|
125
|
+
|
|
126
|
+
## Timeline components
|
|
127
|
+
|
|
128
|
+
- [Default timeline](https://flowbite-svelte.vercel.app/timelines/default)
|
|
129
|
+
- [Vetical timeline](https://flowbite-svelte.vercel.app/timelines/vertical)
|
|
130
|
+
- [Horizontal timeline](https://flowbite-svelte.vercel.app/timelines/horizontal)
|
|
131
|
+
- [Activity log](https://flowbite-svelte.vercel.app/timelines/activity)
|
|
132
|
+
- [Grouped timeline](https://flowbite-svelte.vercel.app/timelines/group)
|
|
80
133
|
|
|
81
134
|
## Toast components
|
|
82
135
|
|
|
83
|
-
[Toast](https://flowbite-svelte.vercel.app/toasts)
|
|
136
|
+
- [Toast](https://flowbite-svelte.vercel.app/toasts)
|
|
84
137
|
|
|
85
138
|
## Tooltip components
|
|
86
139
|
|
|
87
|
-
[
|
|
140
|
+
- [Default Tooltip](https://flowbite-svelte.vercel.app/tooltips/default)
|
|
141
|
+
- [Light Tooltip](https://flowbite-svelte.vercel.app/tooltips/light)
|
|
142
|
+
|
package/alerts/Alert.svelte.d.ts
CHANGED
|
@@ -51,11 +51,11 @@ else {
|
|
|
51
51
|
</script>
|
|
52
52
|
|
|
53
53
|
<div class={divClass}>
|
|
54
|
-
<div class="flex justify-end px-4 pt-4">
|
|
54
|
+
<div class="flex justify-end px-4 pt-4 relative">
|
|
55
55
|
<button
|
|
56
56
|
id="dropdownButton"
|
|
57
57
|
on:click={toggleDropdown}
|
|
58
|
-
class="sm:inline-block text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-1.5"
|
|
58
|
+
class="hidden sm:inline-block text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:outline-none focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-1.5"
|
|
59
59
|
type="button"
|
|
60
60
|
>
|
|
61
61
|
<svg
|
|
@@ -73,7 +73,7 @@ else {
|
|
|
73
73
|
id="dropdown"
|
|
74
74
|
class:hidden={isOpen}
|
|
75
75
|
class:block={!isOpen}
|
|
76
|
-
class="hidden z-10 w-44 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 absolute"
|
|
76
|
+
class="hidden z-10 w-44 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 absolute top-16 -right-16"
|
|
77
77
|
>
|
|
78
78
|
<ul class="py-1" aria-labelledby="dropdownButton">
|
|
79
79
|
{#each dropdownLinks as { href, name, rel }}
|
package/index.d.ts
CHANGED
|
@@ -59,9 +59,14 @@ export { default as TableData } from "./paginations/TableData.svelte";
|
|
|
59
59
|
export { default as Sidebar } from "./sidebars/Sidebar.svelte";
|
|
60
60
|
export { default as Spinner } from "./spinners/Spinner.svelte";
|
|
61
61
|
export { default as SpinnerButton } from "./spinners/SpinnerButton.svelte";
|
|
62
|
+
export { default as InteractiveTabHead } from "./tabs/InteractiveTabHead.svelte";
|
|
62
63
|
export { default as InteractiveTabs } from "./tabs/InteractiveTabs.svelte";
|
|
63
64
|
export { default as DefaultTabs } from "./tabs/DefaultTabs.svelte";
|
|
65
|
+
export { default as FullWidthTabs } from "./tabs/FullWidthTabs.svelte";
|
|
66
|
+
export { default as IconTabs } from "./tabs/IconTabs.svelte";
|
|
64
67
|
export { default as PillTabs } from "./tabs/PillTabs.svelte";
|
|
68
|
+
export { default as TabContent } from "./tabs/TabContent.svelte";
|
|
69
|
+
export { default as UnderlineTabs } from "./tabs/UnderlineTabs.svelte";
|
|
65
70
|
export { default as Group } from "./timelines/Group.svelte";
|
|
66
71
|
export { default as GroupItem } from "./timelines/GroupItem.svelte";
|
|
67
72
|
export { default as Activity } from "./timelines/Activity.svelte";
|
package/index.js
CHANGED
|
@@ -96,9 +96,14 @@ export { default as Spinner } from'./spinners/Spinner.svelte'
|
|
|
96
96
|
export { default as SpinnerButton } from'./spinners/SpinnerButton.svelte'
|
|
97
97
|
|
|
98
98
|
// Tabs
|
|
99
|
+
export { default as InteractiveTabHead } from './tabs/InteractiveTabHead.svelte'
|
|
99
100
|
export { default as InteractiveTabs } from'./tabs/InteractiveTabs.svelte'
|
|
100
|
-
export { default as DefaultTabs } from'./tabs/DefaultTabs.svelte'
|
|
101
|
+
export { default as DefaultTabs } from './tabs/DefaultTabs.svelte'
|
|
102
|
+
export { default as FullWidthTabs } from './tabs/FullWidthTabs.svelte'
|
|
103
|
+
export { default as IconTabs } from './tabs/IconTabs.svelte'
|
|
101
104
|
export { default as PillTabs } from './tabs/PillTabs.svelte'
|
|
105
|
+
export { default as TabContent } from './tabs/TabContent.svelte'
|
|
106
|
+
export { default as UnderlineTabs } from './tabs/UnderlineTabs.svelte'
|
|
102
107
|
|
|
103
108
|
// Timeline
|
|
104
109
|
export { default as Group } from './timelines/Group.svelte'
|
|
@@ -111,8 +116,6 @@ export { default as TimelineHorizontal } from './timelines/TimelineHorizontal.sv
|
|
|
111
116
|
export { default as TimelineItemHorizontal } from './timelines/TimelineItemHorizontal.svelte'
|
|
112
117
|
export { default as TimelineItemVertical } from './timelines/TimelineItemVertical.svelte'
|
|
113
118
|
|
|
114
|
-
|
|
115
|
-
|
|
116
119
|
// Toast
|
|
117
120
|
export { default as Toast } from './toasts/Toast.svelte'
|
|
118
121
|
|
|
@@ -7,10 +7,10 @@ export let textColor = 'gray';
|
|
|
7
7
|
export let title = 'Terms of Service';
|
|
8
8
|
export let btn1;
|
|
9
9
|
export let btn2;
|
|
10
|
-
const closeModal = () => {
|
|
10
|
+
export const closeModal = () => {
|
|
11
11
|
modalIdStore.update((value) => (value = null));
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
let showModalId;
|
|
14
14
|
modalIdStore.subscribe((value) => {
|
|
15
15
|
showModalId = value;
|
|
16
16
|
});
|
|
@@ -8,7 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
title?: string;
|
|
9
9
|
btn1: string;
|
|
10
10
|
btn2: string;
|
|
11
|
-
|
|
11
|
+
closeModal?: () => void;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
14
14
|
handlebtn1: CustomEvent<any>;
|
|
@@ -24,5 +24,6 @@ export declare type ExtraLargeModalProps = typeof __propDef.props;
|
|
|
24
24
|
export declare type ExtraLargeModalEvents = typeof __propDef.events;
|
|
25
25
|
export declare type ExtraLargeModalSlots = typeof __propDef.slots;
|
|
26
26
|
export default class ExtraLargeModal extends SvelteComponentTyped<ExtraLargeModalProps, ExtraLargeModalEvents, ExtraLargeModalSlots> {
|
|
27
|
+
get closeModal(): () => void;
|
|
27
28
|
}
|
|
28
29
|
export {};
|
package/modals/LargeModal.svelte
CHANGED
|
@@ -7,10 +7,10 @@ export let textColor = 'gray';
|
|
|
7
7
|
export let title = 'Terms of Service';
|
|
8
8
|
export let btn1;
|
|
9
9
|
export let btn2;
|
|
10
|
-
const closeModal = () => {
|
|
10
|
+
export const closeModal = () => {
|
|
11
11
|
modalIdStore.update((value) => (value = null));
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
let showModalId;
|
|
14
14
|
modalIdStore.subscribe((value) => {
|
|
15
15
|
showModalId = value;
|
|
16
16
|
});
|
|
@@ -8,7 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
title?: string;
|
|
9
9
|
btn1: string;
|
|
10
10
|
btn2: string;
|
|
11
|
-
|
|
11
|
+
closeModal?: () => void;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
14
14
|
handlebtn1: CustomEvent<any>;
|
|
@@ -24,5 +24,6 @@ export declare type LargeModalProps = typeof __propDef.props;
|
|
|
24
24
|
export declare type LargeModalEvents = typeof __propDef.events;
|
|
25
25
|
export declare type LargeModalSlots = typeof __propDef.slots;
|
|
26
26
|
export default class LargeModal extends SvelteComponentTyped<LargeModalProps, LargeModalEvents, LargeModalSlots> {
|
|
27
|
+
get closeModal(): () => void;
|
|
27
28
|
}
|
|
28
29
|
export {};
|
|
@@ -8,10 +8,10 @@ export let textColor = 'gray';
|
|
|
8
8
|
export let title = 'Terms of Service';
|
|
9
9
|
export let btn1;
|
|
10
10
|
export let btn2;
|
|
11
|
-
const closeModal = () => {
|
|
11
|
+
export const closeModal = () => {
|
|
12
12
|
modalIdStore.update((value) => (value = null));
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
let showModalId;
|
|
15
15
|
modalIdStore.subscribe((value) => {
|
|
16
16
|
showModalId = value;
|
|
17
17
|
});
|
|
@@ -8,7 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
title?: string;
|
|
9
9
|
btn1: string;
|
|
10
10
|
btn2: string;
|
|
11
|
-
|
|
11
|
+
closeModal?: () => void;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
14
14
|
handlebtn1: CustomEvent<any>;
|
|
@@ -24,5 +24,6 @@ export declare type MediumModalProps = typeof __propDef.props;
|
|
|
24
24
|
export declare type MediumModalEvents = typeof __propDef.events;
|
|
25
25
|
export declare type MediumModalSlots = typeof __propDef.slots;
|
|
26
26
|
export default class MediumModal extends SvelteComponentTyped<MediumModalProps, MediumModalEvents, MediumModalSlots> {
|
|
27
|
+
get closeModal(): () => void;
|
|
27
28
|
}
|
|
28
29
|
export {};
|
|
@@ -7,10 +7,10 @@ export let rememberMe = false;
|
|
|
7
7
|
export let signUp;
|
|
8
8
|
export let action;
|
|
9
9
|
export let emailPlaceholder = 'name@company.com';
|
|
10
|
-
const closeModal = () => {
|
|
10
|
+
export const closeModal = () => {
|
|
11
11
|
modalIdStore.update((value) => (value = null));
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
let showModalId;
|
|
14
14
|
modalIdStore.subscribe((value) => {
|
|
15
15
|
showModalId = value;
|
|
16
16
|
});
|
|
@@ -10,7 +10,7 @@ declare const __propDef: {
|
|
|
10
10
|
signUp: string;
|
|
11
11
|
action: string;
|
|
12
12
|
emailPlaceholder?: string;
|
|
13
|
-
|
|
13
|
+
closeModal?: () => void;
|
|
14
14
|
};
|
|
15
15
|
events: {
|
|
16
16
|
[evt: string]: CustomEvent<any>;
|
|
@@ -21,5 +21,6 @@ export declare type SignInModalProps = typeof __propDef.props;
|
|
|
21
21
|
export declare type SignInModalEvents = typeof __propDef.events;
|
|
22
22
|
export declare type SignInModalSlots = typeof __propDef.slots;
|
|
23
23
|
export default class SignInModal extends SvelteComponentTyped<SignInModalProps, SignInModalEvents, SignInModalSlots> {
|
|
24
|
+
get closeModal(): () => void;
|
|
24
25
|
}
|
|
25
26
|
export {};
|
package/modals/SmallModal.svelte
CHANGED
|
@@ -7,10 +7,10 @@ export let textColor = 'gray';
|
|
|
7
7
|
export let title = 'Terms of Service';
|
|
8
8
|
export let btn1;
|
|
9
9
|
export let btn2;
|
|
10
|
-
const closeModal = () => {
|
|
10
|
+
export const closeModal = () => {
|
|
11
11
|
modalIdStore.update((value) => (value = null));
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
let showModalId;
|
|
14
14
|
modalIdStore.subscribe((value) => {
|
|
15
15
|
showModalId = value;
|
|
16
16
|
});
|
|
@@ -8,7 +8,7 @@ declare const __propDef: {
|
|
|
8
8
|
title?: string;
|
|
9
9
|
btn1: string;
|
|
10
10
|
btn2: string;
|
|
11
|
-
|
|
11
|
+
closeModal?: () => void;
|
|
12
12
|
};
|
|
13
13
|
events: {
|
|
14
14
|
handlebtn1: CustomEvent<any>;
|
|
@@ -24,5 +24,6 @@ export declare type SmallModalProps = typeof __propDef.props;
|
|
|
24
24
|
export declare type SmallModalEvents = typeof __propDef.events;
|
|
25
25
|
export declare type SmallModalSlots = typeof __propDef.slots;
|
|
26
26
|
export default class SmallModal extends SvelteComponentTyped<SmallModalProps, SmallModalEvents, SmallModalSlots> {
|
|
27
|
+
get closeModal(): () => void;
|
|
27
28
|
}
|
|
28
29
|
export {};
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
<script >import { page, session } from '$app/stores';
|
|
2
|
-
|
|
3
|
-
let block = false;
|
|
4
|
-
let activeDropdown = undefined;
|
|
5
|
-
const handleDropdown = (id) => {
|
|
6
|
-
hidden = !hidden;
|
|
7
|
-
block = !block;
|
|
8
|
-
activeDropdown = id;
|
|
9
|
-
};
|
|
2
|
+
import NavDropdown from './NavDropdown.svelte';
|
|
10
3
|
let barHidden = true;
|
|
11
4
|
const handleClickbtn = () => {
|
|
12
5
|
barHidden = !barHidden;
|
|
@@ -65,41 +58,16 @@ export let liButtonClass = `flex justify-between items-center py-2 pr-4 pl-3 w-f
|
|
|
65
58
|
</button>
|
|
66
59
|
<div class="w-full md:block md:w-auto" class:hidden={barHidden} id="mobile-menu">
|
|
67
60
|
<ul class="flex flex-col mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium">
|
|
68
|
-
{#each menus as {
|
|
61
|
+
{#each menus as { name, href, rel, child }}
|
|
69
62
|
{#if child}
|
|
70
|
-
<
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
><path
|
|
79
|
-
fill-rule="evenodd"
|
|
80
|
-
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
|
|
81
|
-
clip-rule="evenodd"
|
|
82
|
-
/></svg
|
|
83
|
-
></button
|
|
84
|
-
>
|
|
85
|
-
{#if activeDropdown === id}
|
|
86
|
-
<!-- Dropdown menu -->
|
|
87
|
-
<div
|
|
88
|
-
class:hidden
|
|
89
|
-
class:block
|
|
90
|
-
class={dropdownDiv}
|
|
91
|
-
style="position: absolute; margin: 0px;"
|
|
92
|
-
>
|
|
93
|
-
<ul class="py-1" aria-labelledby="dropdownLargeButton">
|
|
94
|
-
{#each child as item}
|
|
95
|
-
<li>
|
|
96
|
-
<a href={item.href} {rel} class={dropdownLinkClassWithChild}>{item.name}</a>
|
|
97
|
-
</li>
|
|
98
|
-
{/each}
|
|
99
|
-
</ul>
|
|
100
|
-
</div>
|
|
101
|
-
{/if}
|
|
102
|
-
</li>
|
|
63
|
+
<NavDropdown
|
|
64
|
+
{liButtonClass}
|
|
65
|
+
{dropdownDiv}
|
|
66
|
+
{name}
|
|
67
|
+
{child}
|
|
68
|
+
{rel}
|
|
69
|
+
{dropdownLinkClassWithChild}
|
|
70
|
+
/>
|
|
103
71
|
{:else}
|
|
104
72
|
<li>
|
|
105
73
|
<a
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script >export let liButtonClass;
|
|
2
|
+
export let name;
|
|
3
|
+
let hidden = true;
|
|
4
|
+
let block = false;
|
|
5
|
+
export let child;
|
|
6
|
+
const handleDropdown = () => {
|
|
7
|
+
hidden = !hidden;
|
|
8
|
+
block = !block;
|
|
9
|
+
};
|
|
10
|
+
export let dropdownDiv;
|
|
11
|
+
export let dropdownLinkClassWithChild;
|
|
12
|
+
export let rel;
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<li>
|
|
16
|
+
<button on:click={() => handleDropdown()} class={liButtonClass}
|
|
17
|
+
>{name}
|
|
18
|
+
<svg
|
|
19
|
+
class="ml-1 w-4 h-4"
|
|
20
|
+
fill="currentColor"
|
|
21
|
+
viewBox="0 0 20 20"
|
|
22
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
23
|
+
><path
|
|
24
|
+
fill-rule="evenodd"
|
|
25
|
+
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
|
|
26
|
+
clip-rule="evenodd"
|
|
27
|
+
/></svg
|
|
28
|
+
></button
|
|
29
|
+
>
|
|
30
|
+
|
|
31
|
+
<!-- Dropdown menu -->
|
|
32
|
+
<div class:hidden class:block class={dropdownDiv} style="position: absolute; margin: 0px;">
|
|
33
|
+
<ul class="py-1" aria-labelledby="dropdownLargeButton">
|
|
34
|
+
{#each child as item}
|
|
35
|
+
<li>
|
|
36
|
+
<a href={item.href} {rel} class={dropdownLinkClassWithChild}>{item.name}</a>
|
|
37
|
+
</li>
|
|
38
|
+
{/each}
|
|
39
|
+
</ul>
|
|
40
|
+
</div>
|
|
41
|
+
</li>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { NavbarType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
liButtonClass: string;
|
|
6
|
+
name: string;
|
|
7
|
+
child: NavbarType[];
|
|
8
|
+
dropdownDiv: string;
|
|
9
|
+
dropdownLinkClassWithChild: string;
|
|
10
|
+
rel: string;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export declare type NavDropdownProps = typeof __propDef.props;
|
|
18
|
+
export declare type NavDropdownEvents = typeof __propDef.events;
|
|
19
|
+
export declare type NavDropdownSlots = typeof __propDef.slots;
|
|
20
|
+
export default class NavDropdown extends SvelteComponentTyped<NavDropdownProps, NavDropdownEvents, NavDropdownSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
package/navbar/Navbar.svelte
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script >import { page, session } from '$app/stores';
|
|
2
|
-
export let
|
|
2
|
+
export let name = 'Svelte Flow';
|
|
3
3
|
export let logo = '/images/mkdir-logo.png';
|
|
4
4
|
export let alt = 'Svelte Flow';
|
|
5
5
|
export let textsize = 'text-sm';
|
|
@@ -19,7 +19,7 @@ export let liLinkClass = `block py-2 pr-4 pl-3 text-gray-700 border-b border-gr
|
|
|
19
19
|
<div class={navDivClass}>
|
|
20
20
|
<a href="/" class="flex">
|
|
21
21
|
<img src={logo} {alt} />
|
|
22
|
-
<span class={spanClass}>{
|
|
22
|
+
<span class={spanClass}>{name}</span>
|
|
23
23
|
</a>
|
|
24
24
|
<button
|
|
25
25
|
on:click={handleClickbtn}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.3",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "./package/index.js",
|
|
6
6
|
"author": {
|
|
@@ -125,18 +125,26 @@
|
|
|
125
125
|
"./modals/SmallModal.svelte": "./modals/SmallModal.svelte",
|
|
126
126
|
"./modals/modalStores": "./modals/modalStores.js",
|
|
127
127
|
"./navbar/DropdownNavbar.svelte": "./navbar/DropdownNavbar.svelte",
|
|
128
|
+
"./navbar/NavDropdown.svelte": "./navbar/NavDropdown.svelte",
|
|
128
129
|
"./navbar/Navbar.svelte": "./navbar/Navbar.svelte",
|
|
129
130
|
"./paginations/Next.svelte": "./paginations/Next.svelte",
|
|
130
131
|
"./paginations/Pagination.svelte": "./paginations/Pagination.svelte",
|
|
131
132
|
"./paginations/Previous.svelte": "./paginations/Previous.svelte",
|
|
132
133
|
"./paginations/TableData.svelte": "./paginations/TableData.svelte",
|
|
133
134
|
"./sidebars/Sidebar.svelte": "./sidebars/Sidebar.svelte",
|
|
135
|
+
"./sidebars/SidebarDropdown.svelte": "./sidebars/SidebarDropdown.svelte",
|
|
134
136
|
"./spinners/Spinner.svelte": "./spinners/Spinner.svelte",
|
|
135
137
|
"./spinners/SpinnerButton.svelte": "./spinners/SpinnerButton.svelte",
|
|
136
138
|
"./tables/Table.svelte": "./tables/Table.svelte",
|
|
137
139
|
"./tabs/DefaultTabs.svelte": "./tabs/DefaultTabs.svelte",
|
|
140
|
+
"./tabs/FullWidthTabs.svelte": "./tabs/FullWidthTabs.svelte",
|
|
141
|
+
"./tabs/IconTabs.svelte": "./tabs/IconTabs.svelte",
|
|
142
|
+
"./tabs/InteractiveTabHead.svelte": "./tabs/InteractiveTabHead.svelte",
|
|
138
143
|
"./tabs/InteractiveTabs.svelte": "./tabs/InteractiveTabs.svelte",
|
|
139
144
|
"./tabs/PillTabs.svelte": "./tabs/PillTabs.svelte",
|
|
145
|
+
"./tabs/TabContent.svelte": "./tabs/TabContent.svelte",
|
|
146
|
+
"./tabs/UnderlineTabs.svelte": "./tabs/UnderlineTabs.svelte",
|
|
147
|
+
"./tabs/tabStore": "./tabs/tabStore.js",
|
|
140
148
|
"./timelines/Activity.svelte": "./timelines/Activity.svelte",
|
|
141
149
|
"./timelines/ActivityItem.svelte": "./timelines/ActivityItem.svelte",
|
|
142
150
|
"./timelines/Group.svelte": "./timelines/Group.svelte",
|
package/sidebars/Sidebar.svelte
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
<script >import
|
|
1
|
+
<script >import SidebarDropdown from './SidebarDropdown.svelte';
|
|
2
2
|
export let site;
|
|
3
3
|
export let links;
|
|
4
4
|
export let cta;
|
|
5
|
-
let isOpen = false;
|
|
6
|
-
let activeDropdown = undefined;
|
|
7
|
-
const handleDropdown = (id) => {
|
|
8
|
-
isOpen = !isOpen;
|
|
9
|
-
activeDropdown = id;
|
|
10
|
-
};
|
|
11
5
|
</script>
|
|
12
6
|
|
|
13
7
|
<aside class="w-64" aria-label="Sidebar">
|
|
@@ -23,48 +17,7 @@ const handleDropdown = (id) => {
|
|
|
23
17
|
<ul class="space-y-2">
|
|
24
18
|
{#each links as link (link.id)}
|
|
25
19
|
{#if link.children}
|
|
26
|
-
<
|
|
27
|
-
<button
|
|
28
|
-
type="button"
|
|
29
|
-
on:click={() => handleDropdown(link.id)}
|
|
30
|
-
class="flex items-center p-2 w-full text-base font-normal text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700"
|
|
31
|
-
aria-controls="dropdown"
|
|
32
|
-
data-collapse-toggle="dropdown"
|
|
33
|
-
>
|
|
34
|
-
{#if link.icon}
|
|
35
|
-
<svelte:component this={link.icon} className="h-4 w-4 mr-2" />
|
|
36
|
-
{/if}
|
|
37
|
-
<span class="flex-1 ml-3 text-left whitespace-nowrap" sidebar-toggle-item=""
|
|
38
|
-
>{link.name}</span
|
|
39
|
-
>
|
|
40
|
-
<svg
|
|
41
|
-
sidebar-toggle-item=""
|
|
42
|
-
class="w-6 h-6"
|
|
43
|
-
fill="currentColor"
|
|
44
|
-
viewBox="0 0 20 20"
|
|
45
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
46
|
-
><path
|
|
47
|
-
fill-rule="evenodd"
|
|
48
|
-
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
|
|
49
|
-
clip-rule="evenodd"
|
|
50
|
-
/></svg
|
|
51
|
-
>
|
|
52
|
-
</button>
|
|
53
|
-
{#if isOpen && link.id == activeDropdown}
|
|
54
|
-
<ul id="dropdown" class="py-2 space-y-2" transition:slide={{ duration: 500 }}>
|
|
55
|
-
{#each link.children as child}
|
|
56
|
-
<li>
|
|
57
|
-
<a
|
|
58
|
-
href={child.href}
|
|
59
|
-
rel={child.rel}
|
|
60
|
-
class="flex items-center p-2 pl-11 w-full text-base font-normal text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700"
|
|
61
|
-
>{child.name}</a
|
|
62
|
-
>
|
|
63
|
-
</li>
|
|
64
|
-
{/each}
|
|
65
|
-
</ul>
|
|
66
|
-
{/if}
|
|
67
|
-
</li>
|
|
20
|
+
<SidebarDropdown {link} />
|
|
68
21
|
{:else}
|
|
69
22
|
<li>
|
|
70
23
|
<a
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script >import { slide } from 'svelte/transition';
|
|
2
|
+
export let link;
|
|
3
|
+
let isOpen = false;
|
|
4
|
+
let activeDropdown = undefined;
|
|
5
|
+
const handleDropdown = (id) => {
|
|
6
|
+
isOpen = !isOpen;
|
|
7
|
+
activeDropdown = id;
|
|
8
|
+
};
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<li>
|
|
12
|
+
<button
|
|
13
|
+
type="button"
|
|
14
|
+
on:click={() => handleDropdown(link.id)}
|
|
15
|
+
class="flex items-center p-2 w-full text-base font-normal text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700"
|
|
16
|
+
aria-controls="dropdown"
|
|
17
|
+
data-collapse-toggle="dropdown"
|
|
18
|
+
>
|
|
19
|
+
{#if link.icon}
|
|
20
|
+
<svelte:component this={link.icon} className="h-4 w-4 mr-2" />
|
|
21
|
+
{/if}
|
|
22
|
+
<span class="flex-1 ml-3 text-left whitespace-nowrap" sidebar-toggle-item="">{link.name}</span>
|
|
23
|
+
<svg
|
|
24
|
+
sidebar-toggle-item=""
|
|
25
|
+
class="w-6 h-6"
|
|
26
|
+
fill="currentColor"
|
|
27
|
+
viewBox="0 0 20 20"
|
|
28
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
29
|
+
><path
|
|
30
|
+
fill-rule="evenodd"
|
|
31
|
+
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
|
|
32
|
+
clip-rule="evenodd"
|
|
33
|
+
/></svg
|
|
34
|
+
>
|
|
35
|
+
</button>
|
|
36
|
+
{#if isOpen && link.id == activeDropdown}
|
|
37
|
+
<ul id="dropdown" class="py-2 space-y-2" transition:slide={{ duration: 500 }}>
|
|
38
|
+
{#each link.children as child}
|
|
39
|
+
<li>
|
|
40
|
+
<a
|
|
41
|
+
href={child.href}
|
|
42
|
+
rel={child.rel}
|
|
43
|
+
class="flex items-center p-2 pl-11 w-full text-base font-normal text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700"
|
|
44
|
+
>{child.name}</a
|
|
45
|
+
>
|
|
46
|
+
</li>
|
|
47
|
+
{/each}
|
|
48
|
+
</ul>
|
|
49
|
+
{/if}
|
|
50
|
+
</li>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { SidebarType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
link: SidebarType;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
export declare type SidebarDropdownProps = typeof __propDef.props;
|
|
13
|
+
export declare type SidebarDropdownEvents = typeof __propDef.events;
|
|
14
|
+
export declare type SidebarDropdownSlots = typeof __propDef.slots;
|
|
15
|
+
export default class SidebarDropdown extends SvelteComponentTyped<SidebarDropdownProps, SidebarDropdownEvents, SidebarDropdownSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script >export let tabs;
|
|
2
|
+
export let tabLabel;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="sm:hidden">
|
|
6
|
+
<label for="tabs" class="sr-only">{tabLabel}</label>
|
|
7
|
+
<select
|
|
8
|
+
id="tabs"
|
|
9
|
+
class="bg-gray-50 border border-gray-300 text-gray-900 sm:text-sm 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"
|
|
10
|
+
>
|
|
11
|
+
{#each tabs as { name }}
|
|
12
|
+
<option>{name}</option>
|
|
13
|
+
{/each}
|
|
14
|
+
</select>
|
|
15
|
+
</div>
|
|
16
|
+
<ul
|
|
17
|
+
class="hidden text-sm font-medium text-center text-gray-500 rounded-lg divide-x divide-gray-200 shadow sm:flex dark:divide-gray-700 dark:text-gray-400"
|
|
18
|
+
>
|
|
19
|
+
{#each tabs as { name, href, rel, active }}
|
|
20
|
+
<li class="w-full">
|
|
21
|
+
<a
|
|
22
|
+
{href}
|
|
23
|
+
{rel}
|
|
24
|
+
class={active
|
|
25
|
+
? 'inline-block p-4 w-full text-gray-900 bg-gray-100 rounded-l-lg focus:ring-4 focus:ring-blue-300 active focus:outline-none dark:bg-gray-700 dark:text-white'
|
|
26
|
+
: 'inline-block p-4 w-full bg-white hover:text-gray-700 hover:bg-gray-50 focus:ring-4 focus:ring-blue-300 focus:outline-none dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700'}
|
|
27
|
+
aria-current="page">{name}</a
|
|
28
|
+
>
|
|
29
|
+
</li>
|
|
30
|
+
{/each}
|
|
31
|
+
</ul>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { TabType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
tabs: TabType[];
|
|
6
|
+
tabLabel: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export declare type FullWidthTabsProps = typeof __propDef.props;
|
|
14
|
+
export declare type FullWidthTabsEvents = typeof __propDef.events;
|
|
15
|
+
export declare type FullWidthTabsSlots = typeof __propDef.slots;
|
|
16
|
+
export default class FullWidthTabs extends SvelteComponentTyped<FullWidthTabsProps, FullWidthTabsEvents, FullWidthTabsSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script >export let tabs;
|
|
2
|
+
export let iconClass = 'mr-2 w-5 h-5 text-gray-400 group-hover:text-gray-500 dark:text-gray-500 dark:group-hover:text-gray-300';
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class="border-b border-gray-200 dark:border-gray-700">
|
|
6
|
+
<ul
|
|
7
|
+
class="flex flex-wrap -mb-px text-sm font-medium text-center text-gray-500 dark:text-gray-400"
|
|
8
|
+
>
|
|
9
|
+
{#each tabs as { name, active, href, rel, icon }}
|
|
10
|
+
<li class="mr-2">
|
|
11
|
+
<a
|
|
12
|
+
{href}
|
|
13
|
+
{rel}
|
|
14
|
+
class={active
|
|
15
|
+
? 'inline-flex p-4 text-blue-600 rounded-t-lg border-b-2 border-blue-600 active dark:text-blue-500 dark:border-blue-500 group'
|
|
16
|
+
: ' inline-flex p-4 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:hover:text-gray-300 group '}
|
|
17
|
+
>
|
|
18
|
+
<svelte:component this={icon} className={iconClass} />
|
|
19
|
+
{name}
|
|
20
|
+
</a>
|
|
21
|
+
</li>
|
|
22
|
+
{/each}
|
|
23
|
+
</ul>
|
|
24
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { IconTabType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
tabs: IconTabType[];
|
|
6
|
+
iconClass?: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export declare type IconTabsProps = typeof __propDef.props;
|
|
14
|
+
export declare type IconTabsEvents = typeof __propDef.events;
|
|
15
|
+
export declare type IconTabsSlots = typeof __propDef.slots;
|
|
16
|
+
export default class IconTabs extends SvelteComponentTyped<IconTabsProps, IconTabsEvents, IconTabsSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
<script >import { tabStore } from './tabStore';
|
|
2
|
+
export let tabs;
|
|
3
|
+
export let tabId = 'myTab';
|
|
4
|
+
export let activeTabValue = 1;
|
|
5
|
+
const handleClick = (tabValue) => () => {
|
|
6
|
+
tabStore.update((n) => (n = tabValue));
|
|
7
|
+
activeTabValue = tabValue;
|
|
8
|
+
};
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<!--
|
|
12
|
+
@component
|
|
13
|
+
Header part of Interactive tab component. Use with TabContent.
|
|
14
|
+
|
|
15
|
+
@param tabs: TabHeadType[];
|
|
16
|
+
@param tabId = 'myTab';
|
|
17
|
+
|
|
18
|
+
- Usage:
|
|
19
|
+
|
|
20
|
+
```tsx
|
|
21
|
+
<InteractiveHead>
|
|
22
|
+
<TabContent>
|
|
23
|
+
Some HTML|Component|string
|
|
24
|
+
</TabContent>
|
|
25
|
+
</InteractiveHead>
|
|
26
|
+
```
|
|
27
|
+
-->
|
|
28
|
+
<div class="mb-4 border-b border-gray-200">
|
|
29
|
+
<ul
|
|
30
|
+
class="flex flex-wrap -mb-px text-sm font-medium text-center"
|
|
31
|
+
id={tabId}
|
|
32
|
+
data-tabs-toggle="#myTabContent"
|
|
33
|
+
role="tablist"
|
|
34
|
+
>
|
|
35
|
+
{#each tabs as { name, id }}
|
|
36
|
+
<li class="mr-2" role="presentation">
|
|
37
|
+
<button
|
|
38
|
+
on:click={handleClick(id)}
|
|
39
|
+
class="inline-block py-4 px-4 text-sm font-medium text-center text-gray-500 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"
|
|
40
|
+
id="{name}-tab"
|
|
41
|
+
data-tabs-target="#{name}"
|
|
42
|
+
type="button"
|
|
43
|
+
role="tab"
|
|
44
|
+
class:active={activeTabValue === id}
|
|
45
|
+
aria-controls={name}
|
|
46
|
+
aria-selected="false">{name}</button
|
|
47
|
+
>
|
|
48
|
+
</li>
|
|
49
|
+
{/each}
|
|
50
|
+
</ul>
|
|
51
|
+
</div>
|
|
52
|
+
|
|
53
|
+
<slot />
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { TabHeadType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
tabs: TabHeadType[];
|
|
6
|
+
tabId?: string;
|
|
7
|
+
activeTabValue?: number;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
default: {};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare type InteractiveTabHeadProps = typeof __propDef.props;
|
|
17
|
+
export declare type InteractiveTabHeadEvents = typeof __propDef.events;
|
|
18
|
+
export declare type InteractiveTabHeadSlots = typeof __propDef.slots;
|
|
19
|
+
/**
|
|
20
|
+
* Header part of Interactive tab component. Use with TabContent.
|
|
21
|
+
*
|
|
22
|
+
* @param tabs: TabHeadType[];
|
|
23
|
+
* @param tabId = 'myTab';
|
|
24
|
+
*
|
|
25
|
+
* - Usage:
|
|
26
|
+
*
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <InteractiveHead>
|
|
29
|
+
* <TabContent>
|
|
30
|
+
* Some HTML|Component|string
|
|
31
|
+
* </TabContent>
|
|
32
|
+
* </InteractiveHead>
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
export default class InteractiveTabHead extends SvelteComponentTyped<InteractiveTabHeadProps, InteractiveTabHeadEvents, InteractiveTabHeadSlots> {
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script >import { tabStore } from './tabStore';
|
|
2
|
+
export let divClass = 'p-4 rounded-lg dark:bg-gray-800';
|
|
3
|
+
export let tab;
|
|
4
|
+
let activeTabValue;
|
|
5
|
+
tabStore.subscribe((value) => {
|
|
6
|
+
activeTabValue = value;
|
|
7
|
+
});
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<!--
|
|
11
|
+
@component
|
|
12
|
+
Content part of Interactive tab component. Use with InteractiveHead.
|
|
13
|
+
|
|
14
|
+
- let tabId = 'myTab';
|
|
15
|
+
- let tabs: TabHeadType;
|
|
16
|
+
- let divClass: string;
|
|
17
|
+
- Usage:
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<InteractiveHead>
|
|
21
|
+
<TabContent>
|
|
22
|
+
Some HTML|Component|string
|
|
23
|
+
</TabContent>
|
|
24
|
+
</InteractiveHead>
|
|
25
|
+
```
|
|
26
|
+
-->
|
|
27
|
+
|
|
28
|
+
{#if activeTabValue === tab.id}
|
|
29
|
+
<div class={divClass} id="{tab.id}Content" role="tabpanel" aria-labelledby="{tab.name}-tab">
|
|
30
|
+
<slot />
|
|
31
|
+
</div>
|
|
32
|
+
{/if}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { TabHeadType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
divClass?: string;
|
|
6
|
+
tab: TabHeadType;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare type TabContentProps = typeof __propDef.props;
|
|
16
|
+
export declare type TabContentEvents = typeof __propDef.events;
|
|
17
|
+
export declare type TabContentSlots = typeof __propDef.slots;
|
|
18
|
+
/**
|
|
19
|
+
* Content part of Interactive tab component. Use with InteractiveHead.
|
|
20
|
+
*
|
|
21
|
+
* - let tabId = 'myTab';
|
|
22
|
+
* - let tabs: TabHeadType;
|
|
23
|
+
* - let divClass: string;
|
|
24
|
+
* - Usage:
|
|
25
|
+
*
|
|
26
|
+
* ```tsx
|
|
27
|
+
* <InteractiveHead>
|
|
28
|
+
* <TabContent>
|
|
29
|
+
* Some HTML|Component|string
|
|
30
|
+
* </TabContent>
|
|
31
|
+
* </InteractiveHead>
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export default class TabContent extends SvelteComponentTyped<TabContentProps, TabContentEvents, TabContentSlots> {
|
|
35
|
+
}
|
|
36
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script >export let divClass = 'text-sm font-medium text-center text-gray-500 border-b border-gray-200 dark:text-gray-400 dark:border-gray-700';
|
|
2
|
+
export let tabs;
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<div class={divClass}>
|
|
6
|
+
<ul class="flex flex-wrap -mb-px">
|
|
7
|
+
{#each tabs as { name, active, href, rel }}
|
|
8
|
+
<li class="mr-2">
|
|
9
|
+
<a
|
|
10
|
+
{href}
|
|
11
|
+
{rel}
|
|
12
|
+
class={active
|
|
13
|
+
? 'inline-block p-4 text-blue-600 rounded-t-lg border-b-2 border-blue-600 active dark:text-blue-500 dark:border-blue-500'
|
|
14
|
+
: ' inline-block p-4 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:hover:text-gray-300 '}
|
|
15
|
+
>{name}</a
|
|
16
|
+
>
|
|
17
|
+
</li>
|
|
18
|
+
{/each}
|
|
19
|
+
</ul>
|
|
20
|
+
</div>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { TabType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
divClass?: string;
|
|
6
|
+
tabs: TabType[];
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export declare type UnderlineTabsProps = typeof __propDef.props;
|
|
14
|
+
export declare type UnderlineTabsEvents = typeof __propDef.events;
|
|
15
|
+
export declare type UnderlineTabsSlots = typeof __propDef.slots;
|
|
16
|
+
export default class UnderlineTabs extends SvelteComponentTyped<UnderlineTabsProps, UnderlineTabsEvents, UnderlineTabsSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
package/tabs/tabStore.js
ADDED
package/types.d.ts
CHANGED
|
@@ -43,18 +43,28 @@ export interface TabType {
|
|
|
43
43
|
href: string;
|
|
44
44
|
rel?: string;
|
|
45
45
|
}
|
|
46
|
+
export interface IconTabType {
|
|
47
|
+
name: string;
|
|
48
|
+
active: boolean;
|
|
49
|
+
href: string;
|
|
50
|
+
rel?: string;
|
|
51
|
+
icon?: typeof SvelteComponent;
|
|
52
|
+
}
|
|
46
53
|
export interface InteractiveTabType {
|
|
47
54
|
name: string;
|
|
48
55
|
id: number;
|
|
49
56
|
content: string | typeof SvelteComponent;
|
|
50
57
|
}
|
|
58
|
+
export interface TabHeadType {
|
|
59
|
+
name: string;
|
|
60
|
+
id: number;
|
|
61
|
+
}
|
|
51
62
|
export interface PillTabType {
|
|
52
63
|
name: string;
|
|
53
64
|
selected: boolean;
|
|
54
65
|
href: string;
|
|
55
66
|
}
|
|
56
67
|
export interface NavbarType {
|
|
57
|
-
id: number;
|
|
58
68
|
name: string;
|
|
59
69
|
href: string;
|
|
60
70
|
rel?: string;
|