flowbite-svelte 0.15.35 → 0.15.38
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/CHANGELOG.md +24 -0
- package/accordions/AccordionFlush.svelte +7 -1
- package/accordions/AccordionItem.svelte +19 -10
- package/accordions/AccordionItem.svelte.d.ts +2 -1
- package/alerts/Alert.svelte +35 -11
- package/cards/Card.svelte +27 -9
- package/cards/EcommerceCard.svelte +25 -9
- package/forms/Checkbox.svelte +7 -6
- package/forms/Checkbox.svelte.d.ts +5 -4
- package/forms/Toggle.svelte +4 -4
- package/forms/Toggle.svelte.d.ts +2 -2
- package/package.json +2 -2
- package/spinners/Spinner.svelte +1 -1
- package/spinners/Spinner.svelte.d.ts +1 -0
- package/types.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.15.38](https://github.com/themesberg/flowbite-svelte/compare/v0.15.37...v0.15.38) (2022-05-19)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* add props.class to Spinner ([3fe4f8b](https://github.com/themesberg/flowbite-svelte/commit/3fe4f8b20d7d89b2230b23904b0671cec900684d))
|
|
11
|
+
|
|
12
|
+
### [0.15.37](https://github.com/themesberg/flowbite-svelte/compare/v0.15.36...v0.15.37) (2022-05-18)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* add buttonClass to AccordionItem ([8387244](https://github.com/themesberg/flowbite-svelte/commit/83872440ebb872843a0f016f7fb576d156295b96))
|
|
18
|
+
|
|
19
|
+
### [0.15.36](https://github.com/themesberg/flowbite-svelte/compare/v0.15.35...v0.15.36) (2022-05-17)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* add '' to string types ([387363a](https://github.com/themesberg/flowbite-svelte/commit/387363a3b3668dc66a7790331927e1c1641e4de6))
|
|
25
|
+
* add bind:checked to Checkbox ([7cfcf67](https://github.com/themesberg/flowbite-svelte/commit/7cfcf67b52a1496f57f8ef31b4205464f9eb82a0))
|
|
26
|
+
* add bind:checked to Toggle ([18a34ea](https://github.com/themesberg/flowbite-svelte/commit/18a34eaaf65539bf176da642b4a04f644265f647))
|
|
27
|
+
* remove radio, search etc from InputType ([ed95418](https://github.com/themesberg/flowbite-svelte/commit/ed9541808da054b383c6addff55907d955dad32f))
|
|
28
|
+
|
|
5
29
|
### [0.15.35](https://github.com/themesberg/flowbite-svelte/compare/v0.15.34...v0.15.35) (2022-05-15)
|
|
6
30
|
|
|
7
31
|
|
|
@@ -22,7 +22,13 @@ export let iconClass = 'text-gray-500 sm:w-6 sm:h-6 dark:text-gray-300';
|
|
|
22
22
|
</script>
|
|
23
23
|
|
|
24
24
|
<h2 aria-expanded={isOpen}>
|
|
25
|
-
<button
|
|
25
|
+
<button
|
|
26
|
+
on:click={() => handleToggle(id)}
|
|
27
|
+
type="button"
|
|
28
|
+
class:rounded-t-xl={id === '1'}
|
|
29
|
+
class:border-t-0={id !== '1'}
|
|
30
|
+
class="{btnClass} {$$props.class || ''}"
|
|
31
|
+
>
|
|
26
32
|
<slot name="header" />
|
|
27
33
|
{#if isOpen}
|
|
28
34
|
<svelte:component this={icons.up} size={iconSize} class="mr-2 {iconClass}" />
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
3
|
import { ChevronDownSolid, ChevronUpSolid } from 'svelte-heros';
|
|
4
4
|
export let id = '';
|
|
5
|
-
export let btnClass = 'flex items-center focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 justify-between p-5 w-full font-medium border border-gray-200 dark:border-gray-700 text-left text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800';
|
|
6
5
|
export let slotClass = 'p-5 border border-t-0 border-gray-200 dark:border-gray-700';
|
|
7
6
|
export let isOpen = false;
|
|
8
7
|
export let color = false;
|
|
@@ -10,6 +9,11 @@ export let icons = {
|
|
|
10
9
|
up: ChevronUpSolid,
|
|
11
10
|
down: ChevronDownSolid
|
|
12
11
|
};
|
|
12
|
+
export let iconSize = 24;
|
|
13
|
+
export let iconClass = 'text-gray-500 sm:w-6 sm:h-6 dark:text-gray-300';
|
|
14
|
+
export let btnClass = 'flex items-center focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 justify-between p-5 w-full font-medium border border-gray-200 dark:border-gray-700 text-left text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800';
|
|
15
|
+
export let colorClass = 'focus:ring-blue-200 dark:focus:ring-blue-800 hover:bg-blue-100 text-blue-500 bg-blue-200 text-blue-700';
|
|
16
|
+
$: btnClass;
|
|
13
17
|
onMount(() => {
|
|
14
18
|
if (isOpen) {
|
|
15
19
|
isOpen = true;
|
|
@@ -17,19 +21,24 @@ onMount(() => {
|
|
|
17
21
|
});
|
|
18
22
|
const handleToggle = (id) => {
|
|
19
23
|
isOpen = !isOpen;
|
|
20
|
-
if (color && isOpen) {
|
|
21
|
-
btnClass = 'flex items-center focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 justify-between p-5 w-full font-medium border border-gray-200 dark:border-gray-700 text-left text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 focus:ring-blue-200 dark:focus:ring-blue-800 hover:bg-blue-100 text-blue-500 bg-blue-200 text-blue-700';
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
btnClass = 'flex items-center focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 justify-between p-5 w-full font-medium border border-gray-200 dark:border-gray-700 text-left text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800';
|
|
25
|
-
}
|
|
26
24
|
};
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
let buttonClass;
|
|
26
|
+
$: if (color && isOpen) {
|
|
27
|
+
buttonClass = btnClass + colorClass;
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
buttonClass = btnClass;
|
|
31
|
+
}
|
|
29
32
|
</script>
|
|
30
33
|
|
|
31
34
|
<h2 aria-expanded={isOpen}>
|
|
32
|
-
<button
|
|
35
|
+
<button
|
|
36
|
+
on:click={() => handleToggle(id)}
|
|
37
|
+
type="button"
|
|
38
|
+
class:rounded-t-xl={id === '1'}
|
|
39
|
+
class:border-t-0={id !== '1'}
|
|
40
|
+
class="{buttonClass} {$$props.class || ''}"
|
|
41
|
+
>
|
|
33
42
|
<slot name="header" />
|
|
34
43
|
{#if isOpen}
|
|
35
44
|
<svelte:component this={icons.up} size={iconSize} class="mr-2 {iconClass}" />
|
|
@@ -4,13 +4,14 @@ declare const __propDef: {
|
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
id?: string;
|
|
7
|
-
btnClass?: string;
|
|
8
7
|
slotClass?: string;
|
|
9
8
|
isOpen?: boolean;
|
|
10
9
|
color?: boolean;
|
|
11
10
|
icons?: AccordionIconType;
|
|
12
11
|
iconSize?: number;
|
|
13
12
|
iconClass?: string;
|
|
13
|
+
btnClass?: string;
|
|
14
|
+
colorClass?: string;
|
|
14
15
|
};
|
|
15
16
|
events: {
|
|
16
17
|
[evt: string]: CustomEvent<any>;
|
package/alerts/Alert.svelte
CHANGED
|
@@ -25,60 +25,68 @@ if (color === 'gray') {
|
|
|
25
25
|
if (borderAccent)
|
|
26
26
|
divClass += 'border-gray-500 dark:bg-gray-200 ';
|
|
27
27
|
contentClass = 'text-gray-700 dark:text-gray-800';
|
|
28
|
-
buttonClass +=
|
|
28
|
+
buttonClass +=
|
|
29
|
+
'bg-gray-100 text-gray-500 focus:ring-gray-400 hover:bg-gray-200 dark:bg-gray-200 dark:text-gray-600 dark:hover:bg-gray-300';
|
|
29
30
|
}
|
|
30
31
|
else if (color === 'red') {
|
|
31
32
|
divClass += 'bg-red-100 dark:bg-red-200';
|
|
32
33
|
if (borderAccent)
|
|
33
34
|
divClass += 'border-red-500 dark:bg-red-200 ';
|
|
34
35
|
contentClass = 'text-red-700 dark:text-red-800';
|
|
35
|
-
buttonClass +=
|
|
36
|
+
buttonClass +=
|
|
37
|
+
'bg-red-100 text-red-500 focus:ring-red-400 hover:bg-red-200 dark:bg-red-200 dark:text-red-600 dark:hover:bg-red-300';
|
|
36
38
|
}
|
|
37
39
|
else if (color === 'yellow') {
|
|
38
40
|
divClass += 'bg-yellow-100 dark:bg-yellow-200 ';
|
|
39
41
|
if (borderAccent)
|
|
40
42
|
divClass += 'border-yellow-500 dark:bg-tellow-200 ';
|
|
41
43
|
contentClass = 'text-yellow-700 dark:text-yellow-800';
|
|
42
|
-
buttonClass +=
|
|
44
|
+
buttonClass +=
|
|
45
|
+
'bg-yellow-100 text-yellow-500 focus:ring-yellow-400 hover:bg-yellow-200 dark:bg-yellow-200 dark:text-yellow-600 dark:hover:bg-yellow-300';
|
|
43
46
|
}
|
|
44
47
|
else if (color === 'green') {
|
|
45
48
|
divClass += 'bg-green-100 dark:bg-green-200 ';
|
|
46
49
|
if (borderAccent)
|
|
47
50
|
divClass += 'border-green-500 dark:bg-green-200 ';
|
|
48
51
|
contentClass = 'text-green-700 dark:text-green-800';
|
|
49
|
-
buttonClass +=
|
|
52
|
+
buttonClass +=
|
|
53
|
+
'bg-green-100 text-green-500 focus:ring-green-400 hover:bg-green-200 dark:bg-green-200 dark:text-green-600 dark:hover:bg-green-300';
|
|
50
54
|
}
|
|
51
55
|
else if (color === 'indigo') {
|
|
52
56
|
divClass += 'bg-indigo-100 dark:bg-indigo-200 ';
|
|
53
57
|
if (borderAccent)
|
|
54
58
|
divClass += 'border-indigo-500 dark:bg-indigo-200 ';
|
|
55
59
|
contentClass = 'text-indigo-700 dark:text-indigo-800';
|
|
56
|
-
buttonClass +=
|
|
60
|
+
buttonClass +=
|
|
61
|
+
'bg-indigo-100 text-indigo-500 focus:ring-indigo-400 hover:bg-indigo-200 dark:bg-indigo-200 dark:text-indigo-600 dark:hover:bg-indigo-300';
|
|
57
62
|
}
|
|
58
63
|
else if (color === 'purple') {
|
|
59
64
|
divClass += 'bg-purple-100 dark:bg-purple-200 ';
|
|
60
65
|
if (borderAccent)
|
|
61
66
|
divClass += 'border-purple-500 dark:bg-purple-200 ';
|
|
62
67
|
contentClass = 'text-purple-700 dark:text-purple-800';
|
|
63
|
-
buttonClass +=
|
|
68
|
+
buttonClass +=
|
|
69
|
+
'bg-purple-100 text-purple-500 focus:ring-purple-400 hover:bg-purple-200 dark:bg-purple-200 dark:text-purple-600 dark:hover:bg-purple-300';
|
|
64
70
|
}
|
|
65
71
|
else if (color === 'pink') {
|
|
66
72
|
divClass += 'bg-pink-100 dark:bg-pink-200 ';
|
|
67
73
|
if (borderAccent)
|
|
68
74
|
divClass += 'border-pink-500 dark:bg-pink-200 ';
|
|
69
75
|
contentClass = 'text-pink-700 dark:text-pink-800';
|
|
70
|
-
buttonClass +=
|
|
76
|
+
buttonClass +=
|
|
77
|
+
'bg-pink-100 text-pink-500 focus:ring-pink-400 hover:bg-pink-200 dark:bg-pink-200 dark:text-pink-600 dark:hover:bg-pink-300';
|
|
71
78
|
}
|
|
72
79
|
else {
|
|
73
80
|
divClass += 'bg-blue-100 dark:bg-blue-200 ';
|
|
74
81
|
if (borderAccent)
|
|
75
82
|
divClass += 'border-blue-500 dark:bg-blue-200 ';
|
|
76
83
|
contentClass = 'text-blue-700 dark:text-blue-800';
|
|
77
|
-
buttonClass +=
|
|
84
|
+
buttonClass +=
|
|
85
|
+
'bg-blue-100 text-blue-500 focus:ring-blue-400 hover:bg-blue-200 dark:bg-blue-200 dark:text-blue-600 dark:hover:bg-blue-300';
|
|
78
86
|
}
|
|
79
87
|
</script>
|
|
80
88
|
|
|
81
|
-
<div id={$$props.id} class:hidden class="{divClass} {$$props.class
|
|
89
|
+
<div id={$$props.id} class:hidden class="{divClass} {$$props.class || ''}" role="alert">
|
|
82
90
|
<div class="flex">
|
|
83
91
|
{#if icon}
|
|
84
92
|
<svelte:component this={icon} class="flex-shrink-0 w-5 h-5 {contentClass} mr-3" />
|
|
@@ -89,9 +97,25 @@ else {
|
|
|
89
97
|
</div>
|
|
90
98
|
|
|
91
99
|
{#if closeBtn}
|
|
92
|
-
<button
|
|
100
|
+
<button
|
|
101
|
+
on:click={handleHide}
|
|
102
|
+
on:click={handleAlert}
|
|
103
|
+
type="button"
|
|
104
|
+
class={buttonClass}
|
|
105
|
+
aria-label="Close"
|
|
106
|
+
>
|
|
93
107
|
<span class="sr-only">Close</span>
|
|
94
|
-
<svg
|
|
108
|
+
<svg
|
|
109
|
+
class="w-5 h-5"
|
|
110
|
+
fill="currentColor"
|
|
111
|
+
viewBox="0 0 20 20"
|
|
112
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
113
|
+
><path
|
|
114
|
+
fill-rule="evenodd"
|
|
115
|
+
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"
|
|
116
|
+
clip-rule="evenodd"
|
|
117
|
+
/></svg
|
|
118
|
+
>
|
|
95
119
|
</button>
|
|
96
120
|
{/if}
|
|
97
121
|
</div>
|
package/cards/Card.svelte
CHANGED
|
@@ -10,28 +10,36 @@ export let header = '';
|
|
|
10
10
|
export let divClass = 'max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700';
|
|
11
11
|
let buttonClass = 'inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white focus:ring-4 ';
|
|
12
12
|
if (btnColor === 'gray') {
|
|
13
|
-
buttonClass +=
|
|
13
|
+
buttonClass +=
|
|
14
|
+
'bg-gray-700 rounded-lg hover:bg-gray-800 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800';
|
|
14
15
|
}
|
|
15
16
|
else if (btnColor === 'red') {
|
|
16
|
-
buttonClass +=
|
|
17
|
+
buttonClass +=
|
|
18
|
+
'bg-red-700 rounded-lg hover:bg-red-800 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800';
|
|
17
19
|
}
|
|
18
20
|
else if (btnColor === 'yellow') {
|
|
19
|
-
buttonClass +=
|
|
21
|
+
buttonClass +=
|
|
22
|
+
'bg-yellow-700 rounded-lg hover:bg-yellow-800 focus:ring-yellow-300 dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800';
|
|
20
23
|
}
|
|
21
24
|
else if (btnColor === 'green') {
|
|
22
|
-
buttonClass +=
|
|
25
|
+
buttonClass +=
|
|
26
|
+
'bg-green-700 rounded-lg hover:bg-green-800 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800';
|
|
23
27
|
}
|
|
24
28
|
else if (btnColor === 'indigo') {
|
|
25
|
-
buttonClass +=
|
|
29
|
+
buttonClass +=
|
|
30
|
+
'bg-indigo-700 rounded-lg hover:bg-indigo-800 focus:ring-indigo-300 dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800';
|
|
26
31
|
}
|
|
27
32
|
else if (btnColor === 'purple') {
|
|
28
|
-
buttonClass +=
|
|
33
|
+
buttonClass +=
|
|
34
|
+
'bg-purple-700 rounded-lg hover:bg-purple-800 focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800';
|
|
29
35
|
}
|
|
30
36
|
else if (btnColor === 'pink') {
|
|
31
|
-
buttonClass +=
|
|
37
|
+
buttonClass +=
|
|
38
|
+
'bg-pink-700 rounded-lg hover:bg-pink-800 focus:ring-pink-300 dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800';
|
|
32
39
|
}
|
|
33
40
|
else {
|
|
34
|
-
buttonClass +=
|
|
41
|
+
buttonClass +=
|
|
42
|
+
'bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
35
43
|
}
|
|
36
44
|
</script>
|
|
37
45
|
|
|
@@ -65,7 +73,17 @@ else {
|
|
|
65
73
|
{#if link && btnLabel}
|
|
66
74
|
<a href={link} {rel} class={buttonClass}>
|
|
67
75
|
{btnLabel}
|
|
68
|
-
<svg
|
|
76
|
+
<svg
|
|
77
|
+
class="ml-2 -mr-1 w-4 h-4"
|
|
78
|
+
fill="currentColor"
|
|
79
|
+
viewBox="0 0 20 20"
|
|
80
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
81
|
+
><path
|
|
82
|
+
fill-rule="evenodd"
|
|
83
|
+
d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z"
|
|
84
|
+
clip-rule="evenodd"
|
|
85
|
+
/></svg
|
|
86
|
+
>
|
|
69
87
|
</a>
|
|
70
88
|
{/if}
|
|
71
89
|
</div>
|
|
@@ -13,35 +13,43 @@ let spanClass = 'text-xs font-semibold mr-2 px-2.5 py-0.5 rounded ml-3 ';
|
|
|
13
13
|
let linkClass = 'text-white focus:ring-4 font-medium rounded-lg text-sm px-5 py-2.5 text-center ';
|
|
14
14
|
if (btnColor === 'gray') {
|
|
15
15
|
spanClass += 'bg-gray-100 text-gray-800 dark:bg-gray-200 dark:text-gray-800';
|
|
16
|
-
linkClass +=
|
|
16
|
+
linkClass +=
|
|
17
|
+
'bg-gray-700 hover:bg-gray-800 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800';
|
|
17
18
|
}
|
|
18
19
|
else if (btnColor === 'red') {
|
|
19
20
|
spanClass += 'bg-red-100 text-red-800 dark:bg-red-200 dark:text-red-800';
|
|
20
|
-
linkClass +=
|
|
21
|
+
linkClass +=
|
|
22
|
+
'bg-red-700 hover:bg-red-800 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800';
|
|
21
23
|
}
|
|
22
24
|
else if (btnColor === 'yellow') {
|
|
23
25
|
spanClass += 'bg-yellow-100 text-yellow-800 dark:bg-yellow-200 dark:text-yellow-800';
|
|
24
|
-
linkClass +=
|
|
26
|
+
linkClass +=
|
|
27
|
+
'bg-yellow-700 hover:bg-yellow-800 focus:ring-yellow-300 dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800';
|
|
25
28
|
}
|
|
26
29
|
else if (btnColor === 'green') {
|
|
27
30
|
spanClass += 'bg-green-100 text-green-800 dark:bg-green-200 dark:text-green-800';
|
|
28
|
-
linkClass +=
|
|
31
|
+
linkClass +=
|
|
32
|
+
'bg-green-700 hover:bg-green-800 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800';
|
|
29
33
|
}
|
|
30
34
|
else if (btnColor === 'indigo') {
|
|
31
35
|
spanClass += 'bg-indigo-100 text-indigo-800 dark:bg-indigo-200 dark:text-indigo-800';
|
|
32
|
-
linkClass +=
|
|
36
|
+
linkClass +=
|
|
37
|
+
'bg-indigo-700 hover:bg-indigo-800 focus:ring-indigo-300 dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800';
|
|
33
38
|
}
|
|
34
39
|
else if (btnColor === 'purple') {
|
|
35
40
|
spanClass += 'bg-purple-100 text-purple-800 dark:bg-purple-200 dark:text-purple-800';
|
|
36
|
-
linkClass +=
|
|
41
|
+
linkClass +=
|
|
42
|
+
'bg-purple-700 hover:bg-purple-800 focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800';
|
|
37
43
|
}
|
|
38
44
|
else if (btnColor === 'pink') {
|
|
39
45
|
spanClass += 'bg-pink-100 text-pink-800 dark:bg-pink-200 dark:text-pink-800';
|
|
40
|
-
linkClass +=
|
|
46
|
+
linkClass +=
|
|
47
|
+
'bg-pink-700 hover:bg-pink-800 focus:ring-pink-300 dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800';
|
|
41
48
|
}
|
|
42
49
|
else {
|
|
43
50
|
spanClass += 'bg-blue-100 text-blue-800 dark:bg-blue-200 dark:text-blue-800';
|
|
44
|
-
linkClass +=
|
|
51
|
+
linkClass +=
|
|
52
|
+
'bg-blue-700 hover:bg-blue-800 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
45
53
|
}
|
|
46
54
|
</script>
|
|
47
55
|
|
|
@@ -58,7 +66,15 @@ else {
|
|
|
58
66
|
<div class="flex items-center mt-2.5 mb-5">
|
|
59
67
|
{#if stars}
|
|
60
68
|
{#each { length: stars } as _, i}
|
|
61
|
-
<svg
|
|
69
|
+
<svg
|
|
70
|
+
class="w-5 h-5 text-yellow-300"
|
|
71
|
+
fill="currentColor"
|
|
72
|
+
viewBox="0 0 20 20"
|
|
73
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
74
|
+
><path
|
|
75
|
+
d="M9.049 2.927c.3-.921 1.603-.921 1.902 0l1.07 3.292a1 1 0 00.95.69h3.462c.969 0 1.371 1.24.588 1.81l-2.8 2.034a1 1 0 00-.364 1.118l1.07 3.292c.3.921-.755 1.688-1.54 1.118l-2.8-2.034a1 1 0 00-1.175 0l-2.8 2.034c-.784.57-1.838-.197-1.539-1.118l1.07-3.292a1 1 0 00-.364-1.118L2.98 8.72c-.783-.57-.38-1.81.588-1.81h3.461a1 1 0 00.951-.69l1.07-3.292z"
|
|
76
|
+
/></svg
|
|
77
|
+
>
|
|
62
78
|
{/each}
|
|
63
79
|
<span class={spanClass}>{stars}</span>
|
|
64
80
|
{/if}
|
package/forms/Checkbox.svelte
CHANGED
|
@@ -31,16 +31,17 @@ else if (color === 'orange') {
|
|
|
31
31
|
else {
|
|
32
32
|
inputClass += 'text-blue-600 focus:ring-blue-500 dark:focus:ring-blue-600';
|
|
33
33
|
}
|
|
34
|
-
export let helper;
|
|
35
|
-
export let id;
|
|
36
|
-
export let value;
|
|
37
|
-
export let label;
|
|
34
|
+
export let helper = '';
|
|
35
|
+
export let id = '';
|
|
36
|
+
export let value = '';
|
|
37
|
+
export let label = '';
|
|
38
|
+
export let checked = false;
|
|
38
39
|
</script>
|
|
39
40
|
|
|
40
41
|
{#if helper}
|
|
41
42
|
<div class="flex">
|
|
42
43
|
<div class={divHelperClass}>
|
|
43
|
-
<input {id} type="checkbox" {name} {value} class={inputClass} aria-labelledby={id} aria-describedby={id} {disabled} {...$$restProps} />
|
|
44
|
+
<input {id} type="checkbox" bind:checked {name} {value} class={inputClass} aria-labelledby={id} aria-describedby={id} {disabled} {...$$restProps} />
|
|
44
45
|
</div>
|
|
45
46
|
<div class="ml-2 text-sm">
|
|
46
47
|
<label for={id} class={labelHelperClass}>
|
|
@@ -51,7 +52,7 @@ export let label;
|
|
|
51
52
|
</div>
|
|
52
53
|
{:else}
|
|
53
54
|
<div class={divClass}>
|
|
54
|
-
<input {id} type="checkbox" {name} {value} class={inputClass} aria-labelledby={id} aria-describedby={id} {disabled} {...$$restProps} />
|
|
55
|
+
<input {id} type="checkbox" bind:checked {name} {value} class={inputClass} aria-labelledby={id} aria-describedby={id} {disabled} {...$$restProps} />
|
|
55
56
|
<label for={id} class={labelClass}>
|
|
56
57
|
{@html label}
|
|
57
58
|
</label>
|
|
@@ -12,10 +12,11 @@ declare const __propDef: {
|
|
|
12
12
|
labelHelperClass?: string;
|
|
13
13
|
helperClass?: string;
|
|
14
14
|
color?: FormColorType;
|
|
15
|
-
helper
|
|
16
|
-
id
|
|
17
|
-
value
|
|
18
|
-
label
|
|
15
|
+
helper?: string;
|
|
16
|
+
id?: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
checked?: boolean;
|
|
19
20
|
};
|
|
20
21
|
events: {
|
|
21
22
|
[evt: string]: CustomEvent<any>;
|
package/forms/Toggle.svelte
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script>import generateId from '../utils/generateId.js';
|
|
2
2
|
export let name = 'toggle-example';
|
|
3
|
-
export let color;
|
|
3
|
+
export let color = 'blue';
|
|
4
4
|
export let size = 'default';
|
|
5
5
|
export let id = generateId();
|
|
6
6
|
export let label = 'Toggle me';
|
|
7
|
-
export let value;
|
|
7
|
+
export let value = '';
|
|
8
8
|
export let checked = false;
|
|
9
9
|
export let disabled = false;
|
|
10
10
|
export let labelClass = 'relative inline-flex items-center cursor-pointer';
|
|
11
|
-
export let divClass =
|
|
11
|
+
export let divClass = "w-11 h-6 bg-gray-200 rounded-full peer peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600";
|
|
12
12
|
export let inputClass = 'sr-only';
|
|
13
13
|
if (color || size) {
|
|
14
14
|
inputClass += ' peer';
|
|
@@ -41,7 +41,7 @@ else if (size === 'large') {
|
|
|
41
41
|
</script>
|
|
42
42
|
|
|
43
43
|
<label for={id} class={labelClass}>
|
|
44
|
-
<input type="checkbox" {id} class={inputClass} {value}
|
|
44
|
+
<input type="checkbox" {id} class={inputClass} {value} bind:checked {name} {disabled} />
|
|
45
45
|
<div class="{divClass} {$$props.class ? $$props.class : ''}" />
|
|
46
46
|
<span class={spanClass}>{label}</span>
|
|
47
47
|
</label>
|
package/forms/Toggle.svelte.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ declare const __propDef: {
|
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
name?: string;
|
|
7
|
-
color
|
|
7
|
+
color?: ToggleColorType;
|
|
8
8
|
size?: 'small' | 'default' | 'large';
|
|
9
9
|
id?: string;
|
|
10
10
|
label?: string;
|
|
11
|
-
value
|
|
11
|
+
value?: string;
|
|
12
12
|
checked?: boolean;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
labelClass?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.38",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
|
19
19
|
"@typescript-eslint/parser": "^5.10.1",
|
|
20
20
|
"autoprefixer": "^10.4.4",
|
|
21
|
-
"createprops": "^0.
|
|
21
|
+
"createprops": "^0.4.4",
|
|
22
22
|
"eslint": "^7.32.0",
|
|
23
23
|
"eslint-config-prettier": "^8.3.0",
|
|
24
24
|
"eslint-plugin-svelte3": "^3.2.1",
|
package/spinners/Spinner.svelte
CHANGED
|
@@ -37,7 +37,7 @@ else {
|
|
|
37
37
|
}
|
|
38
38
|
</script>
|
|
39
39
|
|
|
40
|
-
<svg role="status" class="inline w-{size} h-{size}
|
|
40
|
+
<svg role="status" class="inline w-{size} h-{size} {$$props.class || ''} {bg} animate-spin dark:text-gray-600 {fillColorClass}" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
41
41
|
<path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill={currentFill} />
|
|
42
42
|
<path
|
|
43
43
|
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
|
package/types.d.ts
CHANGED
|
@@ -90,7 +90,7 @@ export declare type ImgType = {
|
|
|
90
90
|
src: string;
|
|
91
91
|
alt?: string;
|
|
92
92
|
};
|
|
93
|
-
export declare type InputType = '
|
|
93
|
+
export declare type InputType = 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'reset' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
|
94
94
|
export interface InteractiveTabType {
|
|
95
95
|
name: string;
|
|
96
96
|
id: number;
|
|
@@ -194,7 +194,7 @@ export interface TimelineItemHorizontalType {
|
|
|
194
194
|
iconClass?: string;
|
|
195
195
|
text?: HTMLElement | string;
|
|
196
196
|
}
|
|
197
|
-
export declare type ToggleColorType = 'red' | 'green' | 'purple' | 'yellow' | 'teal' | 'orange';
|
|
197
|
+
export declare type ToggleColorType = 'blue' | 'red' | 'green' | 'purple' | 'yellow' | 'teal' | 'orange';
|
|
198
198
|
export interface TransitionParamTypes {
|
|
199
199
|
delay?: number;
|
|
200
200
|
duration?: number;
|