flowbite-svelte 0.6.0
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 +33 -0
- package/accordions/AccordionDefault.svelte +26 -0
- package/accordions/AccordionDefault.svelte.d.ts +35 -0
- package/accordions/AccordionItem.svelte +44 -0
- package/accordions/AccordionItem.svelte.d.ts +29 -0
- package/alerts/Alert.svelte +111 -0
- package/alerts/Alert.svelte.d.ts +31 -0
- package/alerts/BorderAlert.svelte +118 -0
- package/alerts/BorderAlert.svelte.d.ts +31 -0
- package/alerts/InfoAlert.svelte +125 -0
- package/alerts/InfoAlert.svelte.d.ts +35 -0
- package/badges/Badge.svelte +28 -0
- package/badges/Badge.svelte.d.ts +27 -0
- package/badges/BadgeIcon.svelte +31 -0
- package/badges/BadgeIcon.svelte.d.ts +31 -0
- package/badges/BadgeLink.svelte +29 -0
- package/badges/BadgeLink.svelte.d.ts +29 -0
- package/buttongroups/ButtonGroup.svelte +68 -0
- package/buttongroups/ButtonGroup.svelte.d.ts +33 -0
- package/buttongroups/ButtonGroupOutline.svelte +70 -0
- package/buttongroups/ButtonGroupOutline.svelte.d.ts +33 -0
- package/buttons/Button.svelte +60 -0
- package/buttons/Button.svelte.d.ts +33 -0
- package/buttons/ColorShadowButton.svelte +35 -0
- package/buttons/ColorShadowButton.svelte.d.ts +31 -0
- package/buttons/GradientDuotoneButton.svelte +33 -0
- package/buttons/GradientDuotoneButton.svelte.d.ts +31 -0
- package/buttons/GradientMonochromeButton.svelte +35 -0
- package/buttons/GradientMonochromeButton.svelte.d.ts +31 -0
- package/buttons/GradientOutlineButton.svelte +52 -0
- package/buttons/GradientOutlineButton.svelte.d.ts +31 -0
- package/cards/Card.svelte +86 -0
- package/cards/Card.svelte.d.ts +39 -0
- package/cards/CtaCard.svelte +63 -0
- package/cards/CtaCard.svelte.d.ts +45 -0
- package/cards/EcommerceCard.svelte +98 -0
- package/cards/EcommerceCard.svelte.d.ts +41 -0
- package/cards/HorizontalCard.svelte +29 -0
- package/cards/HorizontalCard.svelte.d.ts +35 -0
- package/cards/InteractiveCard.svelte +127 -0
- package/cards/InteractiveCard.svelte.d.ts +63 -0
- package/cards/ListCard.svelte +82 -0
- package/cards/ListCard.svelte.d.ts +51 -0
- package/cards/SignInCard.svelte +125 -0
- package/cards/SignInCard.svelte.d.ts +45 -0
- package/darkmode/DarkMode.svelte +78 -0
- package/darkmode/DarkMode.svelte.d.ts +23 -0
- package/dropdowns/DropdownDefault.svelte +117 -0
- package/dropdowns/DropdownDefault.svelte.d.ts +51 -0
- package/footer/SimpleFooter.svelte +32 -0
- package/footer/SimpleFooter.svelte.d.ts +45 -0
- package/index.d.ts +39 -0
- package/index.js +116 -0
- package/list-group/List.svelte +79 -0
- package/list-group/List.svelte.d.ts +33 -0
- package/modals/ExtraLargeModal.svelte +236 -0
- package/modals/ExtraLargeModal.svelte.d.ts +45 -0
- package/modals/LargeModal.svelte +236 -0
- package/modals/LargeModal.svelte.d.ts +45 -0
- package/modals/MediumModal.svelte +242 -0
- package/modals/MediumModal.svelte.d.ts +45 -0
- package/modals/ModalButton.svelte +48 -0
- package/modals/ModalButton.svelte.d.ts +29 -0
- package/modals/SignInModal.svelte +174 -0
- package/modals/SignInModal.svelte.d.ts +37 -0
- package/modals/SmallModal.svelte +236 -0
- package/modals/SmallModal.svelte.d.ts +45 -0
- package/modals/modalStores.d.ts +1 -0
- package/modals/modalStores.js +3 -0
- package/navbar/DropdownNavbar.svelte +210 -0
- package/navbar/DropdownNavbar.svelte.d.ts +65 -0
- package/navbar/Navbar.svelte +96 -0
- package/navbar/Navbar.svelte.d.ts +39 -0
- package/package.json +92 -0
- package/tabs/DefaultTabs.svelte +43 -0
- package/tabs/DefaultTabs.svelte.d.ts +33 -0
- package/tabs/InteractiveTabs.svelte +68 -0
- package/tabs/InteractiveTabs.svelte.d.ts +47 -0
- package/tabs/PillTabs.svelte +38 -0
- package/tabs/PillTabs.svelte.d.ts +31 -0
|
@@ -0,0 +1,27 @@
|
|
|
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
|
+
import { SvelteComponentTyped } from "svelte";
|
|
16
|
+
declare const __propDef: {
|
|
17
|
+
props: {
|
|
18
|
+
textSize?: string;
|
|
19
|
+
name?: string;
|
|
20
|
+
color?: string;
|
|
21
|
+
};
|
|
22
|
+
events: {
|
|
23
|
+
[evt: string]: CustomEvent<any>;
|
|
24
|
+
};
|
|
25
|
+
slots: {};
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let textSize = "text-xs"; // text-sm
|
|
3
|
+
export let name = "Read more";
|
|
4
|
+
export let color = "blue";
|
|
5
|
+
|
|
6
|
+
let badgeClass;
|
|
7
|
+
if (color === "blue") {
|
|
8
|
+
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
|
+
} else if (color === "gray") {
|
|
10
|
+
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
|
+
} else if (color === "red") {
|
|
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
|
+
} else if (color === "green") {
|
|
14
|
+
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
|
+
} else if (color === "yellow") {
|
|
16
|
+
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
|
+
} else if (color === "indigo") {
|
|
18
|
+
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
|
+
} else if (color === "purple") {
|
|
20
|
+
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
|
+
} else if (color === "pink") {
|
|
22
|
+
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
|
+
} else {
|
|
24
|
+
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
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<span class={badgeClass}>
|
|
29
|
+
<slot />
|
|
30
|
+
{name}
|
|
31
|
+
</span>
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
import { SvelteComponentTyped } from "svelte";
|
|
18
|
+
declare const __propDef: {
|
|
19
|
+
props: {
|
|
20
|
+
textSize?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
color?: string;
|
|
23
|
+
};
|
|
24
|
+
events: {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
};
|
|
27
|
+
slots: {
|
|
28
|
+
default: {};
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let textSize = "text-xs"; // text-sm
|
|
3
|
+
export let name = "Read more";
|
|
4
|
+
export let color = "blue";
|
|
5
|
+
export let link = "/";
|
|
6
|
+
|
|
7
|
+
let badgeClass;
|
|
8
|
+
if (color === "blue") {
|
|
9
|
+
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
|
+
} else if (color === "gray") {
|
|
11
|
+
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
|
+
} else if (color === "red") {
|
|
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
|
+
} else if (color === "green") {
|
|
15
|
+
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
|
+
} else if (color === "yellow") {
|
|
17
|
+
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
|
+
} else if (color === "indigo") {
|
|
19
|
+
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
|
+
} else if (color === "purple") {
|
|
21
|
+
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
|
+
} else if (color === "pink") {
|
|
23
|
+
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
|
+
} else {
|
|
25
|
+
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
|
+
}
|
|
27
|
+
</script>
|
|
28
|
+
|
|
29
|
+
<a href={link} class={badgeClass}>{name}</a>
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
import { SvelteComponentTyped } from "svelte";
|
|
17
|
+
declare const __propDef: {
|
|
18
|
+
props: {
|
|
19
|
+
link?: string;
|
|
20
|
+
textSize?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
color?: string;
|
|
23
|
+
};
|
|
24
|
+
events: {
|
|
25
|
+
[evt: string]: CustomEvent<any>;
|
|
26
|
+
};
|
|
27
|
+
slots: {};
|
|
28
|
+
};
|
|
29
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let buttons = [
|
|
3
|
+
{
|
|
4
|
+
name: "Profile",
|
|
5
|
+
link: "/",
|
|
6
|
+
rel: "",
|
|
7
|
+
icon: "",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: "Settings",
|
|
11
|
+
link: "/",
|
|
12
|
+
rel: "",
|
|
13
|
+
icon: "",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "Messages",
|
|
17
|
+
link: "/",
|
|
18
|
+
rel: "",
|
|
19
|
+
icon: "",
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
let btnLength = buttons.length;
|
|
23
|
+
let classFirst =
|
|
24
|
+
"inline-flex relative items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white rounded-l-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-blue-500 dark:focus:text-white";
|
|
25
|
+
let classMiddle =
|
|
26
|
+
"inline-flex relative items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white border-t border-b border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-blue-500 dark:focus:text-white";
|
|
27
|
+
let classLast =
|
|
28
|
+
"inline-flex relative items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white rounded-r-md border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-2 focus:ring-blue-700 focus:text-blue-700 dark:bg-gray-700 dark:border-gray-600 dark:text-white dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-blue-500 dark:focus:text-white";
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<div class="inline-flex rounded-md shadow-sm" role="group">
|
|
32
|
+
{#each buttons as { name, icon, link, rel }, i}
|
|
33
|
+
{#if i === 0}
|
|
34
|
+
<button type="button" class={classFirst}>
|
|
35
|
+
{#if icon}
|
|
36
|
+
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
37
|
+
{/if}
|
|
38
|
+
{#if link}
|
|
39
|
+
<a href={link} {rel}>{name}</a>
|
|
40
|
+
{:else}
|
|
41
|
+
{name}
|
|
42
|
+
{/if}
|
|
43
|
+
</button>
|
|
44
|
+
{:else if i === btnLength - 1}
|
|
45
|
+
<button type="button" class={classLast}>
|
|
46
|
+
{#if icon}
|
|
47
|
+
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
48
|
+
{/if}
|
|
49
|
+
{#if link}
|
|
50
|
+
<a href={link} {rel}>{name}</a>
|
|
51
|
+
{:else}
|
|
52
|
+
{name}
|
|
53
|
+
{/if}
|
|
54
|
+
</button>
|
|
55
|
+
{:else}
|
|
56
|
+
<button type="button" class={classMiddle}>
|
|
57
|
+
{#if icon}
|
|
58
|
+
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
59
|
+
{/if}
|
|
60
|
+
{#if link}
|
|
61
|
+
<a href={link} {rel}>{name}</a>
|
|
62
|
+
{:else}
|
|
63
|
+
{name}
|
|
64
|
+
{/if}
|
|
65
|
+
</button>
|
|
66
|
+
{/if}
|
|
67
|
+
{/each}
|
|
68
|
+
</div>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} ButtonGroupProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} ButtonGroupEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} ButtonGroupSlots */
|
|
4
|
+
export default class ButtonGroup extends SvelteComponentTyped<{
|
|
5
|
+
buttons?: {
|
|
6
|
+
name: string;
|
|
7
|
+
link: string;
|
|
8
|
+
rel: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
}[];
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}> {
|
|
14
|
+
}
|
|
15
|
+
export type ButtonGroupProps = typeof __propDef.props;
|
|
16
|
+
export type ButtonGroupEvents = typeof __propDef.events;
|
|
17
|
+
export type ButtonGroupSlots = typeof __propDef.slots;
|
|
18
|
+
import { SvelteComponentTyped } from "svelte";
|
|
19
|
+
declare const __propDef: {
|
|
20
|
+
props: {
|
|
21
|
+
buttons?: {
|
|
22
|
+
name: string;
|
|
23
|
+
link: string;
|
|
24
|
+
rel: string;
|
|
25
|
+
icon: string;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
events: {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
};
|
|
31
|
+
slots: {};
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let buttons = [
|
|
3
|
+
{
|
|
4
|
+
name: "Profile",
|
|
5
|
+
link: "/",
|
|
6
|
+
rel: "",
|
|
7
|
+
icon: "",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
name: "Settings",
|
|
11
|
+
link: "/",
|
|
12
|
+
rel: "",
|
|
13
|
+
icon: "",
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: "Messages",
|
|
17
|
+
link: "/",
|
|
18
|
+
rel: "",
|
|
19
|
+
icon: "",
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
let btnLength = buttons.length;
|
|
24
|
+
|
|
25
|
+
let classFirst =
|
|
26
|
+
"inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-transparent rounded-l-lg border border-gray-900 hover:bg-gray-900 hover:text-white focus:z-10 focus:ring-2 focus:ring-gray-500 focus:bg-gray-900 focus:text-white dark:border-white dark:text-white dark:hover:text-white dark:hover:bg-gray-700 dark:focus:bg-gray-700";
|
|
27
|
+
let classMiddle =
|
|
28
|
+
"inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-transparent border-t border-b border-gray-900 hover:bg-gray-900 hover:text-white focus:z-10 focus:ring-2 focus:ring-gray-500 focus:bg-gray-900 focus:text-white dark:border-white dark:text-white dark:hover:text-white dark:hover:bg-gray-700 dark:focus:bg-gray-700";
|
|
29
|
+
let classLast =
|
|
30
|
+
"inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-transparent rounded-r-md border border-gray-900 hover:bg-gray-900 hover:text-white focus:z-10 focus:ring-2 focus:ring-gray-500 focus:bg-gray-900 focus:text-white dark:border-white dark:text-white dark:hover:text-white dark:hover:bg-gray-700 dark:focus:bg-gray-700";
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<div class="inline-flex rounded-md shadow-sm">
|
|
34
|
+
{#each buttons as { link, name, rel, icon }, i}
|
|
35
|
+
{#if i === 0}
|
|
36
|
+
<button type="button" class={classFirst}>
|
|
37
|
+
{#if icon}
|
|
38
|
+
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
39
|
+
{/if}
|
|
40
|
+
{#if link}
|
|
41
|
+
<a href={link} {rel}>{name}</a>
|
|
42
|
+
{:else}
|
|
43
|
+
{name}
|
|
44
|
+
{/if}
|
|
45
|
+
</button>
|
|
46
|
+
{:else if i === btnLength - 1}
|
|
47
|
+
<button type="button" class={classLast}>
|
|
48
|
+
{#if icon}
|
|
49
|
+
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
50
|
+
{/if}
|
|
51
|
+
{#if link}
|
|
52
|
+
<a href={link} {rel}>{name}</a>
|
|
53
|
+
{:else}
|
|
54
|
+
{name}
|
|
55
|
+
{/if}
|
|
56
|
+
</button>
|
|
57
|
+
{:else}
|
|
58
|
+
<button type="button" class={classMiddle}>
|
|
59
|
+
{#if icon}
|
|
60
|
+
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
61
|
+
{/if}
|
|
62
|
+
{#if link}
|
|
63
|
+
<a href={link} {rel}>{name}</a>
|
|
64
|
+
{:else}
|
|
65
|
+
{name}
|
|
66
|
+
{/if}
|
|
67
|
+
</button>
|
|
68
|
+
{/if}
|
|
69
|
+
{/each}
|
|
70
|
+
</div>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} ButtonGroupOutlineProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} ButtonGroupOutlineEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} ButtonGroupOutlineSlots */
|
|
4
|
+
export default class ButtonGroupOutline extends SvelteComponentTyped<{
|
|
5
|
+
buttons?: {
|
|
6
|
+
name: string;
|
|
7
|
+
link: string;
|
|
8
|
+
rel: string;
|
|
9
|
+
icon: string;
|
|
10
|
+
}[];
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}> {
|
|
14
|
+
}
|
|
15
|
+
export type ButtonGroupOutlineProps = typeof __propDef.props;
|
|
16
|
+
export type ButtonGroupOutlineEvents = typeof __propDef.events;
|
|
17
|
+
export type ButtonGroupOutlineSlots = typeof __propDef.slots;
|
|
18
|
+
import { SvelteComponentTyped } from "svelte";
|
|
19
|
+
declare const __propDef: {
|
|
20
|
+
props: {
|
|
21
|
+
buttons?: {
|
|
22
|
+
name: string;
|
|
23
|
+
link: string;
|
|
24
|
+
rel: string;
|
|
25
|
+
icon: string;
|
|
26
|
+
}[];
|
|
27
|
+
};
|
|
28
|
+
events: {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
};
|
|
31
|
+
slots: {};
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
const handleClick = () => {
|
|
6
|
+
dispatch("handleClick");
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export let rounded = false;
|
|
10
|
+
export let textSize = "text-sm";
|
|
11
|
+
export let name = "Read more";
|
|
12
|
+
export let type = "blue";
|
|
13
|
+
|
|
14
|
+
let paddings;
|
|
15
|
+
if (textSize === "text-xs") {
|
|
16
|
+
paddings = "py-2 px-3";
|
|
17
|
+
} else if (textSize === "text-sm") {
|
|
18
|
+
paddings = "py-2.5 px-5";
|
|
19
|
+
} else if (textSize === "text-base") {
|
|
20
|
+
paddings = "py-3 px-6";
|
|
21
|
+
} else {
|
|
22
|
+
paddings = "py-2.5 px-5";
|
|
23
|
+
}
|
|
24
|
+
let buttonClass;
|
|
25
|
+
let round = rounded ? "rounded-full" : "rounded-lg";
|
|
26
|
+
|
|
27
|
+
if (type === "blue") {
|
|
28
|
+
buttonClass = `text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800`;
|
|
29
|
+
} else if (type === "blue-outline") {
|
|
30
|
+
buttonClass = `text-blue-700 hover:text-white border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-blue-500 dark:text-blue-500 dark:hover:text-white dark:hover:bg-blue-600 dark:focus:ring-blue-800`;
|
|
31
|
+
} else if (type === "dark") {
|
|
32
|
+
buttonClass =
|
|
33
|
+
buttonClass = `text-white bg-gray-800 hover:bg-gray-900 focus:ring-4 focus:ring-gray-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-800 dark:border-gray-700`;
|
|
34
|
+
} else if (type === "dark-outline") {
|
|
35
|
+
buttonClass = `text-gray-900 hover:text-white border border-gray-800 hover:bg-gray-900 focus:ring-4 focus:ring-gray-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-gray-600 dark:text-gray-400 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-800`;
|
|
36
|
+
} else if (type === "light") {
|
|
37
|
+
buttonClass = `text-gray-900 bg-white border border-gray-300 hover:bg-gray-100 focus:ring-4 focus:ring-blue-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:bg-gray-600 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-700 dark:focus:ring-gray-800`;
|
|
38
|
+
} else if (type === "green") {
|
|
39
|
+
buttonClass = `text-white bg-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800`;
|
|
40
|
+
} else if (type === "green-outline") {
|
|
41
|
+
buttonClass = `text-green-700 hover:text-white border border-green-700 hover:bg-green-800 focus:ring-4 focus:ring-green-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-green-500 dark:text-green-500 dark:hover:text-white dark:hover:bg-green-600 dark:focus:ring-green-800`;
|
|
42
|
+
} else if (type === "red") {
|
|
43
|
+
buttonClass = `text-white bg-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-900`;
|
|
44
|
+
} else if (type === "red-outline") {
|
|
45
|
+
buttonClass = `text-red-700 hover:text-white border border-red-700 hover:bg-red-800 focus:ring-4 focus:ring-red-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-red-500 dark:text-red-500 dark:hover:text-white dark:hover:bg-red-600 dark:focus:ring-red-900`;
|
|
46
|
+
} else if (type === "yellow") {
|
|
47
|
+
buttonClass = `text-white bg-yellow-400 hover:bg-yellow-500 focus:ring-4 focus:ring-yellow-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:focus:ring-yellow-900`;
|
|
48
|
+
} else if (type === "yellow-outline") {
|
|
49
|
+
buttonClass = `text-yellow-400 hover:text-white border border-yellow-400 hover:bg-yellow-500 focus:ring-4 focus:ring-yellow-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-yellow-300 dark:text-yellow-300 dark:hover:text-white dark:hover:bg-yellow-400 dark:focus:ring-yellow-900`;
|
|
50
|
+
} else if (type === "purple") {
|
|
51
|
+
buttonClass = `text-white bg-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium ${round} ${textSize} ${paddings} text-center mb-2 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-900`;
|
|
52
|
+
} else if (type === "purple-outline") {
|
|
53
|
+
buttonClass = `text-purple-700 hover:text-white border border-purple-700 hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 font-medium rounded-lg ${textSize} ${paddings} text-center mr-2 mb-2 dark:border-purple-400 dark:text-purple-400 dark:hover:text-white dark:hover:bg-purple-500 dark:focus:ring-purple-900`;
|
|
54
|
+
} else {
|
|
55
|
+
// blue
|
|
56
|
+
buttonClass = `text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium ${round} ${textSize} ${paddings} text-center mr-2 mb-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800`;
|
|
57
|
+
}
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<button type="button" class={buttonClass} on:click={handleClick}>{name}</button>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} ButtonProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} ButtonEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} ButtonSlots */
|
|
4
|
+
export default class Button extends SvelteComponentTyped<{
|
|
5
|
+
rounded?: boolean;
|
|
6
|
+
textSize?: string;
|
|
7
|
+
name?: string;
|
|
8
|
+
type?: string;
|
|
9
|
+
}, {
|
|
10
|
+
handleClick: CustomEvent<any>;
|
|
11
|
+
} & {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {}> {
|
|
14
|
+
}
|
|
15
|
+
export type ButtonProps = typeof __propDef.props;
|
|
16
|
+
export type ButtonEvents = typeof __propDef.events;
|
|
17
|
+
export type ButtonSlots = typeof __propDef.slots;
|
|
18
|
+
import { SvelteComponentTyped } from "svelte";
|
|
19
|
+
declare const __propDef: {
|
|
20
|
+
props: {
|
|
21
|
+
rounded?: boolean;
|
|
22
|
+
textSize?: string;
|
|
23
|
+
name?: string;
|
|
24
|
+
type?: string;
|
|
25
|
+
};
|
|
26
|
+
events: {
|
|
27
|
+
handleClick: CustomEvent<any>;
|
|
28
|
+
} & {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
};
|
|
31
|
+
slots: {};
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
const handleClick = () => {
|
|
6
|
+
dispatch("handleClick");
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export let textSize = "text-sm";
|
|
10
|
+
export let color = "blue";
|
|
11
|
+
export let name = "Read more";
|
|
12
|
+
let btnClass;
|
|
13
|
+
|
|
14
|
+
if (color === "blue") {
|
|
15
|
+
btnClass = `text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800 shadow-lg shadow-blue-500/50 dark:shadow-lg dark:shadow-blue-800/80 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
16
|
+
} else if (color === "green") {
|
|
17
|
+
btnClass = `text-white bg-gradient-to-r from-green-400 via-green-500 to-green-600 hover:bg-gradient-to-br focus:ring-4 focus:ring-green-300 dark:focus:ring-green-800 shadow-lg shadow-green-500/50 dark:shadow-lg dark:shadow-green-800/80 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
18
|
+
} else if (color === "cyan") {
|
|
19
|
+
btnClass = `text-white bg-gradient-to-r from-cyan-400 via-cyan-500 to-cyan-600 hover:bg-gradient-to-br focus:ring-4 focus:ring-cyan-300 dark:focus:ring-cyan-800 shadow-lg shadow-cyan-500/50 dark:shadow-lg dark:shadow-cyan-800/80 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
20
|
+
} else if (color === "teal") {
|
|
21
|
+
btnClass = `text-white bg-gradient-to-r from-teal-400 via-teal-500 to-teal-600 hover:bg-gradient-to-br focus:ring-4 focus:ring-teal-300 dark:focus:ring-teal-800 shadow-lg shadow-teal-500/50 dark:shadow-lg dark:shadow-teal-800/80 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
22
|
+
} else if (color === "lime") {
|
|
23
|
+
btnClass = `text-gray-900 bg-gradient-to-r from-lime-200 via-lime-400 to-lime-500 hover:bg-gradient-to-br focus:ring-4 focus:ring-lime-300 dark:focus:ring-lime-800 shadow-lg shadow-lime-500/50 dark:shadow-lg dark:shadow-lime-800/80 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
24
|
+
} else if (color === "red") {
|
|
25
|
+
btnClass = `text-white bg-gradient-to-r from-red-400 via-red-500 to-red-600 hover:bg-gradient-to-br focus:ring-4 focus:ring-red-300 dark:focus:ring-red-800 shadow-lg shadow-red-500/50 dark:shadow-lg dark:shadow-red-800/80 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
26
|
+
} else if (color === "pink") {
|
|
27
|
+
btnClass = `text-white bg-gradient-to-r from-pink-400 via-pink-500 to-pink-600 hover:bg-gradient-to-br focus:ring-4 focus:ring-pink-300 dark:focus:ring-pink-800 shadow-lg shadow-pink-500/50 dark:shadow-lg dark:shadow-pink-800/80 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
28
|
+
} else if (color === "purple") {
|
|
29
|
+
btnClass = `text-white bg-gradient-to-r from-purple-500 via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:ring-4 focus:ring-purple-300 dark:focus:ring-purple-800 shadow-lg shadow-purple-500/50 dark:shadow-lg dark:shadow-purple-800/80 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
30
|
+
} else {
|
|
31
|
+
btnClass = `text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800 shadow-lg shadow-blue-500/50 dark:shadow-lg dark:shadow-blue-800/80 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<button type="button" class={btnClass} on:click={handleClick}>{name}</button>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} ColorShadowButtonProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} ColorShadowButtonEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} ColorShadowButtonSlots */
|
|
4
|
+
export default class ColorShadowButton extends SvelteComponentTyped<{
|
|
5
|
+
textSize?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
}, {
|
|
9
|
+
handleClick: CustomEvent<any>;
|
|
10
|
+
} & {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
}, {}> {
|
|
13
|
+
}
|
|
14
|
+
export type ColorShadowButtonProps = typeof __propDef.props;
|
|
15
|
+
export type ColorShadowButtonEvents = typeof __propDef.events;
|
|
16
|
+
export type ColorShadowButtonSlots = typeof __propDef.slots;
|
|
17
|
+
import { SvelteComponentTyped } from "svelte";
|
|
18
|
+
declare const __propDef: {
|
|
19
|
+
props: {
|
|
20
|
+
textSize?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
color?: string;
|
|
23
|
+
};
|
|
24
|
+
events: {
|
|
25
|
+
handleClick: CustomEvent<any>;
|
|
26
|
+
} & {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
};
|
|
29
|
+
slots: {};
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
const handleClick = () => {
|
|
6
|
+
dispatch("handleClick");
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export let textSize = "text-sm";
|
|
10
|
+
export let color = "purple2blue";
|
|
11
|
+
export let name = "Read more";
|
|
12
|
+
let btnClass;
|
|
13
|
+
|
|
14
|
+
if (color === "purple2blue") {
|
|
15
|
+
btnClass = `text-white bg-gradient-to-br from-purple-600 to-blue-500 hover:bg-gradient-to-bl focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
16
|
+
} else if (color === "cyan2blue") {
|
|
17
|
+
btnClass = `text-white bg-gradient-to-r from-cyan-500 to-blue-500 hover:bg-gradient-to-bl focus:ring-4 focus:ring-cyan-300 dark:focus:ring-cyan-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
18
|
+
} else if (color === "green2blue") {
|
|
19
|
+
btnClass = `text-white bg-gradient-to-br from-green-400 to-blue-600 hover:bg-gradient-to-bl focus:ring-4 focus:ring-green-200 dark:focus:ring-green-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
20
|
+
} else if (color === "purple2pink") {
|
|
21
|
+
btnClass = `text-white bg-gradient-to-r from-purple-500 to-pink-500 hover:bg-gradient-to-l focus:ring-4 focus:ring-purple-200 dark:focus:ring-purple-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
22
|
+
} else if (color === "pink2orange") {
|
|
23
|
+
btnClass = `text-white bg-gradient-to-br from-pink-500 to-orange-400 hover:bg-gradient-to-bl focus:ring-4 focus:ring-pink-200 dark:focus:ring-pink-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
24
|
+
} else if (color === "teal2lime") {
|
|
25
|
+
btnClass = `text-gray-900 bg-gradient-to-r from-teal-200 to-lime-200 hover:bg-gradient-to-l hover:from-teal-200 hover:to-lime-200 focus:ring-4 focus:ring-lime-200 dark:focus:ring-teal-700 font-medium rounded-lg text-sm px-5 py-2.5 text-center mr-2 mb-2`;
|
|
26
|
+
} else if (color === "red2yellow") {
|
|
27
|
+
btnClass = `text-gray-900 bg-gradient-to-r from-red-200 via-red-300 to-yellow-200 hover:bg-gradient-to-bl focus:ring-4 focus:ring-red-100 dark:focus:ring-red-400 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
28
|
+
} else {
|
|
29
|
+
btnClass = `text-white bg-gradient-to-br from-purple-600 to-blue-500 hover:bg-gradient-to-bl focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
30
|
+
}
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<button type="button" class={btnClass} on:click={handleClick}>{name}</button>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} GradientDuotoneButtonProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} GradientDuotoneButtonEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} GradientDuotoneButtonSlots */
|
|
4
|
+
export default class GradientDuotoneButton extends SvelteComponentTyped<{
|
|
5
|
+
textSize?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
}, {
|
|
9
|
+
handleClick: CustomEvent<any>;
|
|
10
|
+
} & {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
}, {}> {
|
|
13
|
+
}
|
|
14
|
+
export type GradientDuotoneButtonProps = typeof __propDef.props;
|
|
15
|
+
export type GradientDuotoneButtonEvents = typeof __propDef.events;
|
|
16
|
+
export type GradientDuotoneButtonSlots = typeof __propDef.slots;
|
|
17
|
+
import { SvelteComponentTyped } from "svelte";
|
|
18
|
+
declare const __propDef: {
|
|
19
|
+
props: {
|
|
20
|
+
textSize?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
color?: string;
|
|
23
|
+
};
|
|
24
|
+
events: {
|
|
25
|
+
handleClick: CustomEvent<any>;
|
|
26
|
+
} & {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
};
|
|
29
|
+
slots: {};
|
|
30
|
+
};
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { createEventDispatcher } from "svelte";
|
|
3
|
+
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
const handleClick = () => {
|
|
6
|
+
dispatch("handleClick");
|
|
7
|
+
};
|
|
8
|
+
|
|
9
|
+
export let textSize = "text-sm";
|
|
10
|
+
export let color = "blue";
|
|
11
|
+
export let name = "Read more";
|
|
12
|
+
let btnClass;
|
|
13
|
+
|
|
14
|
+
if (color === "blue") {
|
|
15
|
+
btnClass = `text-white bg-gradient-to-r from-blue-500 via-blue-600 to-blue-700 hover:bg-gradient-to-br focus:ring-4 focus:ring-blue-300 dark:focus:ring-blue-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
16
|
+
} else if (color === "green") {
|
|
17
|
+
btnClass = `text-white bg-gradient-to-r from-green-400 via-green-500 to-green-600 hover:bg-gradient-to-br focus:ring-4 focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
18
|
+
} else if (color === "cyan") {
|
|
19
|
+
btnClass = `text-white bg-gradient-to-r from-cyan-400 via-cyan-500 to-cyan-600 hover:bg-gradient-to-br focus:ring-4 focus:ring-cyan-300 dark:focus:ring-cyan-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
20
|
+
} else if (color === "teal") {
|
|
21
|
+
btnClass = `text-white bg-gradient-to-r from-teal-400 via-teal-500 to-teal-600 hover:bg-gradient-to-br focus:ring-4 focus:ring-teal-300 dark:focus:ring-teal-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
22
|
+
} else if (color === "lime") {
|
|
23
|
+
btnClass = `text-gray-900 bg-gradient-to-r from-lime-200 via-lime-400 to-lime-500 hover:bg-gradient-to-br focus:ring-4 focus:ring-lime-300 dark:focus:ring-lime-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
24
|
+
} else if (color === "red") {
|
|
25
|
+
btnClass = `text-white bg-gradient-to-r from-red-400 via-red-500 to-red-600 hover:bg-gradient-to-br focus:ring-4 focus:ring-red-300 dark:focus:ring-red-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
26
|
+
} else if (color === "pink") {
|
|
27
|
+
btnClass = `text-white bg-gradient-to-r from-pink-400 via-pink-500 to-pink-600 hover:bg-gradient-to-br focus:ring-4 focus:ring-pink-300 dark:focus:ring-pink-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
28
|
+
} else if (color === "purple") {
|
|
29
|
+
btnClass = `text-white bg-gradient-to-r from-purple-500 via-purple-600 to-purple-700 hover:bg-gradient-to-br focus:ring-4 focus:ring-purple-300 dark:focus:ring-purple-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
30
|
+
} else {
|
|
31
|
+
btnClass = `text-white bg-gradient-to-r from-green-400 via-green-500 to-green-600 hover:bg-gradient-to-br focus:ring-4 focus:ring-green-300 dark:focus:ring-green-800 font-medium rounded-lg ${textSize} px-5 py-2.5 text-center mr-2 mb-2`;
|
|
32
|
+
}
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<button type="button" class={btnClass} on:click={handleClick}>{name}</button>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} GradientMonochromeButtonProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} GradientMonochromeButtonEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} GradientMonochromeButtonSlots */
|
|
4
|
+
export default class GradientMonochromeButton extends SvelteComponentTyped<{
|
|
5
|
+
textSize?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
color?: string;
|
|
8
|
+
}, {
|
|
9
|
+
handleClick: CustomEvent<any>;
|
|
10
|
+
} & {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
}, {}> {
|
|
13
|
+
}
|
|
14
|
+
export type GradientMonochromeButtonProps = typeof __propDef.props;
|
|
15
|
+
export type GradientMonochromeButtonEvents = typeof __propDef.events;
|
|
16
|
+
export type GradientMonochromeButtonSlots = typeof __propDef.slots;
|
|
17
|
+
import { SvelteComponentTyped } from "svelte";
|
|
18
|
+
declare const __propDef: {
|
|
19
|
+
props: {
|
|
20
|
+
textSize?: string;
|
|
21
|
+
name?: string;
|
|
22
|
+
color?: string;
|
|
23
|
+
};
|
|
24
|
+
events: {
|
|
25
|
+
handleClick: CustomEvent<any>;
|
|
26
|
+
} & {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
};
|
|
29
|
+
slots: {};
|
|
30
|
+
};
|
|
31
|
+
export {};
|