flowbite-svelte 0.8.7 → 0.9.1
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 +9 -1
- package/accordions/AccordionDefault.svelte +20 -21
- package/accordions/AccordionDefault.svelte.d.ts +6 -19
- package/alerts/Alert.svelte +90 -97
- package/alerts/Alert.svelte.d.ts +7 -17
- package/alerts/BorderAlert.svelte +90 -104
- package/alerts/BorderAlert.svelte.d.ts +7 -17
- package/alerts/InfoAlert.svelte +106 -111
- package/alerts/InfoAlert.svelte.d.ts +8 -20
- package/badges/Badge.svelte +22 -16
- package/badges/Badge.svelte.d.ts +8 -16
- package/badges/BadgeIcon.svelte +24 -18
- package/badges/BadgeIcon.svelte.d.ts +8 -18
- package/badges/BadgeLink.svelte +23 -17
- package/badges/BadgeLink.svelte.d.ts +9 -18
- package/buttongroups/ButtonGroup.svelte +49 -59
- package/buttongroups/ButtonGroup.svelte.d.ts +7 -23
- package/buttongroups/ButtonGroupOutline.svelte +49 -61
- package/buttongroups/ButtonGroupOutline.svelte.d.ts +7 -23
- package/buttons/Button.svelte +48 -35
- package/buttons/Button.svelte.d.ts +8 -19
- package/buttons/ColorShadowButton.svelte +22 -16
- package/buttons/ColorShadowButton.svelte.d.ts +8 -18
- package/buttons/GradientDuotoneButton.svelte +20 -15
- package/buttons/GradientDuotoneButton.svelte.d.ts +8 -18
- package/buttons/GradientMonochromeButton.svelte +22 -16
- package/buttons/GradientMonochromeButton.svelte.d.ts +8 -18
- package/buttons/GradientOutlineButton.svelte +30 -25
- package/buttons/GradientOutlineButton.svelte.d.ts +8 -18
- package/cards/Card.svelte +73 -71
- package/cards/Card.svelte.d.ts +12 -26
- package/cards/CtaCard.svelte +56 -55
- package/cards/CtaCard.svelte.d.ts +8 -32
- package/cards/EcommerceCard.svelte +77 -77
- package/cards/EcommerceCard.svelte.d.ts +10 -28
- package/dropdowns/DropdownDefault.svelte.d.ts +2 -2
- package/footer/LogoFooter.svelte +4 -2
- package/footer/LogoFooter.svelte.d.ts +4 -0
- package/footer/SimpleFooter.svelte +5 -3
- package/footer/SimpleFooter.svelte.d.ts +4 -0
- package/footer/SitemapFooter.svelte +3 -1
- package/footer/SitemapFooter.svelte.d.ts +4 -0
- package/footer/SocialMediaFooter.svelte +4 -2
- package/footer/SocialMediaFooter.svelte.d.ts +4 -0
- package/modals/ExtraLargeModal.svelte.d.ts +2 -2
- package/modals/LargeModal.svelte.d.ts +2 -2
- package/modals/MediumModal.svelte.d.ts +2 -2
- package/modals/SmallModal.svelte.d.ts +2 -2
- package/package.json +34 -10
- package/types.d.ts +23 -0
- package/types.js +1 -0
package/alerts/InfoAlert.svelte
CHANGED
|
@@ -1,125 +1,120 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let hidden = false;
|
|
8
|
-
const handleHide = () => {
|
|
1
|
+
<script >export let color = 'blue';
|
|
2
|
+
export let alertId = 'alert-additional-content-1';
|
|
3
|
+
export let infoLink = undefined;
|
|
4
|
+
export let closeBtn = false;
|
|
5
|
+
let hidden = false;
|
|
6
|
+
const handleHide = () => {
|
|
9
7
|
hidden = !hidden;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
svgClass = "mr-2 w-5 h-5 text-blue-700 dark:text-blue-800";
|
|
20
|
-
slotClass = "mt-2 mb-4 text-sm text-blue-700 dark:text-blue-800";
|
|
8
|
+
};
|
|
9
|
+
let divClass;
|
|
10
|
+
let svgClass;
|
|
11
|
+
let slotClass;
|
|
12
|
+
let buttonClass;
|
|
13
|
+
if (color === 'blue') {
|
|
14
|
+
divClass = 'p-4 mb-4 bg-blue-100 rounded-lg dark:bg-blue-200';
|
|
15
|
+
svgClass = 'mr-2 w-5 h-5 text-blue-700 dark:text-blue-800';
|
|
16
|
+
slotClass = 'mt-2 mb-4 text-sm text-blue-700 dark:text-blue-800';
|
|
21
17
|
buttonClass =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
'text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-xs px-3 py-1.5 mr-2 text-center inline-flex items-center dark:bg-blue-800 dark:hover:bg-blue-900';
|
|
19
|
+
}
|
|
20
|
+
else if (color === 'gray') {
|
|
21
|
+
divClass = 'p-4 mb-4 bg-gray-100 rounded-lg dark:bg-gray-200';
|
|
22
|
+
svgClass = 'mr-2 w-5 h-5 text-gray-700 dark:text-gray-800';
|
|
23
|
+
slotClass = 'mt-2 mb-4 text-sm text-gray-700 dark:text-gray-800';
|
|
27
24
|
buttonClass =
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
25
|
+
'text-white bg-gray-700 hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg text-xs px-3 py-1.5 mr-2 text-center inline-flex items-center dark:bg-gray-800 dark:hover:bg-gray-900';
|
|
26
|
+
}
|
|
27
|
+
else if (color === 'red') {
|
|
28
|
+
divClass = 'p-4 mb-4 bg-red-100 rounded-lg dark:bg-red-200';
|
|
29
|
+
svgClass = 'mr-2 w-5 h-5 text-red-700 dark:text-red-800';
|
|
30
|
+
slotClass = 'mt-2 mb-4 text-sm text-red-700 dark:text-red-800';
|
|
33
31
|
buttonClass =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
'text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg text-xs px-3 py-1.5 mr-2 text-center inline-flex items-center dark:bg-red-800 dark:hover:bg-red-900';
|
|
33
|
+
}
|
|
34
|
+
else if (color === 'yellow') {
|
|
35
|
+
divClass = 'p-4 mb-4 bg-yellow-100 rounded-lg dark:bg-yellow-200';
|
|
36
|
+
svgClass = 'mr-2 w-5 h-5 text-yellow-700 dark:text-yellow-800';
|
|
37
|
+
slotClass = 'mt-2 mb-4 text-sm text-yellow-700 dark:text-yellow-800';
|
|
39
38
|
buttonClass =
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
'text-white bg-yellow-700 hover:bg-yellow-800 focus:ring-4 focus:ring-yellow-300 font-medium rounded-lg text-xs px-3 py-1.5 mr-2 text-center inline-flex items-center dark:bg-yellow-800 dark:hover:bg-yellow-900';
|
|
40
|
+
}
|
|
41
|
+
else if (color === 'green') {
|
|
42
|
+
divClass = 'p-4 mb-4 bg-green-100 rounded-lg dark:bg-green-200';
|
|
43
|
+
svgClass = 'mr-2 w-5 h-5 text-green-700 dark:text-green-800';
|
|
44
|
+
slotClass = 'mt-2 mb-4 text-sm text-green-700 dark:text-green-800';
|
|
45
45
|
buttonClass =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
46
|
+
'text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg text-xs px-3 py-1.5 mr-2 text-center inline-flex items-center dark:bg-green-800 dark:hover:bg-green-900';
|
|
47
|
+
}
|
|
48
|
+
else if (color === 'indigo') {
|
|
49
|
+
divClass = 'p-4 mb-4 bg-indigo-100 rounded-lg dark:bg-indigo-200';
|
|
50
|
+
svgClass = 'mr-2 w-5 h-5 text-indigo-700 dark:text-indigo-800';
|
|
51
|
+
slotClass = 'mt-2 mb-4 text-sm text-indigo-700 dark:text-indigo-800';
|
|
51
52
|
buttonClass =
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
'text-white bg-indigo-700 hover:bg-indigo-800 focus:ring-4 focus:ring-indigo-300 font-medium rounded-lg text-xs px-3 py-1.5 mr-2 text-center inline-flex items-center dark:bg-indigo-800 dark:hover:bg-indigo-900';
|
|
54
|
+
}
|
|
55
|
+
else if (color === 'purple') {
|
|
56
|
+
divClass = 'p-4 mb-4 bg-purple-100 rounded-lg dark:bg-purple-200';
|
|
57
|
+
svgClass = 'mr-2 w-5 h-5 text-purple-700 dark:text-purple-800';
|
|
58
|
+
slotClass = 'mt-2 mb-4 text-sm text-purple-700 dark:text-purple-800';
|
|
57
59
|
buttonClass =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
'text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg text-xs px-3 py-1.5 mr-2 text-center inline-flex items-center dark:bg-purple-800 dark:hover:bg-purple-900';
|
|
61
|
+
}
|
|
62
|
+
else if (color === 'pink') {
|
|
63
|
+
divClass = 'p-4 mb-4 bg-pink-100 rounded-lg dark:bg-pink-200';
|
|
64
|
+
svgClass = 'mr-2 w-5 h-5 text-pink-700 dark:text-pink-800';
|
|
65
|
+
slotClass = 'mt-2 mb-4 text-sm text-pink-700 dark:text-pink-800';
|
|
63
66
|
buttonClass =
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
'text-white bg-pink-700 hover:bg-pink-800 focus:ring-4 focus:ring-pink-300 font-medium rounded-lg text-xs px-3 py-1.5 mr-2 text-center inline-flex items-center dark:bg-pink-800 dark:hover:bg-pink-900';
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
divClass = 'p-4 mb-4 bg-blue-100 rounded-lg dark:bg-blue-200';
|
|
71
|
+
svgClass = 'mr-2 w-5 h-5 text-blue-700 dark:text-blue-800';
|
|
72
|
+
slotClass = 'mt-2 mb-4 text-sm text-blue-700 dark:text-blue-800';
|
|
69
73
|
buttonClass =
|
|
70
|
-
|
|
71
|
-
|
|
74
|
+
'text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-xs px-3 py-1.5 mr-2 text-center inline-flex items-center dark:bg-blue-800 dark:hover:bg-blue-900';
|
|
75
|
+
}
|
|
72
76
|
</script>
|
|
73
77
|
|
|
74
78
|
<div id={alertId} class:hidden class={divClass} role="alert">
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
on:click={handleHide}
|
|
117
|
-
type="button"
|
|
118
|
-
class="text-{color}-700 bg-transparent border border-{color}-700 hover:bg-{color}-800 hover:text-white focus:ring-4 focus:ring-{color}-300 font-medium rounded-lg text-xs px-3 py-1.5 text-center dark:border-{color}-800 dark:text-{color}-800 dark:hover:text-white"
|
|
119
|
-
aria-label="Close"
|
|
120
|
-
>
|
|
121
|
-
Dismiss
|
|
122
|
-
</button>
|
|
123
|
-
{/if}
|
|
124
|
-
</div>
|
|
79
|
+
<div class="flex items-center">
|
|
80
|
+
<svg class={svgClass} fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
|
|
81
|
+
><path
|
|
82
|
+
fill-rule="evenodd"
|
|
83
|
+
d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z"
|
|
84
|
+
clip-rule="evenodd"
|
|
85
|
+
/></svg
|
|
86
|
+
>
|
|
87
|
+
<h3 class="text-lg font-medium text-{color}-700 dark:text-{color}-800">
|
|
88
|
+
<slot name="header">No header was provided</slot>
|
|
89
|
+
</h3>
|
|
90
|
+
</div>
|
|
91
|
+
<div class={slotClass}>
|
|
92
|
+
<slot>No content was provided.</slot>
|
|
93
|
+
</div>
|
|
94
|
+
<div class="flex">
|
|
95
|
+
{#if infoLink}
|
|
96
|
+
<button
|
|
97
|
+
type="button"
|
|
98
|
+
class="text-white bg-{color}-700 hover:bg-{color}-800 focus:ring-4 focus:ring-{color}-300 font-medium rounded-lg text-xs px-3 py-1.5 mr-2 text-center inline-flex items-center dark:bg-{color}-800 dark:hover:bg-{color}-900"
|
|
99
|
+
>
|
|
100
|
+
<svg
|
|
101
|
+
class="-ml-0.5 mr-2 h-4 w-4"
|
|
102
|
+
fill="currentColor"
|
|
103
|
+
viewBox="0 0 20 20"
|
|
104
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
105
|
+
><path d="M10 12a2 2 0 100-4 2 2 0 000 4z" /><path
|
|
106
|
+
fill-rule="evenodd"
|
|
107
|
+
d="M.458 10C1.732 5.943 5.522 3 10 3s8.268 2.943 9.542 7c-1.274 4.057-5.064 7-9.542 7S1.732 14.057.458 10zM14 10a4 4 0 11-8 0 4 4 0 018 0z"
|
|
108
|
+
clip-rule="evenodd"
|
|
109
|
+
/></svg
|
|
110
|
+
>
|
|
111
|
+
<a href={infoLink} rel="external">View more</a>
|
|
112
|
+
</button>
|
|
113
|
+
{/if}
|
|
114
|
+
{#if closeBtn}
|
|
115
|
+
<button on:click={handleHide} type="button" class={buttonClass} aria-label="Close">
|
|
116
|
+
Dismiss
|
|
117
|
+
</button>
|
|
118
|
+
{/if}
|
|
119
|
+
</div>
|
|
125
120
|
</div>
|
|
@@ -1,28 +1,11 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} InfoAlertProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} InfoAlertEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} InfoAlertSlots */
|
|
4
|
-
export default class InfoAlert extends SvelteComponentTyped<{
|
|
5
|
-
color?: string;
|
|
6
|
-
alertId?: string;
|
|
7
|
-
closeBtn?: boolean;
|
|
8
|
-
infoLink?: boolean;
|
|
9
|
-
}, {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
}, {
|
|
12
|
-
header: {};
|
|
13
|
-
default: {};
|
|
14
|
-
}> {
|
|
15
|
-
}
|
|
16
|
-
export type InfoAlertProps = typeof __propDef.props;
|
|
17
|
-
export type InfoAlertEvents = typeof __propDef.events;
|
|
18
|
-
export type InfoAlertSlots = typeof __propDef.slots;
|
|
19
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Colors } from '../types';
|
|
20
3
|
declare const __propDef: {
|
|
21
4
|
props: {
|
|
22
|
-
color?:
|
|
5
|
+
color?: Colors;
|
|
23
6
|
alertId?: string;
|
|
7
|
+
infoLink?: string;
|
|
24
8
|
closeBtn?: boolean;
|
|
25
|
-
infoLink?: boolean;
|
|
26
9
|
};
|
|
27
10
|
events: {
|
|
28
11
|
[evt: string]: CustomEvent<any>;
|
|
@@ -32,4 +15,9 @@ declare const __propDef: {
|
|
|
32
15
|
default: {};
|
|
33
16
|
};
|
|
34
17
|
};
|
|
18
|
+
export declare type InfoAlertProps = typeof __propDef.props;
|
|
19
|
+
export declare type InfoAlertEvents = typeof __propDef.events;
|
|
20
|
+
export declare type InfoAlertSlots = typeof __propDef.slots;
|
|
21
|
+
export default class InfoAlert extends SvelteComponentTyped<InfoAlertProps, InfoAlertEvents, InfoAlertSlots> {
|
|
22
|
+
}
|
|
35
23
|
export {};
|
package/badges/Badge.svelte
CHANGED
|
@@ -1,28 +1,34 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let badgeClass;
|
|
7
|
-
if (color === "blue") {
|
|
1
|
+
<script >export let textSize = 'text-xs';
|
|
2
|
+
export let name = 'Read more';
|
|
3
|
+
export let color = 'blue';
|
|
4
|
+
let badgeClass;
|
|
5
|
+
if (color === 'blue') {
|
|
8
6
|
badgeClass = `bg-blue-100 text-blue-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-blue-200 dark:text-blue-800`;
|
|
9
|
-
|
|
7
|
+
}
|
|
8
|
+
else if (color === 'gray') {
|
|
10
9
|
badgeClass = `bg-gray-100 text-gray-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-gray-700 dark:text-gray-300`;
|
|
11
|
-
|
|
10
|
+
}
|
|
11
|
+
else if (color === 'red') {
|
|
12
12
|
badgeClass = `bg-red-100 text-red-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-red-200 dark:text-red-900`;
|
|
13
|
-
|
|
13
|
+
}
|
|
14
|
+
else if (color === 'green') {
|
|
14
15
|
badgeClass = `bg-green-100 text-green-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-green-200 dark:text-green-900`;
|
|
15
|
-
|
|
16
|
+
}
|
|
17
|
+
else if (color === 'yellow') {
|
|
16
18
|
badgeClass = `bg-yellow-100 text-yellow-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-yellow-200 dark:text-yellow-900`;
|
|
17
|
-
|
|
19
|
+
}
|
|
20
|
+
else if (color === 'indigo') {
|
|
18
21
|
badgeClass = `bg-indigo-100 text-indigo-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-indigo-200 dark:text-indigo-900`;
|
|
19
|
-
|
|
22
|
+
}
|
|
23
|
+
else if (color === 'purple') {
|
|
20
24
|
badgeClass = `bg-purple-100 text-purple-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-purple-200 dark:text-purple-900`;
|
|
21
|
-
|
|
25
|
+
}
|
|
26
|
+
else if (color === 'pink') {
|
|
22
27
|
badgeClass = `bg-pink-100 text-pink-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-pink-200 dark:text-pink-900`;
|
|
23
|
-
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
24
30
|
badgeClass = `bg-blue-100 text-blue-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-blue-200 dark:text-blue-800`;
|
|
25
|
-
|
|
31
|
+
}
|
|
26
32
|
</script>
|
|
27
33
|
|
|
28
34
|
<span class={badgeClass}>{name}</span>
|
package/badges/Badge.svelte.d.ts
CHANGED
|
@@ -1,27 +1,19 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} BadgeProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} BadgeEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} BadgeSlots */
|
|
4
|
-
export default class Badge extends SvelteComponentTyped<{
|
|
5
|
-
textSize?: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
color?: string;
|
|
8
|
-
}, {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
}, {}> {
|
|
11
|
-
}
|
|
12
|
-
export type BadgeProps = typeof __propDef.props;
|
|
13
|
-
export type BadgeEvents = typeof __propDef.events;
|
|
14
|
-
export type BadgeSlots = typeof __propDef.slots;
|
|
15
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Colors, Textsize } from '../types';
|
|
16
3
|
declare const __propDef: {
|
|
17
4
|
props: {
|
|
18
|
-
textSize?:
|
|
5
|
+
textSize?: Textsize;
|
|
19
6
|
name?: string;
|
|
20
|
-
color?:
|
|
7
|
+
color?: Colors;
|
|
21
8
|
};
|
|
22
9
|
events: {
|
|
23
10
|
[evt: string]: CustomEvent<any>;
|
|
24
11
|
};
|
|
25
12
|
slots: {};
|
|
26
13
|
};
|
|
14
|
+
export declare type BadgeProps = typeof __propDef.props;
|
|
15
|
+
export declare type BadgeEvents = typeof __propDef.events;
|
|
16
|
+
export declare type BadgeSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Badge extends SvelteComponentTyped<BadgeProps, BadgeEvents, BadgeSlots> {
|
|
18
|
+
}
|
|
27
19
|
export {};
|
package/badges/BadgeIcon.svelte
CHANGED
|
@@ -1,31 +1,37 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
let badgeClass;
|
|
7
|
-
if (color === "blue") {
|
|
1
|
+
<script >export let textSize = 'text-xs';
|
|
2
|
+
export let name = 'Read more';
|
|
3
|
+
export let color = 'blue';
|
|
4
|
+
let badgeClass;
|
|
5
|
+
if (color === 'blue') {
|
|
8
6
|
badgeClass = `bg-blue-100 text-blue-800 ${textSize} font-medium inline-flex items-center px-2.5 py-0.5 rounded mr-2 dark:bg-blue-700 dark:text-blue-300`;
|
|
9
|
-
|
|
7
|
+
}
|
|
8
|
+
else if (color === 'gray') {
|
|
10
9
|
badgeClass = `bg-gray-100 text-gray-800 ${textSize} font-medium inline-flex items-center px-2.5 py-0.5 rounded mr-2 dark:bg-gray-700 dark:text-gray-300`;
|
|
11
|
-
|
|
10
|
+
}
|
|
11
|
+
else if (color === 'red') {
|
|
12
12
|
badgeClass = `bg-red-100 text-red-800 ${textSize} font-medium inline-flex items-center px-2.5 py-0.5 rounded mr-2 dark:bg-red-700 dark:text-red-300`;
|
|
13
|
-
|
|
13
|
+
}
|
|
14
|
+
else if (color === 'green') {
|
|
14
15
|
badgeClass = `bg-green-100 text-green-800 ${textSize} font-medium inline-flex items-center px-2.5 py-0.5 rounded mr-2 dark:bg-green-700 dark:text-green-300`;
|
|
15
|
-
|
|
16
|
+
}
|
|
17
|
+
else if (color === 'yellow') {
|
|
16
18
|
badgeClass = `bg-yellow-100 text-yellow-800 ${textSize} font-medium inline-flex items-center px-2.5 py-0.5 rounded mr-2 dark:bg-yellow-700 dark:text-yellow-300`;
|
|
17
|
-
|
|
19
|
+
}
|
|
20
|
+
else if (color === 'indigo') {
|
|
18
21
|
badgeClass = `bg-indigo-100 text-indigo-800 ${textSize} font-medium inline-flex items-center px-2.5 py-0.5 rounded mr-2 dark:bg-indigo-700 dark:text-indigo-300`;
|
|
19
|
-
|
|
22
|
+
}
|
|
23
|
+
else if (color === 'purple') {
|
|
20
24
|
badgeClass = `bg-purple-100 text-purple-800 ${textSize} font-medium inline-flex items-center px-2.5 py-0.5 rounded mr-2 dark:bg-purple-700 dark:text-purple-300`;
|
|
21
|
-
|
|
25
|
+
}
|
|
26
|
+
else if (color === 'pink') {
|
|
22
27
|
badgeClass = `bg-pink-100 text-pink-800 ${textSize} font-medium inline-flex items-center px-2.5 py-0.5 rounded mr-2 dark:bg-pink-700 dark:text-pink-300`;
|
|
23
|
-
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
24
30
|
badgeClass = `bg-blue-100 text-blue-800 ${textSize} font-medium inline-flex items-center px-2.5 py-0.5 rounded mr-2 dark:bg-blue-700 dark:text-blue-300`;
|
|
25
|
-
|
|
31
|
+
}
|
|
26
32
|
</script>
|
|
27
33
|
|
|
28
34
|
<span class={badgeClass}>
|
|
29
|
-
|
|
30
|
-
|
|
35
|
+
<slot />
|
|
36
|
+
{name}
|
|
31
37
|
</span>
|
|
@@ -1,25 +1,10 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} BadgeIconProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} BadgeIconEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} BadgeIconSlots */
|
|
4
|
-
export default class BadgeIcon extends SvelteComponentTyped<{
|
|
5
|
-
textSize?: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
color?: string;
|
|
8
|
-
}, {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
}, {
|
|
11
|
-
default: {};
|
|
12
|
-
}> {
|
|
13
|
-
}
|
|
14
|
-
export type BadgeIconProps = typeof __propDef.props;
|
|
15
|
-
export type BadgeIconEvents = typeof __propDef.events;
|
|
16
|
-
export type BadgeIconSlots = typeof __propDef.slots;
|
|
17
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Colors, Textsize } from '../types';
|
|
18
3
|
declare const __propDef: {
|
|
19
4
|
props: {
|
|
20
|
-
textSize?:
|
|
5
|
+
textSize?: Textsize;
|
|
21
6
|
name?: string;
|
|
22
|
-
color?:
|
|
7
|
+
color?: Colors;
|
|
23
8
|
};
|
|
24
9
|
events: {
|
|
25
10
|
[evt: string]: CustomEvent<any>;
|
|
@@ -28,4 +13,9 @@ declare const __propDef: {
|
|
|
28
13
|
default: {};
|
|
29
14
|
};
|
|
30
15
|
};
|
|
16
|
+
export declare type BadgeIconProps = typeof __propDef.props;
|
|
17
|
+
export declare type BadgeIconEvents = typeof __propDef.events;
|
|
18
|
+
export declare type BadgeIconSlots = typeof __propDef.slots;
|
|
19
|
+
export default class BadgeIcon extends SvelteComponentTyped<BadgeIconProps, BadgeIconEvents, BadgeIconSlots> {
|
|
20
|
+
}
|
|
31
21
|
export {};
|
package/badges/BadgeLink.svelte
CHANGED
|
@@ -1,29 +1,35 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
let badgeClass;
|
|
8
|
-
if (color === "blue") {
|
|
1
|
+
<script >export let textSize = 'text-xs';
|
|
2
|
+
export let name = 'Read more';
|
|
3
|
+
export let color = 'blue';
|
|
4
|
+
export let link = '/';
|
|
5
|
+
let badgeClass;
|
|
6
|
+
if (color === 'blue') {
|
|
9
7
|
badgeClass = `bg-blue-100 hover:bg-blue-200 text-blue-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-blue-200 dark:text-blue-800 dark:hover:bg-blue-300`;
|
|
10
|
-
|
|
8
|
+
}
|
|
9
|
+
else if (color === 'gray') {
|
|
11
10
|
badgeClass = `bg-gray-100 hover:bg-gray-200 text-gray-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-gray-200 dark:text-gray-800 dark:hover:bg-gray-300`;
|
|
12
|
-
|
|
11
|
+
}
|
|
12
|
+
else if (color === 'red') {
|
|
13
13
|
badgeClass = `bg-red-100 hover:bg-red-200 text-red-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-red-200 dark:text-red-800 dark:hover:bg-red-300`;
|
|
14
|
-
|
|
14
|
+
}
|
|
15
|
+
else if (color === 'green') {
|
|
15
16
|
badgeClass = `bg-green-100 hover:bg-green-200 text-green-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-green-200 dark:text-green-800 dark:hover:bg-green-300`;
|
|
16
|
-
|
|
17
|
+
}
|
|
18
|
+
else if (color === 'yellow') {
|
|
17
19
|
badgeClass = `bg-yellow-100 hover:bg-yellow-200 text-yellow-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-yellow-200 dark:text-yellow-800 dark:hover:bg-yellow-300`;
|
|
18
|
-
|
|
20
|
+
}
|
|
21
|
+
else if (color === 'indigo') {
|
|
19
22
|
badgeClass = `bg-indigo-100 hover:bg-indigo-200 text-indigo-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-indigo-200 dark:text-indigo-800 dark:hover:bg-indigo-300`;
|
|
20
|
-
|
|
23
|
+
}
|
|
24
|
+
else if (color === 'purple') {
|
|
21
25
|
badgeClass = `bg-purple-100 hover:bg-purple-200 text-purple-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-purple-200 dark:text-purple-800 dark:hover:bg-purple-300`;
|
|
22
|
-
|
|
26
|
+
}
|
|
27
|
+
else if (color === 'pink') {
|
|
23
28
|
badgeClass = `bg-pink-100 hover:bg-pink-200 text-pink-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-pink-200 dark:text-pink-800 dark:hover:bg-pink-300`;
|
|
24
|
-
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
25
31
|
badgeClass = `bg-blue-100 hover:bg-blue-200 text-blue-800 ${textSize} font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-blue-200 dark:text-blue-800 dark:hover:bg-blue-300`;
|
|
26
|
-
|
|
32
|
+
}
|
|
27
33
|
</script>
|
|
28
34
|
|
|
29
35
|
<a href={link} class={badgeClass}>{name}</a>
|
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} BadgeLinkProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} BadgeLinkEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} BadgeLinkSlots */
|
|
4
|
-
export default class BadgeLink extends SvelteComponentTyped<{
|
|
5
|
-
link?: string;
|
|
6
|
-
textSize?: string;
|
|
7
|
-
name?: string;
|
|
8
|
-
color?: string;
|
|
9
|
-
}, {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
}, {}> {
|
|
12
|
-
}
|
|
13
|
-
export type BadgeLinkProps = typeof __propDef.props;
|
|
14
|
-
export type BadgeLinkEvents = typeof __propDef.events;
|
|
15
|
-
export type BadgeLinkSlots = typeof __propDef.slots;
|
|
16
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Colors, Textsize } from '../types';
|
|
17
3
|
declare const __propDef: {
|
|
18
4
|
props: {
|
|
19
|
-
|
|
20
|
-
textSize?: string;
|
|
5
|
+
textSize?: Textsize;
|
|
21
6
|
name?: string;
|
|
22
|
-
color?:
|
|
7
|
+
color?: Colors;
|
|
8
|
+
link?: string;
|
|
23
9
|
};
|
|
24
10
|
events: {
|
|
25
11
|
[evt: string]: CustomEvent<any>;
|
|
26
12
|
};
|
|
27
13
|
slots: {};
|
|
28
14
|
};
|
|
15
|
+
export declare type BadgeLinkProps = typeof __propDef.props;
|
|
16
|
+
export declare type BadgeLinkEvents = typeof __propDef.events;
|
|
17
|
+
export declare type BadgeLinkSlots = typeof __propDef.slots;
|
|
18
|
+
export default class BadgeLink extends SvelteComponentTyped<BadgeLinkProps, BadgeLinkEvents, BadgeLinkSlots> {
|
|
19
|
+
}
|
|
29
20
|
export {};
|