flowbite-svelte 0.9.2 → 0.9.5
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 +25 -0
- package/auth/Register.svelte +116 -0
- package/auth/Register.svelte.d.ts +25 -0
- package/auth/Reset.svelte +57 -0
- package/auth/Reset.svelte.d.ts +22 -0
- package/buttongroups/ButtonGroup.svelte +7 -7
- package/buttongroups/ButtonGroupOutline.svelte +7 -7
- 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 -2
- package/cards/EcommerceCard.svelte +1 -1
- package/cards/EcommerceCard.svelte.d.ts +1 -1
- package/cards/HorizontalCard.svelte +3 -3
- package/cards/HorizontalCard.svelte.d.ts +3 -3
- package/cards/InteractiveCard.svelte +6 -6
- package/cards/InteractiveCard.svelte.d.ts +2 -2
- package/cards/ListCard.svelte +42 -77
- package/cards/ListCard.svelte.d.ts +8 -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/footer/LogoFooter.svelte +4 -4
- package/footer/SimpleFooter.svelte +3 -3
- package/footer/SitemapFooter.svelte +5 -5
- package/footer/SitemapFooter.svelte.d.ts +2 -2
- package/footer/SocialMediaFooter.svelte +59 -106
- package/footer/SocialMediaFooter.svelte.d.ts +9 -61
- 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/modals/ExtraLargeModal.svelte +187 -191
- package/modals/ExtraLargeModal.svelte.d.ts +9 -27
- package/modals/LargeModal.svelte +188 -191
- package/modals/LargeModal.svelte.d.ts +9 -27
- package/modals/MediumModal.svelte +191 -200
- package/modals/MediumModal.svelte.d.ts +9 -27
- package/modals/ModalButton.svelte +40 -35
- package/modals/ModalButton.svelte.d.ts +7 -17
- package/modals/SignInModal.svelte +151 -160
- package/modals/SignInModal.svelte.d.ts +10 -24
- package/modals/SmallModal.svelte +188 -191
- package/modals/SmallModal.svelte.d.ts +9 -27
- package/modals/modalStores.d.ts +2 -1
- package/modals/modalStores.js +1 -2
- package/navbar/DropdownNavbar.svelte +21 -24
- package/navbar/DropdownNavbar.svelte.d.ts +7 -0
- package/navbar/Navbar.svelte +11 -14
- package/navbar/Navbar.svelte.d.ts +4 -0
- package/package.json +7 -3
- package/spinners/Spinner.svelte +1 -1
- package/spinners/Spinner.svelte.d.ts +1 -1
- package/spinners/SpinnerButton.svelte +1 -1
- package/tabs/DefaultTabs.svelte +2 -2
- package/tabs/InteractiveTabs.svelte +6 -6
- package/tabs/PillTabs.svelte +2 -2
- package/types.d.ts +25 -12
|
@@ -1,242 +1,233 @@
|
|
|
1
|
-
<script
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
modalIdStore.update((value) => {
|
|
17
|
-
value = null;
|
|
18
|
-
});
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export let showModalId;
|
|
22
|
-
modalIdStore.subscribe((value) => {
|
|
1
|
+
<script >// import { toggleModal } from "./modalHelper";
|
|
2
|
+
import { modalIdStore } from './modalStores';
|
|
3
|
+
import { createEventDispatcher } from 'svelte';
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
export let id = 'medium-modal';
|
|
6
|
+
export let btnColor = 'blue';
|
|
7
|
+
export let textColor = 'gray';
|
|
8
|
+
export let title = 'Terms of Service';
|
|
9
|
+
export let btn1;
|
|
10
|
+
export let btn2;
|
|
11
|
+
const closeModal = () => {
|
|
12
|
+
modalIdStore.update((value) => (value = null));
|
|
13
|
+
};
|
|
14
|
+
export let showModalId;
|
|
15
|
+
modalIdStore.subscribe((value) => {
|
|
23
16
|
showModalId = value;
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
headDivClass =
|
|
43
|
-
"flex justify-between items-start p-5 rounded-t border-b dark:border-blue-600";
|
|
44
|
-
h3Class = "text-xl font-semibold text-blue-900 lg:text-2xl dark:text-white";
|
|
17
|
+
});
|
|
18
|
+
const handlebtn1 = () => {
|
|
19
|
+
dispatch('handlebtn1');
|
|
20
|
+
};
|
|
21
|
+
const handlebtn2 = () => {
|
|
22
|
+
dispatch('handlebtn2');
|
|
23
|
+
};
|
|
24
|
+
let divClass;
|
|
25
|
+
let headDivClass;
|
|
26
|
+
let h3Class;
|
|
27
|
+
let buttonClass;
|
|
28
|
+
let pClass;
|
|
29
|
+
let footerClass;
|
|
30
|
+
let btn2Class;
|
|
31
|
+
if (textColor === 'blue') {
|
|
32
|
+
divClass = 'relative bg-white rounded-lg shadow dark:bg-blue-700';
|
|
33
|
+
headDivClass = 'flex justify-between items-start p-5 rounded-t border-b dark:border-blue-600';
|
|
34
|
+
h3Class = 'text-xl font-semibold text-blue-900 lg:text-2xl dark:text-white';
|
|
45
35
|
buttonClass =
|
|
46
|
-
|
|
47
|
-
pClass =
|
|
36
|
+
'text-blue-400 bg-transparent hover:bg-blue-200 hover:text-blue-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-blue-600 dark:hover:text-white';
|
|
37
|
+
pClass = 'text-base leading-relaxed text-blue-500 dark:text-blue-400';
|
|
48
38
|
footerClass =
|
|
49
|
-
|
|
39
|
+
'flex items-center p-6 space-x-2 rounded-b border-t border-blue-200 dark:border-blue-600';
|
|
50
40
|
btn2Class =
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
h3Class =
|
|
41
|
+
'text-blue-500 bg-white hover:bg-blue-100 focus:ring-4 focus:ring-blue-300 rounded-lg border border-blue-200 text-sm font-medium px-5 py-2.5 hover:text-blue-900 focus:z-10 dark:bg-blue-700 dark:text-blue-300 dark:border-blue-500 dark:hover:text-white dark:hover:bg-blue-600';
|
|
42
|
+
}
|
|
43
|
+
else if (textColor === 'gray') {
|
|
44
|
+
divClass = 'relative bg-white rounded-lg shadow dark:bg-gray-700';
|
|
45
|
+
headDivClass = 'flex justify-between items-start p-5 rounded-t border-b dark:border-gray-600';
|
|
46
|
+
h3Class = 'text-xl font-semibold text-gray-900 lg:text-2xl dark:text-white';
|
|
57
47
|
buttonClass =
|
|
58
|
-
|
|
59
|
-
pClass =
|
|
48
|
+
'text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white';
|
|
49
|
+
pClass = 'text-base leading-relaxed text-gray-500 dark:text-gray-400';
|
|
60
50
|
footerClass =
|
|
61
|
-
|
|
51
|
+
'flex items-center p-6 space-x-2 rounded-b border-t border-gray-200 dark:border-gray-600';
|
|
62
52
|
btn2Class =
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
h3Class =
|
|
53
|
+
'text-gray-500 bg-white hover:bg-gray-100 focus:ring-4 focus:ring-gray-300 rounded-lg border border-gray-200 text-sm font-medium px-5 py-2.5 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600';
|
|
54
|
+
}
|
|
55
|
+
else if (textColor === 'red') {
|
|
56
|
+
divClass = 'relative bg-white rounded-lg shadow dark:bg-red-700';
|
|
57
|
+
headDivClass = 'flex justify-between items-start p-5 rounded-t border-b dark:border-red-600';
|
|
58
|
+
h3Class = 'text-xl font-semibold text-red-900 lg:text-2xl dark:text-white';
|
|
69
59
|
buttonClass =
|
|
70
|
-
|
|
71
|
-
pClass =
|
|
60
|
+
'text-red-400 bg-transparent hover:bg-red-200 hover:text-red-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-red-600 dark:hover:text-white';
|
|
61
|
+
pClass = 'text-base leading-relaxed text-red-500 dark:text-red-400';
|
|
72
62
|
footerClass =
|
|
73
|
-
|
|
63
|
+
'flex items-center p-6 space-x-2 rounded-b border-t border-red-200 dark:border-red-600';
|
|
74
64
|
btn2Class =
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
h3Class =
|
|
81
|
-
"text-xl font-semibold text-yellow-900 lg:text-2xl dark:text-white";
|
|
65
|
+
'text-red-500 bg-white hover:bg-red-100 focus:ring-4 focus:ring-red-300 rounded-lg border border-red-200 text-sm font-medium px-5 py-2.5 hover:text-red-900 focus:z-10 dark:bg-red-700 dark:text-red-300 dark:border-red-500 dark:hover:text-white dark:hover:bg-red-600';
|
|
66
|
+
}
|
|
67
|
+
else if (textColor === 'yellow') {
|
|
68
|
+
divClass = 'relative bg-white rounded-lg shadow dark:bg-yellow-700';
|
|
69
|
+
headDivClass = 'flex justify-between items-start p-5 rounded-t border-b dark:border-yellow-600';
|
|
70
|
+
h3Class = 'text-xl font-semibold text-yellow-900 lg:text-2xl dark:text-white';
|
|
82
71
|
buttonClass =
|
|
83
|
-
|
|
84
|
-
pClass =
|
|
72
|
+
'text-yellow-400 bg-transparent hover:bg-yellow-200 hover:text-yellow-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-yellow-600 dark:hover:text-white';
|
|
73
|
+
pClass = 'text-base leading-relaxed text-yellow-500 dark:text-yellow-400';
|
|
85
74
|
footerClass =
|
|
86
|
-
|
|
75
|
+
'flex items-center p-6 space-x-2 rounded-b border-t border-yellow-200 dark:border-yellow-600';
|
|
87
76
|
btn2Class =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
h3Class =
|
|
94
|
-
"text-xl font-semibold text-green-900 lg:text-2xl dark:text-white";
|
|
77
|
+
'text-yellow-500 bg-white hover:bg-yellow-100 focus:ring-4 focus:ring-yellow-300 rounded-lg border border-yellow-200 text-sm font-medium px-5 py-2.5 hover:text-yellow-900 focus:z-10 dark:bg-yellow-700 dark:text-yellow-300 dark:border-yellow-500 dark:hover:text-white dark:hover:bg-yellow-600';
|
|
78
|
+
}
|
|
79
|
+
else if (textColor === 'green') {
|
|
80
|
+
divClass = 'relative bg-white rounded-lg shadow dark:bg-green-700';
|
|
81
|
+
headDivClass = 'flex justify-between items-start p-5 rounded-t border-b dark:border-green-600';
|
|
82
|
+
h3Class = 'text-xl font-semibold text-green-900 lg:text-2xl dark:text-white';
|
|
95
83
|
buttonClass =
|
|
96
|
-
|
|
97
|
-
pClass =
|
|
84
|
+
'text-green-400 bg-transparent hover:bg-green-200 hover:text-green-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-green-600 dark:hover:text-white';
|
|
85
|
+
pClass = 'text-base leading-relaxed text-green-500 dark:text-green-400';
|
|
98
86
|
footerClass =
|
|
99
|
-
|
|
87
|
+
'flex items-center p-6 space-x-2 rounded-b border-t border-green-200 dark:border-green-600';
|
|
100
88
|
btn2Class =
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
h3Class =
|
|
107
|
-
"text-xl font-semibold text-indigo-900 lg:text-2xl dark:text-white";
|
|
89
|
+
'text-green-500 bg-white hover:bg-green-100 focus:ring-4 focus:ring-green-300 rounded-lg border border-green-200 text-sm font-medium px-5 py-2.5 hover:text-green-900 focus:z-10 dark:bg-green-700 dark:text-green-300 dark:border-green-500 dark:hover:text-white dark:hover:bg-green-600';
|
|
90
|
+
}
|
|
91
|
+
else if (textColor === 'indigo') {
|
|
92
|
+
divClass = 'relative bg-white rounded-lg shadow dark:bg-indigo-700';
|
|
93
|
+
headDivClass = 'flex justify-between items-start p-5 rounded-t border-b dark:border-indigo-600';
|
|
94
|
+
h3Class = 'text-xl font-semibold text-indigo-900 lg:text-2xl dark:text-white';
|
|
108
95
|
buttonClass =
|
|
109
|
-
|
|
110
|
-
pClass =
|
|
96
|
+
'text-indigo-400 bg-transparent hover:bg-indigo-200 hover:text-indigo-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-indigo-600 dark:hover:text-white';
|
|
97
|
+
pClass = 'text-base leading-relaxed text-indigo-500 dark:text-indigo-400';
|
|
111
98
|
footerClass =
|
|
112
|
-
|
|
99
|
+
'flex items-center p-6 space-x-2 rounded-b border-t border-indigo-200 dark:border-indigo-600';
|
|
113
100
|
btn2Class =
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
h3Class =
|
|
120
|
-
"text-xl font-semibold text-purple-900 lg:text-2xl dark:text-white";
|
|
101
|
+
'text-indigo-500 bg-white hover:bg-indigo-100 focus:ring-4 focus:ring-indigo-300 rounded-lg border border-indigo-200 text-sm font-medium px-5 py-2.5 hover:text-indigo-900 focus:z-10 dark:bg-indigo-700 dark:text-indigo-300 dark:border-indigo-500 dark:hover:text-white dark:hover:bg-indigo-600';
|
|
102
|
+
}
|
|
103
|
+
else if (textColor === 'purple') {
|
|
104
|
+
divClass = 'relative bg-white rounded-lg shadow dark:bg-purple-700';
|
|
105
|
+
headDivClass = 'flex justify-between items-start p-5 rounded-t border-b dark:border-purple-600';
|
|
106
|
+
h3Class = 'text-xl font-semibold text-purple-900 lg:text-2xl dark:text-white';
|
|
121
107
|
buttonClass =
|
|
122
|
-
|
|
123
|
-
pClass =
|
|
108
|
+
'text-purple-400 bg-transparent hover:bg-purple-200 hover:text-purple-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-purple-600 dark:hover:text-white';
|
|
109
|
+
pClass = 'text-base leading-relaxed text-purple-500 dark:text-purple-400';
|
|
124
110
|
footerClass =
|
|
125
|
-
|
|
111
|
+
'flex items-center p-6 space-x-2 rounded-b border-t border-purple-200 dark:border-purple-600';
|
|
126
112
|
btn2Class =
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
h3Class =
|
|
113
|
+
'text-purple-500 bg-white hover:bg-purple-100 focus:ring-4 focus:ring-purple-300 rounded-lg border border-purple-200 text-sm font-medium px-5 py-2.5 hover:text-purple-900 focus:z-10 dark:bg-purple-700 dark:text-purple-300 dark:border-purple-500 dark:hover:text-white dark:hover:bg-purple-600';
|
|
114
|
+
}
|
|
115
|
+
else if (textColor === 'pink') {
|
|
116
|
+
divClass = 'relative bg-white rounded-lg shadow dark:bg-pink-700';
|
|
117
|
+
headDivClass = 'flex justify-between items-start p-5 rounded-t border-b dark:border-pink-600';
|
|
118
|
+
h3Class = 'text-xl font-semibold text-pink-900 lg:text-2xl dark:text-white';
|
|
133
119
|
buttonClass =
|
|
134
|
-
|
|
135
|
-
pClass =
|
|
120
|
+
'text-pink-400 bg-transparent hover:bg-pink-200 hover:text-pink-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-pink-600 dark:hover:text-white';
|
|
121
|
+
pClass = 'text-base leading-relaxed text-pink-500 dark:text-pink-400';
|
|
136
122
|
footerClass =
|
|
137
|
-
|
|
123
|
+
'flex items-center p-6 space-x-2 rounded-b border-t border-pink-200 dark:border-pink-600';
|
|
138
124
|
btn2Class =
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
h3Class =
|
|
125
|
+
'text-pink-500 bg-white hover:bg-pink-100 focus:ring-4 focus:ring-pink-300 rounded-lg border border-pink-200 text-sm font-medium px-5 py-2.5 hover:text-pink-900 focus:z-10 dark:bg-pink-700 dark:text-pink-300 dark:border-pink-500 dark:hover:text-white dark:hover:bg-pink-600';
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
divClass = 'relative bg-white rounded-lg shadow dark:bg-blue-700';
|
|
129
|
+
headDivClass = 'flex justify-between items-start p-5 rounded-t border-b dark:border-blue-600';
|
|
130
|
+
h3Class = 'text-xl font-semibold text-blue-900 lg:text-2xl dark:text-white';
|
|
145
131
|
buttonClass =
|
|
146
|
-
|
|
147
|
-
pClass =
|
|
132
|
+
'text-blue-400 bg-transparent hover:bg-blue-200 hover:text-blue-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-blue-600 dark:hover:text-white';
|
|
133
|
+
pClass = 'text-base leading-relaxed text-blue-500 dark:text-blue-400';
|
|
148
134
|
footerClass =
|
|
149
|
-
|
|
135
|
+
'flex items-center p-6 space-x-2 rounded-b border-t border-blue-200 dark:border-blue-600';
|
|
150
136
|
btn2Class =
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
if (btnColor === "blue") {
|
|
137
|
+
'text-blue-500 bg-white hover:bg-blue-100 focus:ring-4 focus:ring-blue-300 rounded-lg border border-blue-200 text-sm font-medium px-5 py-2.5 hover:text-blue-900 focus:z-10 dark:bg-blue-700 dark:text-blue-300 dark:border-blue-500 dark:hover:text-white dark:hover:bg-blue-600';
|
|
138
|
+
}
|
|
139
|
+
let button1Class;
|
|
140
|
+
if (btnColor === 'blue') {
|
|
156
141
|
button1Class =
|
|
157
|
-
|
|
158
|
-
|
|
142
|
+
'text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
143
|
+
}
|
|
144
|
+
else if (btnColor === 'gray') {
|
|
159
145
|
button1Class =
|
|
160
|
-
|
|
161
|
-
|
|
146
|
+
'text-white bg-gray-700 hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800';
|
|
147
|
+
}
|
|
148
|
+
else if (btnColor === 'red') {
|
|
162
149
|
button1Class =
|
|
163
|
-
|
|
164
|
-
|
|
150
|
+
'text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800';
|
|
151
|
+
}
|
|
152
|
+
else if (btnColor === 'yellow') {
|
|
165
153
|
button1Class =
|
|
166
|
-
|
|
167
|
-
|
|
154
|
+
'text-white bg-yellow-700 hover:bg-yellow-800 focus:ring-4 focus:ring-yellow-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800';
|
|
155
|
+
}
|
|
156
|
+
else if (btnColor === 'green') {
|
|
168
157
|
button1Class =
|
|
169
|
-
|
|
170
|
-
|
|
158
|
+
'text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800';
|
|
159
|
+
}
|
|
160
|
+
else if (btnColor === 'indigo') {
|
|
171
161
|
button1Class =
|
|
172
|
-
|
|
173
|
-
|
|
162
|
+
'text-white bg-indigo-700 hover:bg-indigo-800 focus:ring-4 focus:ring-indigo-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800';
|
|
163
|
+
}
|
|
164
|
+
else if (btnColor === 'purple') {
|
|
174
165
|
button1Class =
|
|
175
|
-
|
|
176
|
-
|
|
166
|
+
'text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800';
|
|
167
|
+
}
|
|
168
|
+
else if (btnColor === 'pink') {
|
|
177
169
|
button1Class =
|
|
178
|
-
|
|
179
|
-
|
|
170
|
+
'text-white bg-pink-700 hover:bg-pink-800 focus:ring-4 focus:ring-pink-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800';
|
|
171
|
+
}
|
|
172
|
+
else {
|
|
180
173
|
button1Class =
|
|
181
|
-
|
|
182
|
-
|
|
174
|
+
'text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
175
|
+
}
|
|
183
176
|
</script>
|
|
184
177
|
|
|
185
178
|
{#if showModalId === id}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
</div>
|
|
236
|
-
</div>
|
|
179
|
+
<!-- Main modal -->
|
|
180
|
+
<div
|
|
181
|
+
{id}
|
|
182
|
+
role="dialog"
|
|
183
|
+
aria-modal="true"
|
|
184
|
+
class="flex overflow-y-auto overflow-x-hidden fixed right-0 left-0 top-20 z-50 justify-center items-center"
|
|
185
|
+
>
|
|
186
|
+
<div class="relative px-4 w-full max-w-2xl h-full md:h-auto">
|
|
187
|
+
<!-- Modal content -->
|
|
188
|
+
<div class={divClass}>
|
|
189
|
+
<!-- Modal header -->
|
|
190
|
+
<div class={headDivClass}>
|
|
191
|
+
<h3 class={h3Class}>
|
|
192
|
+
{title}
|
|
193
|
+
</h3>
|
|
194
|
+
<button type="button" class={buttonClass} on:click={closeModal}>
|
|
195
|
+
<svg
|
|
196
|
+
class="w-5 h-5"
|
|
197
|
+
fill="currentColor"
|
|
198
|
+
viewBox="0 0 20 20"
|
|
199
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
200
|
+
><path
|
|
201
|
+
fill-rule="evenodd"
|
|
202
|
+
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
203
|
+
clip-rule="evenodd"
|
|
204
|
+
/></svg
|
|
205
|
+
>
|
|
206
|
+
</button>
|
|
207
|
+
</div>
|
|
208
|
+
<!-- Modal body -->
|
|
209
|
+
<div class="p-6 space-y-6">
|
|
210
|
+
<p class={pClass}>
|
|
211
|
+
<slot />
|
|
212
|
+
</p>
|
|
213
|
+
</div>
|
|
214
|
+
<!-- Modal footer -->
|
|
215
|
+
<div class={footerClass}>
|
|
216
|
+
{#if btn1}
|
|
217
|
+
<button type="button" class={button1Class} on:click={handlebtn1}>
|
|
218
|
+
{btn1}
|
|
219
|
+
</button>
|
|
220
|
+
{/if}
|
|
221
|
+
{#if btn2}
|
|
222
|
+
<button type="button" class={btn2Class} on:click={handlebtn2}>{btn2}</button>
|
|
223
|
+
{/if}
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
237
228
|
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
229
|
+
<div
|
|
230
|
+
on:click={closeModal}
|
|
231
|
+
class="bg-gray-900 bg-opacity-50 dark:bg-opacity-80 fixed inset-0 z-40 w-full h-full"
|
|
232
|
+
/>
|
|
242
233
|
{/if}
|
|
@@ -1,36 +1,13 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} MediumModalProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} MediumModalEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} MediumModalSlots */
|
|
4
|
-
export default class MediumModal extends SvelteComponentTyped<{
|
|
5
|
-
btn1: any;
|
|
6
|
-
btn2: any;
|
|
7
|
-
showModalId: any;
|
|
8
|
-
id?: string;
|
|
9
|
-
title?: string;
|
|
10
|
-
btnColor?: string;
|
|
11
|
-
textColor?: string;
|
|
12
|
-
}, {
|
|
13
|
-
handlebtn1: CustomEvent<any>;
|
|
14
|
-
handlebtn2: CustomEvent<any>;
|
|
15
|
-
} & {
|
|
16
|
-
[evt: string]: CustomEvent<any>;
|
|
17
|
-
}, {
|
|
18
|
-
default: {};
|
|
19
|
-
}> {
|
|
20
|
-
}
|
|
21
|
-
export type MediumModalProps = typeof __propDef.props;
|
|
22
|
-
export type MediumModalEvents = typeof __propDef.events;
|
|
23
|
-
export type MediumModalSlots = typeof __propDef.slots;
|
|
24
1
|
import { SvelteComponentTyped } from "svelte";
|
|
25
2
|
declare const __propDef: {
|
|
26
3
|
props: {
|
|
27
|
-
btn1: any;
|
|
28
|
-
btn2: any;
|
|
29
|
-
showModalId: any;
|
|
30
4
|
id?: string;
|
|
31
|
-
title?: string;
|
|
32
5
|
btnColor?: string;
|
|
33
6
|
textColor?: string;
|
|
7
|
+
title?: string;
|
|
8
|
+
btn1: string;
|
|
9
|
+
btn2: string;
|
|
10
|
+
showModalId: string;
|
|
34
11
|
};
|
|
35
12
|
events: {
|
|
36
13
|
handlebtn1: CustomEvent<any>;
|
|
@@ -42,4 +19,9 @@ declare const __propDef: {
|
|
|
42
19
|
default: {};
|
|
43
20
|
};
|
|
44
21
|
};
|
|
22
|
+
export declare type MediumModalProps = typeof __propDef.props;
|
|
23
|
+
export declare type MediumModalEvents = typeof __propDef.events;
|
|
24
|
+
export declare type MediumModalSlots = typeof __propDef.slots;
|
|
25
|
+
export default class MediumModal extends SvelteComponentTyped<MediumModalProps, MediumModalEvents, MediumModalSlots> {
|
|
26
|
+
}
|
|
45
27
|
export {};
|
|
@@ -1,48 +1,53 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export let openFn = (modal) => {
|
|
10
|
-
modalIdStore.update((n) => (n = modal.id));
|
|
1
|
+
<script >import { modalIdStore } from './modalStores';
|
|
2
|
+
import { get } from 'svelte/store';
|
|
3
|
+
export let id = 'modal-id';
|
|
4
|
+
export let btnName = 'Modal Name';
|
|
5
|
+
export let btnColor = 'blue';
|
|
6
|
+
let showModalId;
|
|
7
|
+
export let openFn = (id) => {
|
|
8
|
+
modalIdStore.update((n) => (n = id));
|
|
11
9
|
showModalId = get(modalIdStore);
|
|
12
|
-
console.log(
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (btnColor === "blue") {
|
|
10
|
+
// console.log('showModalId', showModalId);
|
|
11
|
+
};
|
|
12
|
+
let buttonClass;
|
|
13
|
+
if (btnColor === 'blue') {
|
|
17
14
|
buttonClass =
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
'block w-full md:w-auto text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
16
|
+
}
|
|
17
|
+
else if (btnColor === 'gray') {
|
|
20
18
|
buttonClass =
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
'block w-full md:w-auto text-white bg-gray-700 hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800';
|
|
20
|
+
}
|
|
21
|
+
else if (btnColor === 'red') {
|
|
23
22
|
buttonClass =
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
'block w-full md:w-auto text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800';
|
|
24
|
+
}
|
|
25
|
+
else if (btnColor === 'yellow') {
|
|
26
26
|
buttonClass =
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
'block w-full md:w-auto text-white bg-yellow-700 hover:bg-yellow-800 focus:ring-4 focus:ring-yellow-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800';
|
|
28
|
+
}
|
|
29
|
+
else if (btnColor === 'green') {
|
|
29
30
|
buttonClass =
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
'block w-full md:w-auto text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800';
|
|
32
|
+
}
|
|
33
|
+
else if (btnColor === 'indigo') {
|
|
32
34
|
buttonClass =
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
'block w-full md:w-auto text-white bg-indigo-700 hover:bg-indigo-800 focus:ring-4 focus:ring-indigo-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800';
|
|
36
|
+
}
|
|
37
|
+
else if (btnColor === 'purple') {
|
|
35
38
|
buttonClass =
|
|
36
|
-
|
|
37
|
-
|
|
39
|
+
'block w-full md:w-auto text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800';
|
|
40
|
+
}
|
|
41
|
+
else if (btnColor === 'pink') {
|
|
38
42
|
buttonClass =
|
|
39
|
-
|
|
40
|
-
|
|
43
|
+
'block w-full md:w-auto text-white bg-pink-700 hover:bg-pink-800 focus:ring-4 focus:ring-pink-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800';
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
41
46
|
buttonClass =
|
|
42
|
-
|
|
43
|
-
|
|
47
|
+
'block w-full md:w-auto text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
48
|
+
}
|
|
44
49
|
</script>
|
|
45
50
|
|
|
46
|
-
<button on:click={openFn(
|
|
47
|
-
|
|
51
|
+
<button on:click={() => openFn(id)} class={buttonClass} type="button">
|
|
52
|
+
{btnName}
|
|
48
53
|
</button>
|
|
@@ -1,29 +1,19 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} ModalButtonProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} ModalButtonEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} ModalButtonSlots */
|
|
4
|
-
export default class ModalButton extends SvelteComponentTyped<{
|
|
5
|
-
id?: string;
|
|
6
|
-
btnColor?: string;
|
|
7
|
-
btnName?: string;
|
|
8
|
-
openFn?: (modal: any) => void;
|
|
9
|
-
}, {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
}, {}> {
|
|
12
|
-
}
|
|
13
|
-
export type ModalButtonProps = typeof __propDef.props;
|
|
14
|
-
export type ModalButtonEvents = typeof __propDef.events;
|
|
15
|
-
export type ModalButtonSlots = typeof __propDef.slots;
|
|
16
1
|
import { SvelteComponentTyped } from "svelte";
|
|
17
2
|
declare const __propDef: {
|
|
18
3
|
props: {
|
|
19
4
|
id?: string;
|
|
20
|
-
btnColor?: string;
|
|
21
5
|
btnName?: string;
|
|
22
|
-
|
|
6
|
+
btnColor?: string;
|
|
7
|
+
openFn?: (id: string) => void;
|
|
23
8
|
};
|
|
24
9
|
events: {
|
|
25
10
|
[evt: string]: CustomEvent<any>;
|
|
26
11
|
};
|
|
27
12
|
slots: {};
|
|
28
13
|
};
|
|
14
|
+
export declare type ModalButtonProps = typeof __propDef.props;
|
|
15
|
+
export declare type ModalButtonEvents = typeof __propDef.events;
|
|
16
|
+
export declare type ModalButtonSlots = typeof __propDef.slots;
|
|
17
|
+
export default class ModalButton extends SvelteComponentTyped<ModalButtonProps, ModalButtonEvents, ModalButtonSlots> {
|
|
18
|
+
}
|
|
29
19
|
export {};
|