flowbite-svelte 0.44.18 → 0.44.20
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/dist/accordion/Accordion.svelte.d.ts +0 -2
- package/dist/accordion/Accordion.svelte.d.ts.map +1 -1
- package/dist/alert/Alert.svelte +17 -35
- package/dist/alert/Alert.svelte.d.ts +8 -5
- package/dist/alert/Alert.svelte.d.ts.map +1 -1
- package/dist/badge/Badge.svelte +10 -25
- package/dist/badge/Badge.svelte.d.ts +7 -5
- package/dist/badge/Badge.svelte.d.ts.map +1 -1
- package/dist/buttons/Button.svelte +79 -17
- package/dist/buttons/Button.svelte.d.ts +7 -3
- package/dist/buttons/Button.svelte.d.ts.map +1 -1
- package/dist/cards/Card.svelte.d.ts +0 -2
- package/dist/cards/Card.svelte.d.ts.map +1 -1
- package/dist/carousel/Carousel.svelte +1 -1
- package/dist/carousel/{Carousel.d.ts → CarouselSlide.d.ts} +1 -1
- package/dist/carousel/CarouselSlide.d.ts.map +1 -0
- package/dist/carousel/Controls.svelte +1 -1
- package/dist/datepicker/Datepicker.svelte +3 -0
- package/dist/datepicker/Datepicker.svelte.d.ts +11 -0
- package/dist/datepicker/Datepicker.svelte.d.ts.map +1 -1
- package/dist/dropdown/Dropdown.svelte.d.ts +0 -2
- package/dist/dropdown/Dropdown.svelte.d.ts.map +1 -1
- package/dist/footer/Footer.svelte +2 -2
- package/dist/footer/Footer.svelte.d.ts +2 -2
- package/dist/footer/Footer.svelte.d.ts.map +1 -1
- package/dist/forms/CheckboxButton.svelte +84 -0
- package/dist/forms/CheckboxButton.svelte.d.ts +54 -0
- package/dist/forms/CheckboxButton.svelte.d.ts.map +1 -0
- package/dist/forms/FloatingLabelInput.svelte +1 -3
- package/dist/forms/FloatingLabelInput.svelte.d.ts +3 -3
- package/dist/forms/FloatingLabelInput.svelte.d.ts.map +1 -1
- package/dist/forms/MultiSelect.svelte +24 -30
- package/dist/forms/MultiSelect.svelte.d.ts +0 -3
- package/dist/forms/MultiSelect.svelte.d.ts.map +1 -1
- package/dist/forms/RadioButton.svelte +49 -0
- package/dist/forms/RadioButton.svelte.d.ts +52 -0
- package/dist/forms/RadioButton.svelte.d.ts.map +1 -0
- package/dist/forms/Textarea.svelte +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/indicators/Indicator.svelte +1 -1
- package/dist/indicators/Indicator.svelte.d.ts +3 -3
- package/dist/indicators/Indicator.svelte.d.ts.map +1 -1
- package/dist/list-group/Listgroup.svelte +7 -6
- package/dist/list-group/Listgroup.svelte.d.ts +1 -3
- package/dist/list-group/Listgroup.svelte.d.ts.map +1 -1
- package/dist/list-group/ListgroupItem.svelte +4 -2
- package/dist/list-group/ListgroupItem.svelte.d.ts +2 -0
- package/dist/list-group/ListgroupItem.svelte.d.ts.map +1 -1
- package/dist/mega-menu/MegaMenu.svelte.d.ts +0 -2
- package/dist/mega-menu/MegaMenu.svelte.d.ts.map +1 -1
- package/dist/modal/Modal.svelte +3 -3
- package/dist/modal/Modal.svelte.d.ts +6 -3
- package/dist/modal/Modal.svelte.d.ts.map +1 -1
- package/dist/navbar/NavHamburger.svelte +3 -1
- package/dist/navbar/NavHamburger.svelte.d.ts +2 -0
- package/dist/navbar/NavHamburger.svelte.d.ts.map +1 -1
- package/dist/navbar/Navbar.svelte.d.ts +0 -2
- package/dist/navbar/Navbar.svelte.d.ts.map +1 -1
- package/dist/popover/Popover.svelte.d.ts +0 -2
- package/dist/popover/Popover.svelte.d.ts.map +1 -1
- package/dist/toast/Toast.svelte +17 -27
- package/dist/toast/Toast.svelte.d.ts +7 -5
- package/dist/toast/Toast.svelte.d.ts.map +1 -1
- package/dist/toolbar/Toolbar.svelte +1 -1
- package/dist/toolbar/Toolbar.svelte.d.ts +0 -2
- package/dist/toolbar/Toolbar.svelte.d.ts.map +1 -1
- package/dist/tooltip/Tooltip.svelte.d.ts +0 -2
- package/dist/tooltip/Tooltip.svelte.d.ts.map +1 -1
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/Frame.svelte +3 -8
- package/dist/utils/Frame.svelte.d.ts +0 -3
- package/dist/utils/Frame.svelte.d.ts.map +1 -1
- package/dist/utils/Popper.svelte +3 -2
- package/dist/utils/Popper.svelte.d.ts +0 -2
- package/dist/utils/Popper.svelte.d.ts.map +1 -1
- package/dist/utils/TransitionFrame.svelte +27 -0
- package/dist/utils/TransitionFrame.svelte.d.ts +35 -0
- package/dist/utils/TransitionFrame.svelte.d.ts.map +1 -0
- package/dist/utils/focusTrap.d.ts.map +1 -1
- package/package.json +40 -28
- package/dist/carousel/Carousel.d.ts.map +0 -1
- /package/dist/carousel/{Carousel.js → CarouselSlide.js} +0 -0
|
@@ -15,8 +15,6 @@ declare const __propDef: {
|
|
|
15
15
|
rounded?: boolean | undefined;
|
|
16
16
|
border?: boolean | undefined;
|
|
17
17
|
shadow?: boolean | undefined;
|
|
18
|
-
transition?: ((node: HTMLElement, params: any) => import("svelte/transition").TransitionConfig) | undefined;
|
|
19
|
-
params?: object | undefined;
|
|
20
18
|
node?: HTMLElement | undefined;
|
|
21
19
|
use?: import("svelte/action").Action<HTMLElement, any, Record<never, any>> | undefined;
|
|
22
20
|
options?: object | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/accordion/Accordion.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AACC,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAmDH,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Accordion.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/accordion/Accordion.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AACC,OAAO,EAAY,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEvD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IAC5B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAmDH,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAwC,CAAC;AACxD,MAAM,MAAM,cAAc,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACpD,MAAM,MAAM,eAAe,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACtD,MAAM,MAAM,cAAc,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEpD;;;;;;;;GAQG;AACH,MAAM,CAAC,OAAO,OAAO,SAAU,SAAQ,eAAe,CAAC,cAAc,EAAE,eAAe,EAAE,cAAc,CAAC;CACtG"}
|
package/dist/alert/Alert.svelte
CHANGED
|
@@ -1,47 +1,29 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import {
|
|
1
|
+
<script>import TransitionFrame from '../utils/TransitionFrame.svelte';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
3
|
import CloseButton from '../utils/CloseButton.svelte';
|
|
4
|
-
import Frame from '../utils/Frame.svelte';
|
|
5
|
-
import { fade } from 'svelte/transition';
|
|
6
4
|
export let dismissable = false;
|
|
7
5
|
export let defaultClass = 'p-4 gap-3 text-sm';
|
|
8
|
-
let open = true;
|
|
9
|
-
const dispatch = createEventDispatcher();
|
|
10
|
-
$: dispatch(open ? 'open' : 'close');
|
|
11
|
-
function close(e) {
|
|
12
|
-
e.stopPropagation();
|
|
13
|
-
open = false;
|
|
14
|
-
}
|
|
15
6
|
let divClass;
|
|
16
7
|
$: divClass = twMerge(defaultClass, ($$slots.icon || dismissable) && 'flex items-center', $$props.class);
|
|
17
|
-
$: {
|
|
18
|
-
// set default values
|
|
19
|
-
$$restProps.color = $$restProps.color ?? 'primary';
|
|
20
|
-
$$restProps.rounded = $$restProps.rounded ?? true;
|
|
21
|
-
if (dismissable)
|
|
22
|
-
$$restProps.transition = $$restProps.transition ?? fade;
|
|
23
|
-
}
|
|
24
8
|
</script>
|
|
25
9
|
|
|
26
|
-
{
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
{/if}
|
|
10
|
+
<TransitionFrame {dismissable} color="primary" role="alert" rounded {...$$restProps} class={divClass} on:close let:close>
|
|
11
|
+
{#if $$slots.icon}
|
|
12
|
+
<slot name="icon" />
|
|
13
|
+
{/if}
|
|
31
14
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
15
|
+
{#if $$slots.icon || dismissable}
|
|
16
|
+
<div><slot /></div>
|
|
17
|
+
{:else}
|
|
18
|
+
<slot />
|
|
19
|
+
{/if}
|
|
37
20
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
{/if}
|
|
21
|
+
{#if dismissable}
|
|
22
|
+
<slot name="close-button" {close}>
|
|
23
|
+
<CloseButton class="ml-auto -mr-1.5 -my-1.5 dark:hover:bg-gray-700" color={$$restProps.color} on:click={close} on:click on:change on:keydown on:keyup on:focus on:blur on:mouseenter on:mouseleave />
|
|
24
|
+
</slot>
|
|
25
|
+
{/if}
|
|
26
|
+
</TransitionFrame>
|
|
45
27
|
|
|
46
28
|
<!--
|
|
47
29
|
@component
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { Dismissable } from '../types';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: import("svelte/elements").HTMLAnchorAttributes & {
|
|
5
4
|
tag?: string | undefined;
|
|
@@ -7,15 +6,19 @@ declare const __propDef: {
|
|
|
7
6
|
rounded?: boolean | undefined;
|
|
8
7
|
border?: boolean | undefined;
|
|
9
8
|
shadow?: boolean | undefined;
|
|
10
|
-
transition?: ((node: HTMLElement, params: any) => import("svelte/transition").TransitionConfig) | undefined;
|
|
11
|
-
params?: object | undefined;
|
|
12
9
|
node?: HTMLElement | undefined;
|
|
13
10
|
use?: import("svelte/action").Action<HTMLElement, any, Record<never, any>> | undefined;
|
|
14
11
|
options?: object | undefined;
|
|
15
12
|
class?: string | undefined;
|
|
16
13
|
role?: string | undefined;
|
|
17
|
-
} & Dismissable
|
|
14
|
+
} & import("..").Dismissable & {
|
|
15
|
+
transition?: ((node: HTMLElement, params: any) => import("svelte/transition").TransitionConfig) | undefined;
|
|
16
|
+
params?: any;
|
|
17
|
+
} & {
|
|
18
|
+
defaultClass?: string | undefined;
|
|
19
|
+
};
|
|
18
20
|
events: {
|
|
21
|
+
close: CustomEvent<any>;
|
|
19
22
|
click: MouseEvent;
|
|
20
23
|
change: CustomEvent<any>;
|
|
21
24
|
keydown: CustomEvent<any>;
|
|
@@ -31,7 +34,7 @@ declare const __propDef: {
|
|
|
31
34
|
icon: {};
|
|
32
35
|
default: {};
|
|
33
36
|
'close-button': {
|
|
34
|
-
close: (
|
|
37
|
+
close: (ev: MouseEvent | undefined) => void;
|
|
35
38
|
};
|
|
36
39
|
};
|
|
37
40
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Alert.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/alert/Alert.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;
|
|
1
|
+
{"version":3,"file":"Alert.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/alert/Alert.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AA6CD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAwC,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAChD,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAClD,MAAM,MAAM,UAAU,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,eAAe,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC;CACtF"}
|
package/dist/badge/Badge.svelte
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import { twMerge
|
|
1
|
+
<script>import TransitionFrame from '../utils/TransitionFrame.svelte';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
3
|
import CloseButton from '../utils/CloseButton.svelte';
|
|
4
|
-
import { fade } from 'svelte/transition';
|
|
5
|
-
import Frame from '../utils/Frame.svelte';
|
|
6
4
|
export let color = 'primary';
|
|
7
5
|
export let large = false;
|
|
8
6
|
export let dismissable = false;
|
|
@@ -59,29 +57,16 @@ const closeBtnColors = {
|
|
|
59
57
|
pink: 'text-pink-400 hover:text-pink-900 dark:hover:bg-pink-800 dark:hover:text-pink-300',
|
|
60
58
|
none: ''
|
|
61
59
|
};
|
|
62
|
-
$: {
|
|
63
|
-
if (dismissable)
|
|
64
|
-
$$restProps.transition = $$restProps.transition ?? fade;
|
|
65
|
-
}
|
|
66
|
-
let open = true;
|
|
67
|
-
const dispatch = createEventDispatcher();
|
|
68
|
-
$: dispatch(open ? 'open' : 'close');
|
|
69
|
-
const close = (e) => {
|
|
70
|
-
e.stopPropagation();
|
|
71
|
-
open = false;
|
|
72
|
-
};
|
|
73
60
|
</script>
|
|
74
61
|
|
|
75
|
-
{
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
{
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
</Frame>
|
|
84
|
-
{/if}
|
|
62
|
+
<TransitionFrame {dismissable} {...$$restProps} class={badgeClass} let:close on:close>
|
|
63
|
+
<slot />
|
|
64
|
+
{#if dismissable}
|
|
65
|
+
<slot name="close-button" {close}>
|
|
66
|
+
<CloseButton {color} on:click={close} size={large ? 'sm' : 'xs'} name="Remove badge" class="ml-1.5 -mr-1.5" />
|
|
67
|
+
</slot>
|
|
68
|
+
{/if}
|
|
69
|
+
</TransitionFrame>
|
|
85
70
|
|
|
86
71
|
<!--
|
|
87
72
|
@component
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type { Dismissable } from '../types';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: Omit<import("svelte/elements").HTMLAnchorAttributes & {
|
|
5
4
|
tag?: string | undefined;
|
|
@@ -7,24 +6,27 @@ declare const __propDef: {
|
|
|
7
6
|
rounded?: boolean | undefined;
|
|
8
7
|
border?: boolean | undefined;
|
|
9
8
|
shadow?: boolean | undefined;
|
|
10
|
-
transition?: ((node: HTMLElement, params: any) => import("svelte/transition").TransitionConfig) | undefined;
|
|
11
|
-
params?: object | undefined;
|
|
12
9
|
node?: HTMLElement | undefined;
|
|
13
10
|
use?: import("svelte/action").Action<HTMLElement, any, Record<never, any>> | undefined;
|
|
14
11
|
options?: object | undefined;
|
|
15
12
|
class?: string | undefined;
|
|
16
13
|
role?: string | undefined;
|
|
17
|
-
}
|
|
14
|
+
} & import("..").Dismissable & {
|
|
15
|
+
transition?: ((node: HTMLElement, params: any) => import("svelte/transition").TransitionConfig) | undefined;
|
|
16
|
+
params?: any;
|
|
17
|
+
}, "color"> & {
|
|
18
18
|
color?: "red" | "yellow" | "green" | "indigo" | "purple" | "pink" | "blue" | "dark" | "primary" | "none" | undefined;
|
|
19
19
|
large?: boolean | undefined;
|
|
20
20
|
};
|
|
21
21
|
events: {
|
|
22
|
+
close: CustomEvent<any>;
|
|
23
|
+
} & {
|
|
22
24
|
[evt: string]: CustomEvent<any>;
|
|
23
25
|
};
|
|
24
26
|
slots: {
|
|
25
27
|
default: {};
|
|
26
28
|
'close-button': {
|
|
27
|
-
close: (
|
|
29
|
+
close: (ev: MouseEvent | undefined) => void;
|
|
28
30
|
};
|
|
29
31
|
};
|
|
30
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Badge.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/badge/Badge.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;
|
|
1
|
+
{"version":3,"file":"Badge.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/badge/Badge.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AA8FD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAwC,CAAC;AACxD,MAAM,MAAM,UAAU,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAChD,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AAClD,MAAM,MAAM,UAAU,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,CAAC,OAAO,OAAO,KAAM,SAAQ,eAAe,CAAC,UAAU,EAAE,WAAW,EAAE,UAAU,CAAC;CACtF"}
|
|
@@ -8,8 +8,10 @@ export let href = undefined;
|
|
|
8
8
|
export let type = 'button';
|
|
9
9
|
export let color = group ? (outline ? 'dark' : 'alternative') : 'primary';
|
|
10
10
|
export let shadow = false;
|
|
11
|
+
export let tag = 'button';
|
|
12
|
+
export let checked = undefined;
|
|
11
13
|
const colorClasses = {
|
|
12
|
-
alternative: 'text-gray-900 bg-white border border-gray-200 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 hover:text-primary-700 focus:text-primary-700 dark:focus:text-white dark:hover:text-white',
|
|
14
|
+
alternative: 'text-gray-900 bg-white border border-gray-200 hover:bg-gray-100 dark:bg-gray-800 dark:text-gray-400 hover:text-primary-700 focus-within:text-primary-700 dark:focus-within:text-white dark:hover:text-white',
|
|
13
15
|
blue: 'text-white bg-blue-700 hover:bg-blue-800 dark:bg-blue-600 dark:hover:bg-blue-700',
|
|
14
16
|
dark: 'text-white bg-gray-800 hover:bg-gray-900 dark:bg-gray-800 dark:hover:bg-gray-700',
|
|
15
17
|
green: 'text-white bg-green-700 hover:bg-green-800 dark:bg-green-600 dark:hover:bg-green-700',
|
|
@@ -20,16 +22,28 @@ const colorClasses = {
|
|
|
20
22
|
yellow: 'text-white bg-yellow-400 hover:bg-yellow-500 ',
|
|
21
23
|
none: ''
|
|
22
24
|
};
|
|
25
|
+
const colorCheckedClasses = {
|
|
26
|
+
alternative: 'text-primary-700 border dark:text-primary-500 bg-gray-100 dark:bg-gray-700 border-gray-300 shadow-gray-300 dark:shadow-gray-800 shadow-inner',
|
|
27
|
+
blue: 'text-blue-900 bg-blue-400 dark:bg-blue-500 shadow-blue-700 dark:shadow-blue-800 shadow-inner',
|
|
28
|
+
dark: 'text-white bg-gray-500 dark:bg-gray-600 shadow-gray-800 dark:shadow-gray-900 shadow-inner',
|
|
29
|
+
green: 'text-green-900 bg-green-400 dark:bg-green-500 shadow-green-700 dark:shadow-green-800 shadow-inner',
|
|
30
|
+
light: 'text-gray-900 bg-gray-100 border border-gray-300 dark:bg-gray-500 dark:text-gray-900 dark:border-gray-700 shadow-gray-300 dark:shadow-gray-700 shadow-inner',
|
|
31
|
+
primary: 'text-primary-900 bg-primary-400 dark:bg-primary-500 shadow-primary-700 dark:shadow-primary-800 shadow-inner',
|
|
32
|
+
purple: 'text-purple-900 bg-purple-400 dark:bg-purple-500 shadow-purple-700 dark:shadow-purple-800 shadow-inner',
|
|
33
|
+
red: 'text-red-900 bg-red-400 dark:bg-red-500 shadow-red-700 dark:shadow-red-800 shadow-inner',
|
|
34
|
+
yellow: 'text-yellow-900 bg-yellow-300 dark:bg-yellow-400 shadow-yellow-500 dark:shadow-yellow-700 shadow-inner',
|
|
35
|
+
none: ''
|
|
36
|
+
};
|
|
23
37
|
const coloredFocusClasses = {
|
|
24
|
-
alternative: 'focus:ring-gray-200 dark:focus:ring-gray-700',
|
|
25
|
-
blue: 'focus:ring-blue-300 dark:focus:ring-blue-800',
|
|
26
|
-
dark: 'focus:ring-gray-300 dark:focus:ring-gray-700',
|
|
27
|
-
green: 'focus:ring-green-300 dark:focus:ring-green-800',
|
|
28
|
-
light: 'focus:ring-gray-200 dark:focus:ring-gray-700',
|
|
29
|
-
primary: 'focus:ring-primary-300 dark:focus:ring-primary-800',
|
|
30
|
-
purple: 'focus:ring-purple-300 dark:focus:ring-purple-900',
|
|
31
|
-
red: 'focus:ring-red-300 dark:focus:ring-red-900',
|
|
32
|
-
yellow: 'focus:ring-yellow-300 dark:focus:ring-yellow-900',
|
|
38
|
+
alternative: 'focus-within:ring-gray-200 dark:focus-within:ring-gray-700',
|
|
39
|
+
blue: 'focus-within:ring-blue-300 dark:focus-within:ring-blue-800',
|
|
40
|
+
dark: 'focus-within:ring-gray-300 dark:focus-within:ring-gray-700',
|
|
41
|
+
green: 'focus-within:ring-green-300 dark:focus-within:ring-green-800',
|
|
42
|
+
light: 'focus-within:ring-gray-200 dark:focus-within:ring-gray-700',
|
|
43
|
+
primary: 'focus-within:ring-primary-300 dark:focus-within:ring-primary-800',
|
|
44
|
+
purple: 'focus-within:ring-purple-300 dark:focus-within:ring-purple-900',
|
|
45
|
+
red: 'focus-within:ring-red-300 dark:focus-within:ring-red-900',
|
|
46
|
+
yellow: 'focus-within:ring-yellow-300 dark:focus-within:ring-yellow-900',
|
|
33
47
|
none: ''
|
|
34
48
|
};
|
|
35
49
|
const coloredShadowClasses = {
|
|
@@ -45,9 +59,9 @@ const coloredShadowClasses = {
|
|
|
45
59
|
none: ''
|
|
46
60
|
};
|
|
47
61
|
const outlineClasses = {
|
|
48
|
-
alternative: 'text-gray-900 hover:text-white border border-gray-800 hover:bg-gray-900 focus:bg-gray-900 focus:text-white focus:ring-gray-300 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-800',
|
|
62
|
+
alternative: 'text-gray-900 dark:text-gray-400 hover:text-white border border-gray-800 hover:bg-gray-900 focus-within:bg-gray-900 focus-within:text-white focus-within:ring-gray-300 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-600 dark:focus-within:ring-gray-800',
|
|
49
63
|
blue: 'text-blue-700 hover:text-white border border-blue-700 hover:bg-blue-800 dark:border-blue-500 dark:text-blue-500 dark:hover:text-white dark:hover:bg-blue-600',
|
|
50
|
-
dark: 'text-gray-900 hover:text-white border border-gray-800 hover:bg-gray-900 focus:bg-gray-900 focus:text-white dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-600',
|
|
64
|
+
dark: 'text-gray-900 hover:text-white border border-gray-800 hover:bg-gray-900 focus-within:bg-gray-900 focus-within:text-white dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-600',
|
|
51
65
|
green: 'text-green-700 hover:text-white border border-green-700 hover:bg-green-800 dark:border-green-500 dark:text-green-500 dark:hover:text-white dark:hover:bg-green-600',
|
|
52
66
|
light: 'text-gray-500 hover:text-gray-900 bg-white border border-gray-200 dark:border-gray-600 dark:hover:text-white dark:text-gray-400 hover:bg-gray-50 dark:bg-gray-700 dark:hover:bg-gray-600',
|
|
53
67
|
primary: 'text-primary-700 hover:text-white border border-primary-700 hover:bg-primary-700 dark:border-primary-500 dark:text-primary-500 dark:hover:text-white dark:hover:bg-primary-600',
|
|
@@ -65,12 +79,58 @@ const sizeClasses = {
|
|
|
65
79
|
};
|
|
66
80
|
const hasBorder = () => outline || color === 'alternative' || color === 'light';
|
|
67
81
|
let buttonClass;
|
|
68
|
-
$: buttonClass = twMerge('text-center font-medium', group ? 'focus:ring-2' : 'focus:ring-4', group && 'focus:z-10', group || 'focus:outline-none', 'inline-flex items-center justify-center ' + sizeClasses[size], outline
|
|
82
|
+
$: buttonClass = twMerge('text-center font-medium', group ? 'focus-within:ring-2' : 'focus-within:ring-4', group && 'focus-within:z-10', group || 'focus-within:outline-none', 'inline-flex items-center justify-center ' + sizeClasses[size], outline && checked && 'border dark:border-gray-900', outline && checked && colorCheckedClasses[color], outline && !checked && outlineClasses[color], !outline && checked && colorCheckedClasses[color], !outline && !checked && colorClasses[color], color === 'alternative' &&
|
|
83
|
+
(group && !checked
|
|
84
|
+
? 'dark:bg-gray-700 dark:text-white dark:border-gray-700 dark:hover:border-gray-600 dark:hover:bg-gray-600'
|
|
85
|
+
: 'dark:bg-transparent dark:border-gray-600 dark:hover:border-gray-700'), outline &&
|
|
86
|
+
color === 'dark' &&
|
|
87
|
+
(group
|
|
88
|
+
? checked
|
|
89
|
+
? 'bg-gray-900 border-gray-800 dark:border-white dark:bg-gray-600'
|
|
90
|
+
: 'dark:text-white border-gray-800 dark:border-white'
|
|
91
|
+
: 'dark:text-gray-400 dark:border-gray-700'), coloredFocusClasses[color], hasBorder() && group && 'border-l-0 first:border-l', group
|
|
92
|
+
? (pill && 'first:rounded-l-full last:rounded-r-full') || 'first:rounded-l-lg last:rounded-r-lg'
|
|
93
|
+
: (pill && 'rounded-full') || 'rounded-lg', shadow && 'shadow-lg', shadow && coloredShadowClasses[color], $$props.disabled && 'cursor-not-allowed opacity-50', $$props.class);
|
|
69
94
|
</script>
|
|
70
95
|
|
|
71
|
-
|
|
72
|
-
<
|
|
73
|
-
|
|
96
|
+
{#if href}
|
|
97
|
+
<a
|
|
98
|
+
{href}
|
|
99
|
+
{...$$restProps}
|
|
100
|
+
class={buttonClass}
|
|
101
|
+
role="button"
|
|
102
|
+
on:click
|
|
103
|
+
on:change
|
|
104
|
+
on:keydown
|
|
105
|
+
on:keyup
|
|
106
|
+
on:touchstart|passive
|
|
107
|
+
on:touchend
|
|
108
|
+
on:touchcancel
|
|
109
|
+
on:mouseenter
|
|
110
|
+
on:mouseleave>
|
|
111
|
+
<slot />
|
|
112
|
+
</a>
|
|
113
|
+
{:else if tag === 'button'}
|
|
114
|
+
<button
|
|
115
|
+
{type}
|
|
116
|
+
{...$$restProps}
|
|
117
|
+
class={buttonClass}
|
|
118
|
+
on:click
|
|
119
|
+
on:change
|
|
120
|
+
on:keydown
|
|
121
|
+
on:keyup
|
|
122
|
+
on:touchstart|passive
|
|
123
|
+
on:touchend
|
|
124
|
+
on:touchcancel
|
|
125
|
+
on:mouseenter
|
|
126
|
+
on:mouseleave>
|
|
127
|
+
<slot />
|
|
128
|
+
</button>
|
|
129
|
+
{:else}
|
|
130
|
+
<svelte:element this={tag} {...$$restProps} class={buttonClass}>
|
|
131
|
+
<slot />
|
|
132
|
+
</svelte:element>
|
|
133
|
+
{/if}
|
|
74
134
|
|
|
75
135
|
<!--
|
|
76
136
|
@component
|
|
@@ -80,7 +140,9 @@ $: buttonClass = twMerge('text-center font-medium', group ? 'focus:ring-2' : 'fo
|
|
|
80
140
|
@prop export let outline: boolean = false;
|
|
81
141
|
@prop export let size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = group ? 'sm' : 'md';
|
|
82
142
|
@prop export let href: string | undefined = undefined;
|
|
83
|
-
@prop export let type:
|
|
143
|
+
@prop export let type: HTMLButtonAttributes['type'] = 'button';
|
|
84
144
|
@prop export let color: ButtonColor = group ? (outline ? 'dark' : 'alternative') : 'primary';
|
|
85
145
|
@prop export let shadow: boolean = false;
|
|
146
|
+
@prop export let tag: string = 'button';
|
|
147
|
+
@prop export let checked: boolean | undefined = undefined;
|
|
86
148
|
-->
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { HTMLButtonAttributes } from 'svelte/elements';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
@@ -7,9 +7,11 @@ declare const __propDef: {
|
|
|
7
7
|
outline?: boolean | undefined;
|
|
8
8
|
size?: "xs" | "sm" | "lg" | "xl" | "md" | undefined;
|
|
9
9
|
href?: string | undefined;
|
|
10
|
-
type?:
|
|
10
|
+
type?: HTMLButtonAttributes['type'];
|
|
11
11
|
color?: "red" | "yellow" | "green" | "purple" | "blue" | "light" | "dark" | "primary" | "none" | "alternative" | undefined;
|
|
12
12
|
shadow?: boolean | undefined;
|
|
13
|
+
tag?: string | undefined;
|
|
14
|
+
checked?: boolean | undefined;
|
|
13
15
|
};
|
|
14
16
|
events: {
|
|
15
17
|
click: MouseEvent;
|
|
@@ -38,9 +40,11 @@ export type ButtonSlots = typeof __propDef.slots;
|
|
|
38
40
|
* @prop export let outline: boolean = false;
|
|
39
41
|
* @prop export let size: 'xs' | 'sm' | 'md' | 'lg' | 'xl' = group ? 'sm' : 'md';
|
|
40
42
|
* @prop export let href: string | undefined = undefined;
|
|
41
|
-
* @prop export let type:
|
|
43
|
+
* @prop export let type: HTMLButtonAttributes['type'] = 'button';
|
|
42
44
|
* @prop export let color: ButtonColor = group ? (outline ? 'dark' : 'alternative') : 'primary';
|
|
43
45
|
* @prop export let shadow: boolean = false;
|
|
46
|
+
* @prop export let tag: string = 'button';
|
|
47
|
+
* @prop export let checked: boolean | undefined = undefined;
|
|
44
48
|
*/
|
|
45
49
|
export default class Button extends SvelteComponent<ButtonProps, ButtonEvents, ButtonSlots> {
|
|
46
50
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/buttons/Button.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;
|
|
1
|
+
{"version":3,"file":"Button.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/buttons/Button.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AAID,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAgK5D,QAAA,MAAM,SAAS;;;;;;eAD6N,MAAM,GAAG,SAAS;eAAS,oBAAoB,CAAC,MAAM,CAAC;;;;kBAAiE,OAAO,GAAG,SAAS;;;;;;;;;;;;;;;;;;CACzS,CAAC;AAC/E,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACjD,MAAM,MAAM,YAAY,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACnD,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEjD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,eAAe,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC;CAC1F"}
|
|
@@ -7,8 +7,6 @@ declare const __propDef: {
|
|
|
7
7
|
rounded?: boolean | undefined;
|
|
8
8
|
border?: boolean | undefined;
|
|
9
9
|
shadow?: boolean | undefined;
|
|
10
|
-
transition?: ((node: HTMLElement, params: any) => import("svelte/transition").TransitionConfig) | undefined;
|
|
11
|
-
params?: object | undefined;
|
|
12
10
|
node?: HTMLElement | undefined;
|
|
13
11
|
use?: import("svelte/action").Action<HTMLElement, any, Record<never, any>> | undefined;
|
|
14
12
|
options?: object | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Card.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/cards/Card.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AACD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAoE3C,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Card.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/cards/Card.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AACD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAoE3C,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAwC,CAAC;AACxD,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAC/C,MAAM,MAAM,UAAU,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACjD,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAE/C;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,eAAe,CAAC,SAAS,EAAE,UAAU,EAAE,SAAS,CAAC;CAClF"}
|
|
@@ -7,7 +7,7 @@ import { twMerge } from 'tailwind-merge';
|
|
|
7
7
|
import Controls from './Controls.svelte';
|
|
8
8
|
import Indicators from './Indicators.svelte';
|
|
9
9
|
import Slide from './Slide.svelte';
|
|
10
|
-
import { canChangeSlide } from './
|
|
10
|
+
import { canChangeSlide } from './CarouselSlide';
|
|
11
11
|
const SLIDE_DURATION_RATIO = 0.25; // TODO: Expose one day?
|
|
12
12
|
export let images;
|
|
13
13
|
export let index = 0;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CarouselSlide.d.ts","sourceRoot":"","sources":["../../../../src/lib/carousel/CarouselSlide.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;qBAKR,IAAI;mBACN,MAAM;;aAStB,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import { getContext } from 'svelte';
|
|
2
2
|
import ControlButton from './ControlButton.svelte';
|
|
3
3
|
import { twMerge } from 'tailwind-merge';
|
|
4
|
-
import { canChangeSlide } from './
|
|
4
|
+
import { canChangeSlide } from './CarouselSlide';
|
|
5
5
|
const state = getContext('state');
|
|
6
6
|
const { update } = state;
|
|
7
7
|
function changeSlide(forward) {
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { SvelteComponent } from "svelte";
|
|
2
|
+
declare module 'svelte/elements' {
|
|
3
|
+
interface HTMLAttributes<T> {
|
|
4
|
+
[x: `data-${string}`]: any;
|
|
5
|
+
'date-rangepicker'?: boolean;
|
|
6
|
+
datepicker?: boolean;
|
|
7
|
+
'datepicker-buttons'?: boolean;
|
|
8
|
+
'datepicker-format'?: string;
|
|
9
|
+
'datepicker-orientation'?: string;
|
|
10
|
+
'datepicker-title'?: string;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
2
13
|
declare const __propDef: {
|
|
3
14
|
props: {
|
|
4
15
|
[x: string]: any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Datepicker.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/datepicker/Datepicker.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;
|
|
1
|
+
{"version":3,"file":"Datepicker.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/datepicker/Datepicker.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AACC,OAAO,QAAQ,iBAAiB,CAAC;IAC/B,UAAU,cAAc,CAAC,CAAC;QACxB,CAAC,CAAC,EAAE,QAAQ,MAAM,EAAE,GAAG,GAAG,CAAC;QAC3B,kBAAkB,CAAC,EAAE,OAAO,CAAC;QAC7B,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,oBAAoB,CAAC,EAAE,OAAO,CAAC;QAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;QAC7B,wBAAwB,CAAC,EAAE,MAAM,CAAC;QAClC,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B;CACF;AAkEH,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;CAA+D,CAAC;AAC/E,MAAM,MAAM,eAAe,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACrD,MAAM,MAAM,gBAAgB,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACvD,MAAM,MAAM,eAAe,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAErD;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,eAAe,CAAC,eAAe,EAAE,gBAAgB,EAAE,eAAe,CAAC;CAC1G"}
|
|
@@ -9,8 +9,6 @@ declare const __propDef: {
|
|
|
9
9
|
rounded?: boolean | undefined;
|
|
10
10
|
border?: boolean | undefined;
|
|
11
11
|
shadow?: boolean | undefined;
|
|
12
|
-
transition?: ((node: HTMLElement, params: any) => import("svelte/transition").TransitionConfig) | undefined;
|
|
13
|
-
params?: object | undefined;
|
|
14
12
|
node?: HTMLElement | undefined;
|
|
15
13
|
use?: import("svelte/action").Action<HTMLElement, any, Record<never, any>> | undefined;
|
|
16
14
|
options?: object | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dropdown.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/dropdown/Dropdown.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AACC,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA+EJ,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Dropdown.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/dropdown/Dropdown.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AACC,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA+EJ,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAwC,CAAC;AACxD,MAAM,MAAM,aAAa,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACnD,MAAM,MAAM,cAAc,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACrD,MAAM,MAAM,aAAa,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEnD;;;;;;;;;GASG;AACH,MAAM,CAAC,OAAO,OAAO,QAAS,SAAQ,eAAe,CAAC,aAAa,EAAE,cAAc,EAAE,aAAa,CAAC;CAClG"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import { twMerge } from 'tailwind-merge';
|
|
2
|
-
export let footerType =
|
|
2
|
+
export let footerType = undefined;
|
|
3
3
|
let footerClass = twMerge(footerType === 'sitemap' && 'bg-gray-800', footerType === 'socialmedia' && 'p-4 bg-white sm:p-6 dark:bg-gray-800', footerType === 'logo' && 'p-4 bg-white rounded-lg shadow md:px-6 md:py-8 dark:bg-gray-800', footerType === 'default' && 'p-4 bg-white rounded-lg shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800', $$props.class);
|
|
4
4
|
</script>
|
|
5
5
|
|
|
@@ -11,5 +11,5 @@ let footerClass = twMerge(footerType === 'sitemap' && 'bg-gray-800', footerType
|
|
|
11
11
|
@component
|
|
12
12
|
[Go to docs](https://flowbite-svelte.com/)
|
|
13
13
|
## Props
|
|
14
|
-
@prop export let footerType: 'sitemap' | 'default' | 'logo' | 'socialmedia' =
|
|
14
|
+
@prop export let footerType: 'sitemap' | 'default' | 'logo' | 'socialmedia' | undefined = undefined;
|
|
15
15
|
-->
|
|
@@ -2,7 +2,7 @@ import { SvelteComponent } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
footerType?:
|
|
5
|
+
footerType?: 'sitemap' | 'default' | 'logo' | 'socialmedia' | undefined;
|
|
6
6
|
};
|
|
7
7
|
events: {
|
|
8
8
|
[evt: string]: CustomEvent<any>;
|
|
@@ -17,7 +17,7 @@ export type FooterSlots = typeof __propDef.slots;
|
|
|
17
17
|
/**
|
|
18
18
|
* [Go to docs](https://flowbite-svelte.com/)
|
|
19
19
|
* ## Props
|
|
20
|
-
* @prop export let footerType: 'sitemap' | 'default' | 'logo' | 'socialmedia' =
|
|
20
|
+
* @prop export let footerType: 'sitemap' | 'default' | 'logo' | 'socialmedia' | undefined = undefined;
|
|
21
21
|
*/
|
|
22
22
|
export default class Footer extends SvelteComponent<FooterProps, FooterEvents, FooterSlots> {
|
|
23
23
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Footer.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/footer/Footer.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AAmBD,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Footer.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/footer/Footer.svelte"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,QAAQ,CAEvC;AAmBD,QAAA,MAAM,SAAS;;;qBAD2C,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,aAAa,GAAG,SAAS;;;;;;;;CACtC,CAAC;AAC/E,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AACjD,MAAM,MAAM,YAAY,GAAG,OAAO,SAAS,CAAC,MAAM,CAAC;AACnD,MAAM,MAAM,WAAW,GAAG,OAAO,SAAS,CAAC,KAAK,CAAC;AAEjD;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,eAAe,CAAC,WAAW,EAAE,YAAY,EAAE,WAAW,CAAC;CAC1F"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
<script>import Button from '../buttons/Button.svelte';
|
|
2
|
+
import { twMerge } from 'tailwind-merge';
|
|
3
|
+
export let group = [];
|
|
4
|
+
export let value = 'on';
|
|
5
|
+
export let checked = undefined;
|
|
6
|
+
export let inline = true;
|
|
7
|
+
// Button properties forwarding
|
|
8
|
+
export let pill = false;
|
|
9
|
+
export let outline = false;
|
|
10
|
+
export let size = undefined;
|
|
11
|
+
export let color = undefined;
|
|
12
|
+
export let shadow = false;
|
|
13
|
+
// react on external group changes
|
|
14
|
+
function init(_, _group) {
|
|
15
|
+
if (checked === undefined)
|
|
16
|
+
checked = _group.includes(value);
|
|
17
|
+
onChange();
|
|
18
|
+
return {
|
|
19
|
+
update(_group) {
|
|
20
|
+
checked = _group.includes(value);
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function onChange() {
|
|
25
|
+
// There's a bug in Svelte and bind:group is not working with wrapped checkbox
|
|
26
|
+
// This workaround is taken from:
|
|
27
|
+
// https://svelte.dev/repl/de117399559f4e7e9e14e2fc9ab243cc?version=3.12.1
|
|
28
|
+
const index = group.indexOf(value);
|
|
29
|
+
if (checked === undefined)
|
|
30
|
+
checked = index >= 0;
|
|
31
|
+
if (checked) {
|
|
32
|
+
if (index < 0) {
|
|
33
|
+
group.push(value);
|
|
34
|
+
group = group;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
if (index >= 0) {
|
|
39
|
+
group.splice(index, 1);
|
|
40
|
+
group = group;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
let buttonClass;
|
|
45
|
+
$: buttonClass = twMerge(inline ? 'inline-flex' : 'flex', $$props.class);
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<Button tag="label" {checked} {pill} {outline} {size} {color} {shadow} class={buttonClass}>
|
|
49
|
+
<input
|
|
50
|
+
use:init={group}
|
|
51
|
+
type="checkbox"
|
|
52
|
+
bind:checked
|
|
53
|
+
{value}
|
|
54
|
+
{...$$restProps}
|
|
55
|
+
class="sr-only"
|
|
56
|
+
on:keyup
|
|
57
|
+
on:keydown
|
|
58
|
+
on:keypress
|
|
59
|
+
on:focus
|
|
60
|
+
on:blur
|
|
61
|
+
on:click
|
|
62
|
+
on:mouseover
|
|
63
|
+
on:mouseenter
|
|
64
|
+
on:mouseleave
|
|
65
|
+
on:paste
|
|
66
|
+
on:change={onChange}
|
|
67
|
+
on:change />
|
|
68
|
+
<slot />
|
|
69
|
+
</Button>
|
|
70
|
+
|
|
71
|
+
<!--
|
|
72
|
+
@component
|
|
73
|
+
[Go to docs](https://flowbite-svelte.com/)
|
|
74
|
+
## Props
|
|
75
|
+
@prop export let group: (string | number)[] = [];
|
|
76
|
+
@prop export let value: string | number = 'on';
|
|
77
|
+
@prop export let checked: boolean | undefined = undefined;
|
|
78
|
+
@prop export let inline: boolean = true;
|
|
79
|
+
@prop export let pill: boolean = false;
|
|
80
|
+
@prop export let outline: boolean = false;
|
|
81
|
+
@prop export let size: SizeType | undefined = undefined;
|
|
82
|
+
@prop export let color: ButtonColorType | undefined = undefined;
|
|
83
|
+
@prop export let shadow: boolean = false;
|
|
84
|
+
-->
|