flowbite-svelte 0.9.0 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/accordions/AccordionDefault.svelte +20 -21
- package/accordions/AccordionDefault.svelte.d.ts +6 -19
- package/accordions/AccordionItem.svelte +31 -34
- package/accordions/AccordionItem.svelte.d.ts +6 -16
- package/alerts/Alert.svelte +1 -2
- package/alerts/Alert.svelte.d.ts +2 -1
- package/alerts/BorderAlert.svelte +1 -2
- package/alerts/BorderAlert.svelte.d.ts +2 -1
- package/alerts/InfoAlert.svelte +1 -2
- package/alerts/InfoAlert.svelte.d.ts +2 -1
- 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 +41 -64
- package/buttongroups/ButtonGroup.svelte.d.ts +7 -23
- package/buttongroups/ButtonGroupOutline.svelte +41 -66
- package/buttongroups/ButtonGroupOutline.svelte.d.ts +7 -23
- package/buttons/Button.svelte +48 -35
- package/buttons/Button.svelte.d.ts +9 -20
- 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 +48 -58
- package/cards/CtaCard.svelte.d.ts +8 -32
- package/cards/EcommerceCard.svelte +77 -77
- package/cards/EcommerceCard.svelte.d.ts +10 -28
- package/cards/HorizontalCard.svelte +21 -24
- package/cards/HorizontalCard.svelte.d.ts +9 -22
- package/cards/InteractiveCard.svelte +96 -110
- package/cards/InteractiveCard.svelte.d.ts +10 -50
- package/darkmode/DarkMode.svelte +60 -69
- package/darkmode/DarkMode.svelte.d.ts +5 -12
- package/dropdowns/DropdownDefault.svelte.d.ts +4 -4
- package/footer/LogoFooter.svelte +32 -48
- package/footer/LogoFooter.svelte.d.ts +11 -46
- package/footer/SimpleFooter.svelte +20 -33
- package/footer/SimpleFooter.svelte.d.ts +8 -36
- package/footer/SitemapFooter.svelte +43 -112
- package/footer/SitemapFooter.svelte.d.ts +13 -59
- package/footer/SocialMediaFooter.svelte.d.ts +14 -14
- 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 +117 -202
- package/navbar/DropdownNavbar.svelte.d.ts +8 -52
- package/navbar/Navbar.svelte +68 -99
- package/navbar/Navbar.svelte.d.ts +8 -26
- package/package.json +9 -2
- package/spinners/Spinner.svelte +63 -57
- package/spinners/Spinner.svelte.d.ts +8 -17
- package/spinners/SpinnerButton.svelte +31 -31
- package/spinners/SpinnerButton.svelte.d.ts +6 -15
- package/tabs/DefaultTabs.svelte +13 -39
- package/tabs/DefaultTabs.svelte.d.ts +7 -23
- package/tabs/InteractiveTabs.svelte +33 -63
- package/tabs/InteractiveTabs.svelte.d.ts +7 -35
- package/tabs/PillTabs.svelte +12 -34
- package/tabs/PillTabs.svelte.d.ts +7 -21
- package/tooltips/LightTooltip.svelte +112 -114
- package/tooltips/LightTooltip.svelte.d.ts +6 -21
- package/tooltips/Tooltip.svelte +113 -114
- package/tooltips/Tooltip.svelte.d.ts +6 -21
- package/types.d.ts +66 -0
- package/types.js +1 -0
|
@@ -1,26 +1,25 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const unsubscribe = store.subscribe((s) => {
|
|
1
|
+
<script >import { onDestroy } from 'svelte';
|
|
2
|
+
import { setContext } from 'svelte';
|
|
3
|
+
import { createEventDispatcher } from 'svelte';
|
|
4
|
+
import { writable } from 'svelte/store';
|
|
5
|
+
export let duration = 0.2;
|
|
6
|
+
export let easing = 'ease';
|
|
7
|
+
export let id = undefined;
|
|
8
|
+
const dispatch = createEventDispatcher();
|
|
9
|
+
// create a store for the children to access
|
|
10
|
+
const store = writable({ id, duration, easing });
|
|
11
|
+
// when the store changes, update the id prop
|
|
12
|
+
const unsubscribe = store.subscribe((s) => {
|
|
14
13
|
id = s.id;
|
|
15
|
-
dispatch(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
dispatch('change', { id });
|
|
15
|
+
});
|
|
16
|
+
// when the id prop changes, update the store
|
|
17
|
+
$: store.update((s) => Object.assign(s, { id }));
|
|
18
|
+
// make the store available to children
|
|
19
|
+
setContext('svelte-collapsible-accordion', store);
|
|
20
|
+
onDestroy(unsubscribe);
|
|
22
21
|
</script>
|
|
23
22
|
|
|
24
23
|
<div>
|
|
25
|
-
|
|
24
|
+
<slot />
|
|
26
25
|
</div>
|
|
@@ -1,27 +1,9 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} AccordionDefaultProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} AccordionDefaultEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} AccordionDefaultSlots */
|
|
4
|
-
export default class AccordionDefault extends SvelteComponentTyped<{
|
|
5
|
-
id?: any;
|
|
6
|
-
duration?: number;
|
|
7
|
-
easing?: string;
|
|
8
|
-
}, {
|
|
9
|
-
change: CustomEvent<any>;
|
|
10
|
-
} & {
|
|
11
|
-
[evt: string]: CustomEvent<any>;
|
|
12
|
-
}, {
|
|
13
|
-
default: {};
|
|
14
|
-
}> {
|
|
15
|
-
}
|
|
16
|
-
export type AccordionDefaultProps = typeof __propDef.props;
|
|
17
|
-
export type AccordionDefaultEvents = typeof __propDef.events;
|
|
18
|
-
export type AccordionDefaultSlots = typeof __propDef.slots;
|
|
19
1
|
import { SvelteComponentTyped } from "svelte";
|
|
20
2
|
declare const __propDef: {
|
|
21
3
|
props: {
|
|
22
|
-
id?: any;
|
|
23
4
|
duration?: number;
|
|
24
5
|
easing?: string;
|
|
6
|
+
id?: number;
|
|
25
7
|
};
|
|
26
8
|
events: {
|
|
27
9
|
change: CustomEvent<any>;
|
|
@@ -32,4 +14,9 @@ declare const __propDef: {
|
|
|
32
14
|
default: {};
|
|
33
15
|
};
|
|
34
16
|
};
|
|
17
|
+
export declare type AccordionDefaultProps = typeof __propDef.props;
|
|
18
|
+
export declare type AccordionDefaultEvents = typeof __propDef.events;
|
|
19
|
+
export declare type AccordionDefaultSlots = typeof __propDef.slots;
|
|
20
|
+
export default class AccordionDefault extends SvelteComponentTyped<AccordionDefaultProps, AccordionDefaultEvents, AccordionDefaultSlots> {
|
|
21
|
+
}
|
|
35
22
|
export {};
|
|
@@ -1,44 +1,41 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
} from "@codewithshin/svelte-heroicons";
|
|
8
|
-
export let id;
|
|
9
|
-
const store = getContext("svelte-collapsible-accordion");
|
|
10
|
-
$: params = {
|
|
1
|
+
<script >import { getContext } from 'svelte';
|
|
2
|
+
import collapse from 'svelte-collapse';
|
|
3
|
+
import { ChevronDownIconSolid, ChevronUpIconSolid } from '@codewithshin/svelte-heroicons';
|
|
4
|
+
export let id;
|
|
5
|
+
const store = getContext('svelte-collapsible-accordion');
|
|
6
|
+
$: params = {
|
|
11
7
|
open: $store.id === id,
|
|
12
8
|
duration: $store.duration,
|
|
13
|
-
easing: $store.easing
|
|
14
|
-
|
|
15
|
-
|
|
9
|
+
easing: $store.easing
|
|
10
|
+
};
|
|
11
|
+
const handleToggle = () => {
|
|
16
12
|
if (params.open) {
|
|
17
|
-
|
|
18
|
-
} else {
|
|
19
|
-
store.update((s) => Object.assign(s, { id }));
|
|
13
|
+
store.update((s) => Object.assign(s, { id: null }));
|
|
20
14
|
}
|
|
21
|
-
|
|
15
|
+
else {
|
|
16
|
+
store.update((s) => Object.assign(s, { id }));
|
|
17
|
+
}
|
|
18
|
+
};
|
|
22
19
|
</script>
|
|
23
20
|
|
|
24
21
|
<h2 aria-expanded={params.open}>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
22
|
+
<button
|
|
23
|
+
on:click={handleToggle}
|
|
24
|
+
type="button"
|
|
25
|
+
class:rounded-t-xl={id === '1'}
|
|
26
|
+
class:border-t-0={id !== '1'}
|
|
27
|
+
class="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"
|
|
28
|
+
>
|
|
29
|
+
<span><slot name="header" /></span>
|
|
30
|
+
{#if params.open}
|
|
31
|
+
<ChevronUpIconSolid />
|
|
32
|
+
{:else}
|
|
33
|
+
<ChevronDownIconSolid />
|
|
34
|
+
{/if}
|
|
35
|
+
</button>
|
|
39
36
|
</h2>
|
|
40
37
|
<div use:collapse={params}>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
<div class="p-5 border border-t-0 border-gray-200 dark:border-gray-700">
|
|
39
|
+
<slot name="body" />
|
|
40
|
+
</div>
|
|
44
41
|
</div>
|
|
@@ -1,22 +1,7 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} AccordionItemProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} AccordionItemEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} AccordionItemSlots */
|
|
4
|
-
export default class AccordionItem extends SvelteComponentTyped<{
|
|
5
|
-
id: any;
|
|
6
|
-
}, {
|
|
7
|
-
[evt: string]: CustomEvent<any>;
|
|
8
|
-
}, {
|
|
9
|
-
header: {};
|
|
10
|
-
body: {};
|
|
11
|
-
}> {
|
|
12
|
-
}
|
|
13
|
-
export type AccordionItemProps = typeof __propDef.props;
|
|
14
|
-
export type AccordionItemEvents = typeof __propDef.events;
|
|
15
|
-
export type AccordionItemSlots = typeof __propDef.slots;
|
|
16
1
|
import { SvelteComponentTyped } from "svelte";
|
|
17
2
|
declare const __propDef: {
|
|
18
3
|
props: {
|
|
19
|
-
id:
|
|
4
|
+
id: string;
|
|
20
5
|
};
|
|
21
6
|
events: {
|
|
22
7
|
[evt: string]: CustomEvent<any>;
|
|
@@ -26,4 +11,9 @@ declare const __propDef: {
|
|
|
26
11
|
body: {};
|
|
27
12
|
};
|
|
28
13
|
};
|
|
14
|
+
export declare type AccordionItemProps = typeof __propDef.props;
|
|
15
|
+
export declare type AccordionItemEvents = typeof __propDef.events;
|
|
16
|
+
export declare type AccordionItemSlots = typeof __propDef.slots;
|
|
17
|
+
export default class AccordionItem extends SvelteComponentTyped<AccordionItemProps, AccordionItemEvents, AccordionItemSlots> {
|
|
18
|
+
}
|
|
29
19
|
export {};
|
package/alerts/Alert.svelte
CHANGED
package/alerts/Alert.svelte.d.ts
CHANGED
package/alerts/InfoAlert.svelte
CHANGED
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 {};
|
|
@@ -1,68 +1,45 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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";
|
|
1
|
+
<script >export let buttons;
|
|
2
|
+
let btnLength = buttons.length;
|
|
3
|
+
let classFirst = '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';
|
|
4
|
+
let classMiddle = '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';
|
|
5
|
+
let classLast = '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
6
|
</script>
|
|
30
7
|
|
|
31
8
|
<div class="inline-flex rounded-md shadow-sm" role="group">
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
9
|
+
{#each buttons as { name, icon, link, rel }, i}
|
|
10
|
+
{#if i === 0}
|
|
11
|
+
<button type="button" class={classFirst}>
|
|
12
|
+
{#if icon}
|
|
13
|
+
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
14
|
+
{/if}
|
|
15
|
+
{#if link}
|
|
16
|
+
<a href={link} {rel}>{name}</a>
|
|
17
|
+
{:else}
|
|
18
|
+
{name}
|
|
19
|
+
{/if}
|
|
20
|
+
</button>
|
|
21
|
+
{:else if i === btnLength - 1}
|
|
22
|
+
<button type="button" class={classLast}>
|
|
23
|
+
{#if icon}
|
|
24
|
+
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
25
|
+
{/if}
|
|
26
|
+
{#if link}
|
|
27
|
+
<a href={link} {rel}>{name}</a>
|
|
28
|
+
{:else}
|
|
29
|
+
{name}
|
|
30
|
+
{/if}
|
|
31
|
+
</button>
|
|
32
|
+
{:else}
|
|
33
|
+
<button type="button" class={classMiddle}>
|
|
34
|
+
{#if icon}
|
|
35
|
+
<svelte:component this={icon} className="h-4 w-4 mr-2" />
|
|
36
|
+
{/if}
|
|
37
|
+
{#if link}
|
|
38
|
+
<a href={link} {rel}>{name}</a>
|
|
39
|
+
{:else}
|
|
40
|
+
{name}
|
|
41
|
+
{/if}
|
|
42
|
+
</button>
|
|
43
|
+
{/if}
|
|
44
|
+
{/each}
|
|
68
45
|
</div>
|