flowbite-svelte 0.8.8 → 0.9.2
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/accordions/AccordionItem.svelte +31 -34
- package/accordions/AccordionItem.svelte.d.ts +6 -16
- 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 +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 +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 +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 +2 -2
- 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.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/navbar/DropdownNavbar.svelte +116 -201
- 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 +34 -10
- 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
package/README.md
CHANGED
|
@@ -18,7 +18,11 @@
|
|
|
18
18
|
|
|
19
19
|
[Badges](https://flowbite-svelte.vercel.app/badges)
|
|
20
20
|
|
|
21
|
-
## Button
|
|
21
|
+
## Button group compnents
|
|
22
|
+
|
|
23
|
+
[Button group](https://flowbite-svelte.vercel.app/button-groups)
|
|
24
|
+
|
|
25
|
+
## Button components
|
|
22
26
|
|
|
23
27
|
[Buttons](https://flowbite-svelte.vercel.app/buttons)
|
|
24
28
|
|
|
@@ -34,6 +38,10 @@
|
|
|
34
38
|
|
|
35
39
|
[Dropdowns](https://flowbite-svelte.vercel.app/dropdowns)
|
|
36
40
|
|
|
41
|
+
## Footer
|
|
42
|
+
|
|
43
|
+
[Footer](https://flowbite-svelte.vercel.app/footer)
|
|
44
|
+
|
|
37
45
|
## Icons
|
|
38
46
|
|
|
39
47
|
[Icons](https://flowbite-svelte.vercel.app/icons)
|
|
@@ -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
|
@@ -1,111 +1,104 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export let alertId = "alert-1";
|
|
7
|
-
export let closeBtn = false;
|
|
8
|
-
|
|
9
|
-
let hidden = false;
|
|
10
|
-
const handleHide = () => {
|
|
1
|
+
<script >export let color = 'blue';
|
|
2
|
+
export let alertId = 'alert-1';
|
|
3
|
+
export let closeBtn = false;
|
|
4
|
+
let hidden = false;
|
|
5
|
+
const handleHide = () => {
|
|
11
6
|
hidden = !hidden;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
slotClass = "ml-3 text-sm font-medium text-blue-700 dark:text-blue-800";
|
|
7
|
+
};
|
|
8
|
+
let divClass;
|
|
9
|
+
let svgClass;
|
|
10
|
+
let slotClass;
|
|
11
|
+
let buttonClass;
|
|
12
|
+
if (color === 'blue') {
|
|
13
|
+
divClass = 'flex p-4 mb-4 bg-blue-100 rounded-lg dark:bg-blue-200';
|
|
14
|
+
svgClass = 'flex-shrink-0 w-5 h-5 text-blue-700 dark:text-blue-800';
|
|
15
|
+
slotClass = 'ml-3 text-sm font-medium text-blue-700 dark:text-blue-800';
|
|
22
16
|
buttonClass =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
17
|
+
'ml-auto -mx-1.5 -my-1.5 bg-blue-100 text-blue-500 rounded-lg focus:ring-2 focus:ring-blue-400 p-1.5 hover:bg-blue-200 inline-flex h-8 w-8 dark:bg-blue-200 dark:text-blue-600 dark:hover:bg-blue-300';
|
|
18
|
+
}
|
|
19
|
+
else if (color === 'gray') {
|
|
20
|
+
divClass = 'flex p-4 mb-4 bg-gray-100 rounded-lg dark:bg-gray-200';
|
|
21
|
+
svgClass = 'flex-shrink-0 w-5 h-5 text-gray-700 dark:text-gray-800';
|
|
22
|
+
slotClass = 'ml-3 text-sm font-medium text-gray-700 dark:text-gray-800';
|
|
28
23
|
buttonClass =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
24
|
+
'ml-auto -mx-1.5 -my-1.5 bg-gray-100 text-gray-500 rounded-lg focus:ring-2 focus:ring-gray-400 p-1.5 hover:bg-gray-200 inline-flex h-8 w-8 dark:bg-gray-200 dark:text-gray-600 dark:hover:bg-gray-300';
|
|
25
|
+
}
|
|
26
|
+
else if (color === 'red') {
|
|
27
|
+
divClass = 'flex p-4 mb-4 bg-red-100 rounded-lg dark:bg-red-200';
|
|
28
|
+
svgClass = 'flex-shrink-0 w-5 h-5 text-red-700 dark:text-red-800';
|
|
29
|
+
slotClass = 'ml-3 text-sm font-medium text-red-700 dark:text-red-800';
|
|
34
30
|
buttonClass =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
'ml-auto -mx-1.5 -my-1.5 bg-red-100 text-red-500 rounded-lg focus:ring-2 focus:ring-red-400 p-1.5 hover:bg-red-200 inline-flex h-8 w-8 dark:bg-red-200 dark:text-red-600 dark:hover:bg-red-300';
|
|
32
|
+
}
|
|
33
|
+
else if (color === 'yellow') {
|
|
34
|
+
divClass = 'flex p-4 mb-4 bg-yellow-100 rounded-lg dark:bg-yellow-200';
|
|
35
|
+
svgClass = 'flex-shrink-0 w-5 h-5 text-yellow-700 dark:text-yellow-800';
|
|
36
|
+
slotClass = 'ml-3 text-sm font-medium text-yellow-700 dark:text-yellow-800';
|
|
40
37
|
buttonClass =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
38
|
+
'ml-auto -mx-1.5 -my-1.5 bg-yellow-100 text-yellow-500 rounded-lg focus:ring-2 focus:ring-yellow-400 p-1.5 hover:bg-yellow-200 inline-flex h-8 w-8 dark:bg-yellow-200 dark:text-yellow-600 dark:hover:bg-yellow-300';
|
|
39
|
+
}
|
|
40
|
+
else if (color === 'green') {
|
|
41
|
+
divClass = 'flex p-4 mb-4 bg-green-100 rounded-lg dark:bg-green-200';
|
|
42
|
+
svgClass = 'flex-shrink-0 w-5 h-5 text-green-700 dark:text-green-800';
|
|
43
|
+
slotClass = 'ml-3 text-sm font-medium text-green-700 dark:text-green-800';
|
|
46
44
|
buttonClass =
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
'ml-auto -mx-1.5 -my-1.5 bg-green-100 text-green-500 rounded-lg focus:ring-2 focus:ring-green-400 p-1.5 hover:bg-green-200 inline-flex h-8 w-8 dark:bg-green-200 dark:text-green-600 dark:hover:bg-green-300';
|
|
46
|
+
}
|
|
47
|
+
else if (color === 'indigo') {
|
|
48
|
+
divClass = 'flex p-4 mb-4 bg-indigo-100 rounded-lg dark:bg-indigo-200';
|
|
49
|
+
svgClass = 'flex-shrink-0 w-5 h-5 text-indigo-700 dark:text-indigo-800';
|
|
50
|
+
slotClass = 'ml-3 text-sm font-medium text-indigo-700 dark:text-indigo-800';
|
|
52
51
|
buttonClass =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
'ml-auto -mx-1.5 -my-1.5 bg-indigo-100 text-indigo-500 rounded-lg focus:ring-2 focus:ring-indigo-400 p-1.5 hover:bg-indigo-200 inline-flex h-8 w-8 dark:bg-indigo-200 dark:text-indigo-600 dark:hover:bg-indigo-300';
|
|
53
|
+
}
|
|
54
|
+
else if (color === 'purple') {
|
|
55
|
+
divClass = 'flex p-4 mb-4 bg-purple-100 rounded-lg dark:bg-purple-200';
|
|
56
|
+
svgClass = 'flex-shrink-0 w-5 h-5 text-purple-700 dark:text-purple-800';
|
|
57
|
+
slotClass = 'ml-3 text-sm font-medium text-purple-700 dark:text-purple-800';
|
|
58
58
|
buttonClass =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
'ml-auto -mx-1.5 -my-1.5 bg-purple-100 text-purple-500 rounded-lg focus:ring-2 focus:ring-purple-400 p-1.5 hover:bg-purple-200 inline-flex h-8 w-8 dark:bg-purple-200 dark:text-purple-600 dark:hover:bg-purple-300';
|
|
60
|
+
}
|
|
61
|
+
else if (color === 'pink') {
|
|
62
|
+
divClass = 'flex p-4 mb-4 bg-pink-100 rounded-lg dark:bg-pink-200';
|
|
63
|
+
svgClass = 'flex-shrink-0 w-5 h-5 text-pink-700 dark:text-pink-800';
|
|
64
|
+
slotClass = 'ml-3 text-sm font-medium text-pink-700 dark:text-pink-800';
|
|
64
65
|
buttonClass =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
66
|
+
'ml-auto -mx-1.5 -my-1.5 bg-pink-100 text-pink-500 rounded-lg focus:ring-2 focus:ring-pink-400 p-1.5 hover:bg-pink-200 inline-flex h-8 w-8 dark:bg-pink-200 dark:text-pink-600 dark:hover:bg-pink-300';
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
divClass = 'flex p-4 mb-4 bg-blue-100 rounded-lg dark:bg-blue-200';
|
|
70
|
+
svgClass = 'flex-shrink-0 w-5 h-5 text-blue-700 dark:text-blue-800';
|
|
71
|
+
slotClass = 'ml-3 text-sm font-medium text-blue-700 dark:text-blue-800';
|
|
70
72
|
buttonClass =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
+
'ml-auto -mx-1.5 -my-1.5 bg-gray-100 text-gray-500 rounded-lg focus:ring-2 focus:ring-gray-400 p-1.5 hover:bg-gray-200 inline-flex h-8 w-8 dark:bg-gray-200 dark:text-gray-600 dark:hover:bg-gray-300';
|
|
74
|
+
}
|
|
73
75
|
</script>
|
|
74
76
|
|
|
75
77
|
<div id={alertId} class:hidden class={divClass} role="alert">
|
|
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
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
103
|
-
><path
|
|
104
|
-
fill-rule="evenodd"
|
|
105
|
-
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
106
|
-
clip-rule="evenodd"
|
|
107
|
-
/></svg
|
|
108
|
-
>
|
|
109
|
-
</button>
|
|
110
|
-
{/if}
|
|
78
|
+
<svg class={svgClass} fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"
|
|
79
|
+
><path
|
|
80
|
+
fill-rule="evenodd"
|
|
81
|
+
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"
|
|
82
|
+
clip-rule="evenodd"
|
|
83
|
+
/></svg
|
|
84
|
+
>
|
|
85
|
+
<div class={slotClass}>
|
|
86
|
+
<slot />
|
|
87
|
+
</div>
|
|
88
|
+
{#if closeBtn}
|
|
89
|
+
<button on:click={handleHide} type="button" class={buttonClass} aria-label="Close">
|
|
90
|
+
<span class="sr-only">Close</span>
|
|
91
|
+
<svg
|
|
92
|
+
class="w-5 h-5"
|
|
93
|
+
fill="currentColor"
|
|
94
|
+
viewBox="0 0 20 20"
|
|
95
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
96
|
+
><path
|
|
97
|
+
fill-rule="evenodd"
|
|
98
|
+
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
99
|
+
clip-rule="evenodd"
|
|
100
|
+
/></svg
|
|
101
|
+
>
|
|
102
|
+
</button>
|
|
103
|
+
{/if}
|
|
111
104
|
</div>
|
package/alerts/Alert.svelte.d.ts
CHANGED
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} AlertProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} AlertEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} AlertSlots */
|
|
4
|
-
export default class Alert extends SvelteComponentTyped<{
|
|
5
|
-
color?: string;
|
|
6
|
-
alertId?: string;
|
|
7
|
-
closeBtn?: boolean;
|
|
8
|
-
}, {
|
|
9
|
-
[evt: string]: CustomEvent<any>;
|
|
10
|
-
}, {
|
|
11
|
-
default: {};
|
|
12
|
-
}> {
|
|
13
|
-
}
|
|
14
|
-
export type AlertProps = typeof __propDef.props;
|
|
15
|
-
export type AlertEvents = typeof __propDef.events;
|
|
16
|
-
export type AlertSlots = typeof __propDef.slots;
|
|
17
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Colors } from '../types';
|
|
18
3
|
declare const __propDef: {
|
|
19
4
|
props: {
|
|
20
|
-
color?:
|
|
5
|
+
color?: Colors;
|
|
21
6
|
alertId?: string;
|
|
22
7
|
closeBtn?: boolean;
|
|
23
8
|
};
|
|
@@ -28,4 +13,9 @@ declare const __propDef: {
|
|
|
28
13
|
default: {};
|
|
29
14
|
};
|
|
30
15
|
};
|
|
16
|
+
export declare type AlertProps = typeof __propDef.props;
|
|
17
|
+
export declare type AlertEvents = typeof __propDef.events;
|
|
18
|
+
export declare type AlertSlots = typeof __propDef.slots;
|
|
19
|
+
export default class Alert extends SvelteComponentTyped<AlertProps, AlertEvents, AlertSlots> {
|
|
20
|
+
}
|
|
31
21
|
export {};
|