flowbite-svelte 0.27.4 → 0.27.5
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/CHANGELOG.md +14 -0
- package/accordions/Accordion.svelte +24 -0
- package/accordions/Accordion.svelte.d.ts +30 -0
- package/accordions/AccordionItem.svelte +36 -70
- package/accordions/AccordionItem.svelte.d.ts +5 -8
- package/buttongroups/ButtonGroup.svelte +4 -4
- package/buttongroups/ButtonGroup.svelte.d.ts +2 -0
- package/buttons/Button.svelte +2 -3
- package/forms/Input.svelte +68 -38
- package/forms/Input.svelte.d.ts +8 -3
- package/forms/InputAddon.svelte +29 -0
- package/forms/InputAddon.svelte.d.ts +19 -0
- package/forms/Radio.svelte +30 -43
- package/forms/Radio.svelte.d.ts +2 -2
- package/forms/Search.svelte +51 -43
- package/forms/Search.svelte.d.ts +5 -6
- package/forms/SimpleSearch.svelte +17 -62
- package/forms/SimpleSearch.svelte.d.ts +0 -18
- package/index.d.ts +2 -0
- package/index.js +2 -0
- package/modals/Modal.svelte.d.ts +1 -2
- package/package.json +3 -1
- package/toasts/Toast.svelte +0 -1
- package/types.d.ts +3 -32
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.27.5](https://github.com/themesberg/flowbite-svelte/compare/v0.27.4...v0.27.5) (2022-10-01)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add fetchMarkdownPosts in utils/index ([#333](https://github.com/themesberg/flowbite-svelte/issues/333)) ([b604c0c](https://github.com/themesberg/flowbite-svelte/commit/b604c0c31c99b743817d814b3b043c42ccfaf14c))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* accordion slots + docs ([#349](https://github.com/themesberg/flowbite-svelte/issues/349)) ([78a2542](https://github.com/themesberg/flowbite-svelte/commit/78a25427e31f61ba86ce825d9127515326448afa))
|
|
16
|
+
* props using vite named import ([#347](https://github.com/themesberg/flowbite-svelte/issues/347)) ([7072e03](https://github.com/themesberg/flowbite-svelte/commit/7072e03b7ec8bac2e3d74d53f87c54dab772e159))
|
|
17
|
+
* use vite to import a file as text ([#342](https://github.com/themesberg/flowbite-svelte/issues/342)) ([07ac592](https://github.com/themesberg/flowbite-svelte/commit/07ac592b0a06cda8afd71d918145693a0834b4f3))
|
|
18
|
+
|
|
5
19
|
### [0.27.4](https://github.com/themesberg/flowbite-svelte/compare/v0.27.3...v0.27.4) (2022-09-26)
|
|
6
20
|
|
|
7
21
|
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script context="module">import { writable } from 'svelte/store';
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<script>import Frame from '../utils/Frame.svelte';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import { setContext } from 'svelte';
|
|
7
|
+
export let single = true;
|
|
8
|
+
export let flush = false;
|
|
9
|
+
export let activeClasses = 'bg-gray-100 dark:bg-gray-800 text-gray-900 dark:text-white focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800';
|
|
10
|
+
export let inactiveClasses = 'text-gray-500 dark:text-gray-400 hover:bg-gray-100 hover:dark:bg-gray-800';
|
|
11
|
+
export let defaultClass = 'text-gray-500 dark:text-gray-400';
|
|
12
|
+
const ctx = {
|
|
13
|
+
flush,
|
|
14
|
+
activeClasses,
|
|
15
|
+
inactiveClasses,
|
|
16
|
+
selected: single ? writable() : undefined
|
|
17
|
+
};
|
|
18
|
+
setContext('ctx', ctx);
|
|
19
|
+
let frameClass = classNames(defaultClass, 'divide-y divide-gray-200 dark:divide-gray-700', 'border-gray-200 dark:border-gray-700', 'rounded-t-xl', $$props.class);
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<Frame class={frameClass} color="none" border={!flush}>
|
|
23
|
+
<slot />
|
|
24
|
+
</Frame>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import { type Writable } from 'svelte/store';
|
|
3
|
+
export interface AccordionCtxType {
|
|
4
|
+
flush: boolean;
|
|
5
|
+
activeClasses: string;
|
|
6
|
+
inactiveClasses: string;
|
|
7
|
+
selected?: Writable<object>;
|
|
8
|
+
}
|
|
9
|
+
declare const __propDef: {
|
|
10
|
+
props: {
|
|
11
|
+
[x: string]: any;
|
|
12
|
+
single?: boolean | undefined;
|
|
13
|
+
flush?: boolean | undefined;
|
|
14
|
+
activeClasses?: string | undefined;
|
|
15
|
+
inactiveClasses?: string | undefined;
|
|
16
|
+
defaultClass?: string | undefined;
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {
|
|
22
|
+
default: {};
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
export declare type AccordionProps = typeof __propDef.props;
|
|
26
|
+
export declare type AccordionEvents = typeof __propDef.events;
|
|
27
|
+
export declare type AccordionSlots = typeof __propDef.slots;
|
|
28
|
+
export default class Accordion extends SvelteComponentTyped<AccordionProps, AccordionEvents, AccordionSlots> {
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -1,76 +1,42 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script>import ChevronDown from '../utils/ChevronDown.svelte';
|
|
2
|
+
import ChevronUp from '../utils/ChevronUp.svelte';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
import { getContext, onMount } from 'svelte';
|
|
5
|
+
import { writable } from 'svelte/store';
|
|
2
6
|
import { slide } from 'svelte/transition';
|
|
3
|
-
export let
|
|
4
|
-
export let
|
|
5
|
-
export let
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
};
|
|
7
|
+
export let open = false;
|
|
8
|
+
export let activeClasses = undefined;
|
|
9
|
+
export let inactiveClasses = undefined;
|
|
10
|
+
export let defaultClass = 'flex items-center justify-between w-full font-medium text-left group-first:rounded-t-xl';
|
|
11
|
+
const ctx = getContext('ctx') ?? {};
|
|
12
|
+
// single selection
|
|
13
|
+
const self = {};
|
|
14
|
+
const selected = ctx.selected ?? writable();
|
|
15
|
+
onMount(() => {
|
|
16
|
+
if (open)
|
|
17
|
+
$selected = self;
|
|
18
|
+
// this will trigger unsubscribe on destroy
|
|
19
|
+
return selected.subscribe((x) => (open = x === self));
|
|
20
|
+
});
|
|
21
|
+
const handleToggle = (e) => selected.set(open ? {} : self);
|
|
17
22
|
let buttonClass;
|
|
18
|
-
$:
|
|
19
|
-
buttonClass = classBtn + colorClass;
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
buttonClass = classBtn;
|
|
23
|
-
}
|
|
23
|
+
$: buttonClass = classNames(defaultClass, ctx.flush ? 'py-5' : 'p-5', open && (ctx.flush ? 'text-gray-900 dark:text-white' : activeClasses || ctx.activeClasses), !open && (ctx.flush ? 'text-gray-500 dark:text-gray-400' : inactiveClasses || ctx.inactiveClasses), $$props.class);
|
|
24
24
|
</script>
|
|
25
25
|
|
|
26
|
-
<h2 aria-expanded={
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
{#if isOpen}
|
|
36
|
-
{#if $$slots.arrowup}
|
|
37
|
-
<slot name="arrowup" />
|
|
38
|
-
{:else}
|
|
39
|
-
<svg
|
|
40
|
-
data-accordion-icon
|
|
41
|
-
class="w-6 h-6 rotate-180 shrink-0"
|
|
42
|
-
fill="currentColor"
|
|
43
|
-
viewBox="0 0 20 20"
|
|
44
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
45
|
-
><path
|
|
46
|
-
fill-rule="evenodd"
|
|
47
|
-
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
|
|
48
|
-
clip-rule="evenodd"
|
|
49
|
-
/></svg
|
|
50
|
-
>
|
|
51
|
-
{/if}
|
|
52
|
-
{:else if $$slots.arrowdown}
|
|
53
|
-
<slot name="arrowdown" />
|
|
54
|
-
{:else}
|
|
55
|
-
<svg
|
|
56
|
-
data-accordion-icon
|
|
57
|
-
class="w-6 h-6 shrink-0"
|
|
58
|
-
fill="currentColor"
|
|
59
|
-
viewBox="0 0 20 20"
|
|
60
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
61
|
-
><path
|
|
62
|
-
fill-rule="evenodd"
|
|
63
|
-
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
|
|
64
|
-
clip-rule="evenodd"
|
|
65
|
-
/></svg
|
|
66
|
-
>
|
|
67
|
-
{/if}
|
|
68
|
-
</button>
|
|
26
|
+
<h2 aria-expanded={open} class="group">
|
|
27
|
+
<button on:click={handleToggle} type="button" class={buttonClass}>
|
|
28
|
+
<slot name="header" />
|
|
29
|
+
{#if open}
|
|
30
|
+
<slot name="arrowup"><ChevronUp /></slot>
|
|
31
|
+
{:else}
|
|
32
|
+
<slot name="arrowdown"><ChevronDown /></slot>
|
|
33
|
+
{/if}
|
|
34
|
+
</button>
|
|
69
35
|
</h2>
|
|
70
|
-
{#if
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
36
|
+
{#if open}
|
|
37
|
+
<div transition:slide={{ duration: 500 }}>
|
|
38
|
+
<div class={ctx.flush ? 'py-5' : 'p-5'}>
|
|
39
|
+
<slot />
|
|
40
|
+
</div>
|
|
41
|
+
</div>
|
|
76
42
|
{/if}
|
|
@@ -2,13 +2,10 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
color?: boolean | undefined;
|
|
10
|
-
btnClass?: string | undefined;
|
|
11
|
-
colorClass?: string | undefined;
|
|
5
|
+
open?: boolean | undefined;
|
|
6
|
+
activeClasses?: string | undefined;
|
|
7
|
+
inactiveClasses?: string | undefined;
|
|
8
|
+
defaultClass?: string | undefined;
|
|
12
9
|
};
|
|
13
10
|
events: {
|
|
14
11
|
[evt: string]: CustomEvent<any>;
|
|
@@ -17,7 +14,7 @@ declare const __propDef: {
|
|
|
17
14
|
header: {};
|
|
18
15
|
arrowup: {};
|
|
19
16
|
arrowdown: {};
|
|
20
|
-
|
|
17
|
+
default: {};
|
|
21
18
|
};
|
|
22
19
|
};
|
|
23
20
|
export declare type AccordionItemProps = typeof __propDef.props;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script>import { setContext } from 'svelte';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
export let
|
|
4
|
-
|
|
5
|
-
setContext('
|
|
3
|
+
export let size = 'md';
|
|
4
|
+
export let divClass = 'inline-flex rounded-lg shadow-sm';
|
|
5
|
+
setContext('group', { size });
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<div {...$$restProps} class={classNames(divClass, $$props.class)} role="group">
|
|
9
|
-
|
|
9
|
+
<slot />
|
|
10
10
|
</div>
|
package/buttons/Button.svelte
CHANGED
|
@@ -10,7 +10,6 @@ export let btnClass = undefined;
|
|
|
10
10
|
export let type = 'button';
|
|
11
11
|
export let color = group ? (outline ? 'dark' : 'alternative') : 'blue';
|
|
12
12
|
export let shadow = null;
|
|
13
|
-
const background = getContext('background');
|
|
14
13
|
const colorClasses = {
|
|
15
14
|
blue: 'text-white bg-blue-700 hover:bg-blue-800 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800',
|
|
16
15
|
dark: 'text-white bg-gray-800 hover:bg-gray-900 focus:ring-gray-300 dark:bg-gray-800 dark:hover:bg-gray-700 dark:focus:ring-gray-700',
|
|
@@ -80,11 +79,11 @@ $: buttonClass = btnClass
|
|
|
80
79
|
: classNames('text-center font-medium', group ? 'focus:ring-2' : 'focus:ring-4', group && 'focus:z-10', !group || color === 'alternative' || (outline && color === 'dark') || 'focus:outline-none', outline && gradient
|
|
81
80
|
? 'p-0.5'
|
|
82
81
|
: 'inline-flex items-center justify-center ' + sizeClasses[size], gradient ? gradientClasses[color] : outline ? outlineClasses[color] : colorClasses[color], color === 'alternative' &&
|
|
83
|
-
(
|
|
82
|
+
(group
|
|
84
83
|
? 'dark:bg-gray-700 dark:text-white dark:border-gray-700 dark:hover:border-gray-600 dark:hover:bg-gray-600'
|
|
85
84
|
: 'dark:bg-transparent dark:border-gray-800 dark:hover:border-gray-700'), outline &&
|
|
86
85
|
color === 'dark' &&
|
|
87
|
-
(
|
|
86
|
+
(group
|
|
88
87
|
? 'dark:text-white dark:border-white'
|
|
89
88
|
: 'dark:text-gray-400 dark:border-gray-700'), hasBorder() && group && 'border-l-0 first:border-l', rounded(false), shadow && coloredShadowClasses[shadow], $$props.disabled && 'cursor-not-allowed opacity-50', $$props.class);
|
|
90
89
|
let gradientOutlineClass;
|
package/forms/Input.svelte
CHANGED
|
@@ -1,50 +1,80 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script context="module">export function clampSize(s) {
|
|
2
|
+
return s && s === 'xs' ? 'sm' : s === 'xl' ? 'lg' : s;
|
|
3
|
+
}
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<script>import Wrapper from '../utils/Wrapper.svelte';
|
|
7
|
+
import classNames from 'classnames';
|
|
2
8
|
import { getContext } from 'svelte';
|
|
3
9
|
export let type = 'text';
|
|
4
10
|
export let value = '';
|
|
5
|
-
export let size =
|
|
6
|
-
export let
|
|
11
|
+
export let size = undefined;
|
|
12
|
+
export let defaultClass = 'block w-full disabled:cursor-not-allowed disabled:opacity-50';
|
|
7
13
|
export let color = 'base';
|
|
14
|
+
const borderClasses = {
|
|
15
|
+
base: 'border-gray-300 dark:border-gray-600',
|
|
16
|
+
tinted: 'border-gray-300 dark:border-gray-500',
|
|
17
|
+
green: 'border-green-500 dark:border-green-400',
|
|
18
|
+
red: 'border-red-500 dark:border-red-400'
|
|
19
|
+
};
|
|
20
|
+
const ringClasses = {
|
|
21
|
+
base: 'focus:border-blue-500 focus:ring-blue-500 dark:focus:border-blue-500 dark:focus:ring-blue-500',
|
|
22
|
+
green: 'focus:ring-green-500 focus:border-green-500 dark:focus:border-green-500 dark:focus:ring-green-500',
|
|
23
|
+
red: 'focus:ring-red-500 focus:border-red-500 dark:focus:ring-red-500 dark:focus:border-red-500'
|
|
24
|
+
};
|
|
8
25
|
const colorClasses = {
|
|
9
|
-
base: 'bg-gray-50
|
|
10
|
-
|
|
11
|
-
|
|
26
|
+
base: 'bg-gray-50 text-gray-900 dark:bg-gray-700 dark:text-white dark:placeholder-gray-400',
|
|
27
|
+
tinted: 'bg-gray-50 text-gray-900 dark:bg-gray-600 dark:text-white dark:placeholder-gray-400',
|
|
28
|
+
green: 'bg-green-50 text-green-900 placeholder-green-700 dark:bg-gray-700',
|
|
29
|
+
red: 'bg-red-50 text-red-900 placeholder-red-700 dark:bg-gray-700'
|
|
12
30
|
};
|
|
13
31
|
// tinted if put in component having its own background
|
|
14
32
|
let background = getContext('background');
|
|
33
|
+
let group = getContext('group');
|
|
15
34
|
// you need to this to avoid 2-way binding
|
|
16
|
-
const setType = (node) => {
|
|
17
|
-
node.type =
|
|
35
|
+
const setType = (node, _type) => {
|
|
36
|
+
node.type = _type;
|
|
37
|
+
return {
|
|
38
|
+
update(_type) {
|
|
39
|
+
node.type = _type;
|
|
40
|
+
}
|
|
41
|
+
};
|
|
18
42
|
};
|
|
43
|
+
const textSizes = { sm: 'sm:text-xs', md: 'text-sm', lg: 'sm:text-base' };
|
|
44
|
+
const leftPadding = { sm: 'pl-9', md: 'pl-10', lg: 'pl-11' };
|
|
45
|
+
const rightPadding = { sm: 'pr-9', md: 'pr-10', lg: 'pr-11' };
|
|
46
|
+
const inputPadding = { sm: 'p-2', md: 'p-2.5', lg: 'p-4' };
|
|
47
|
+
$: _size = size || clampSize(group?.size) || 'md';
|
|
48
|
+
let inputClass;
|
|
49
|
+
$: {
|
|
50
|
+
const _color = color === 'base' && background ? 'tinted' : color;
|
|
51
|
+
inputClass = classNames(defaultClass, $$slots.left && leftPadding[_size], $$slots.right && rightPadding[_size], ringClasses[color], colorClasses[_color], borderClasses[_color], inputPadding[_size], textSizes[_size], group || 'rounded-lg', group && 'first:rounded-l-lg last:rounded-r-lg', group && 'border-l-0 first:border-l last:border-r', $$props.class);
|
|
52
|
+
}
|
|
53
|
+
let floatClass = 'flex absolute inset-y-0 left-0 items-center pointer-events-none text-gray-500 dark:text-gray-400';
|
|
19
54
|
</script>
|
|
20
55
|
|
|
21
|
-
<
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
'p-2.5 text-sm': size === 'md',
|
|
47
|
-
'sm:text-md p-4': size === 'lg'
|
|
48
|
-
},
|
|
49
|
-
$$props.class
|
|
50
|
-
)} />
|
|
56
|
+
<Wrapper class="relative w-full" show={$$slots.left || $$slots.right}>
|
|
57
|
+
{#if $$slots.left}
|
|
58
|
+
<div class="{floatClass} pl-3"><slot name="left" /></div>
|
|
59
|
+
{/if}
|
|
60
|
+
<input
|
|
61
|
+
{...$$restProps}
|
|
62
|
+
bind:value
|
|
63
|
+
on:blur
|
|
64
|
+
on:change
|
|
65
|
+
on:click
|
|
66
|
+
on:focus
|
|
67
|
+
on:keydown
|
|
68
|
+
on:keypress
|
|
69
|
+
on:keyup
|
|
70
|
+
on:mouseover
|
|
71
|
+
on:mouseenter
|
|
72
|
+
on:mouseleave
|
|
73
|
+
on:paste
|
|
74
|
+
on:input
|
|
75
|
+
use:setType={type}
|
|
76
|
+
class={inputClass} />
|
|
77
|
+
{#if $$slots.right}
|
|
78
|
+
<div class="{floatClass} pr-3"><slot name="right" /></div>
|
|
79
|
+
{/if}
|
|
80
|
+
</Wrapper>
|
package/forms/Input.svelte.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { SizeType, FormSizeType } from '../types';
|
|
3
|
+
export declare function clampSize(s: SizeType): "sm" | "md" | "lg";
|
|
2
4
|
import type { InputType } from '../types';
|
|
3
5
|
declare const __propDef: {
|
|
4
6
|
props: {
|
|
5
7
|
[x: string]: any;
|
|
6
8
|
type?: InputType | undefined;
|
|
7
9
|
value?: string | undefined;
|
|
8
|
-
size?:
|
|
9
|
-
|
|
10
|
+
size?: FormSizeType | undefined;
|
|
11
|
+
defaultClass?: string | undefined;
|
|
10
12
|
color?: "green" | "red" | "base" | undefined;
|
|
11
13
|
};
|
|
12
14
|
events: {
|
|
@@ -25,7 +27,10 @@ declare const __propDef: {
|
|
|
25
27
|
} & {
|
|
26
28
|
[evt: string]: CustomEvent<any>;
|
|
27
29
|
};
|
|
28
|
-
slots: {
|
|
30
|
+
slots: {
|
|
31
|
+
left: {};
|
|
32
|
+
right: {};
|
|
33
|
+
};
|
|
29
34
|
};
|
|
30
35
|
export declare type InputProps = typeof __propDef.props;
|
|
31
36
|
export declare type InputEvents = typeof __propDef.events;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
import { getContext } from 'svelte';
|
|
3
|
+
import { clampSize } from './Input.svelte';
|
|
4
|
+
export let size = undefined;
|
|
5
|
+
// tinted if put in component having its own background
|
|
6
|
+
let background = getContext('background');
|
|
7
|
+
let group = getContext('group');
|
|
8
|
+
const borderClasses = {
|
|
9
|
+
base: 'border-gray-300 dark:border-gray-600',
|
|
10
|
+
tinted: 'border-gray-300 dark:border-gray-500'
|
|
11
|
+
};
|
|
12
|
+
const darkBgClasses = {
|
|
13
|
+
base: 'dark:bg-gray-600 dark:text-gray-400',
|
|
14
|
+
tinted: 'dark:bg-gray-500 dark:text-gray-300'
|
|
15
|
+
};
|
|
16
|
+
const divider = {
|
|
17
|
+
base: 'dark:border-r-gray-700 dark:last:border-r-gray-600',
|
|
18
|
+
tinted: 'dark:border-r-gray-600 dark:last:border-r-gray-500'
|
|
19
|
+
};
|
|
20
|
+
const textSizes = { sm: 'sm:text-xs', md: 'text-sm', lg: 'sm:text-base' };
|
|
21
|
+
const prefixPadding = { sm: 'px-2', md: 'px-3', lg: 'px-4' };
|
|
22
|
+
// size: explicit, inherited, default
|
|
23
|
+
$: _size = size || clampSize(group?.size) || 'md';
|
|
24
|
+
$: divClass = classNames(textSizes[_size], prefixPadding[_size], background ? borderClasses['tinted'] : borderClasses['base'], 'text-gray-500 bg-gray-200', background ? darkBgClasses.tinted : darkBgClasses.base, background ? divider.tinted : divider.base, 'inline-flex items-center border-t border-b first:border-l border-r', 'first:rounded-l-lg last:rounded-r-lg', $$props.class);
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<div {...$$restProps} class={divClass}>
|
|
28
|
+
<slot />
|
|
29
|
+
</div>
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
size?: 'sm' | 'md' | 'lg' | undefined;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {
|
|
11
|
+
default: {};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare type InputAddonProps = typeof __propDef.props;
|
|
15
|
+
export declare type InputAddonEvents = typeof __propDef.events;
|
|
16
|
+
export declare type InputAddonSlots = typeof __propDef.slots;
|
|
17
|
+
export default class InputAddon extends SvelteComponentTyped<InputAddonProps, InputAddonEvents, InputAddonSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
package/forms/Radio.svelte
CHANGED
|
@@ -1,29 +1,16 @@
|
|
|
1
|
-
<script context="module"
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export const labelClass = (inline, extraClass) =>
|
|
16
|
-
classNames(inline ? 'inline-flex' : 'flex', 'items-center', extraClass);
|
|
17
|
-
|
|
18
|
-
export const inputClass = (custom, color, rounded, tinted, extraClass) =>
|
|
19
|
-
classNames(
|
|
20
|
-
'w-4 h-4 bg-gray-100 border-gray-300 dark:ring-offset-gray-800 focus:ring-2 mr-2',
|
|
21
|
-
tinted ? 'dark:bg-gray-600 dark:border-gray-500' : 'dark:bg-gray-700 dark:border-gray-600',
|
|
22
|
-
custom && 'sr-only peer',
|
|
23
|
-
rounded && 'rounded',
|
|
24
|
-
colorClasses[color],
|
|
25
|
-
extraClass
|
|
26
|
-
);
|
|
1
|
+
<script context="module">// this part is shared between Radio and Checkbox
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
const colorClasses = {
|
|
4
|
+
red: 'text-red-600 focus:ring-red-500 dark:focus:ring-red-600',
|
|
5
|
+
green: 'text-green-600 focus:ring-green-500 dark:focus:ring-green-600',
|
|
6
|
+
purple: 'text-purple-600 focus:ring-purple-500 dark:focus:ring-purple-600',
|
|
7
|
+
teal: 'text-teal-600 focus:ring-teal-500 dark:focus:ring-teal-600',
|
|
8
|
+
yellow: 'text-yellow-400 focus:ring-yellow-500 dark:focus:ring-yellow-600',
|
|
9
|
+
orange: 'text-orange-500 focus:ring-orange-500 dark:focus:ring-orange-600',
|
|
10
|
+
blue: 'text-blue-600 focus:ring-blue-500 dark:focus:ring-blue-600'
|
|
11
|
+
};
|
|
12
|
+
export const labelClass = (inline, extraClass) => classNames(inline ? 'inline-flex' : 'flex', 'items-center', extraClass);
|
|
13
|
+
export const inputClass = (custom, color, rounded, tinted, extraClass) => classNames('w-4 h-4 bg-gray-100 border-gray-300 dark:ring-offset-gray-800 focus:ring-2', extraClass === true && 'mr-2', tinted ? 'dark:bg-gray-600 dark:border-gray-500' : 'dark:bg-gray-700 dark:border-gray-600', custom && 'sr-only peer', rounded && 'rounded', colorClasses[color], extraClass);
|
|
27
14
|
</script>
|
|
28
15
|
|
|
29
16
|
<script>import { getContext } from 'svelte';
|
|
@@ -38,21 +25,21 @@ let background = getContext('background');
|
|
|
38
25
|
</script>
|
|
39
26
|
|
|
40
27
|
<Label class={labelClass(inline, $$props.class)} show={$$slots.default}>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
28
|
+
<input
|
|
29
|
+
type="radio"
|
|
30
|
+
bind:group
|
|
31
|
+
on:blur
|
|
32
|
+
on:change
|
|
33
|
+
on:click
|
|
34
|
+
on:focus
|
|
35
|
+
on:keydown
|
|
36
|
+
on:keypress
|
|
37
|
+
on:keyup
|
|
38
|
+
on:mouseenter
|
|
39
|
+
on:mouseleave
|
|
40
|
+
on:mouseover
|
|
41
|
+
on:paste
|
|
42
|
+
{value}
|
|
43
|
+
{...$$restProps}
|
|
44
|
+
class={inputClass(custom, color, false, background, $$slots.default || $$props.class)} /><slot />
|
|
58
45
|
</Label>
|
package/forms/Radio.svelte.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
export declare const labelClass: (inline:
|
|
3
|
-
export declare const inputClass: (custom:
|
|
2
|
+
export declare const labelClass: (inline: boolean, extraClass: string) => string;
|
|
3
|
+
export declare const inputClass: (custom: boolean, color: FormColorType, rounded: boolean, tinted: boolean, extraClass: string | boolean) => string;
|
|
4
4
|
import type { FormColorType } from '../types';
|
|
5
5
|
declare const __propDef: {
|
|
6
6
|
props: {
|
package/forms/Search.svelte
CHANGED
|
@@ -1,46 +1,54 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
export let
|
|
4
|
-
export let btnClass = 'text-white absolute right-2.5 bottom-2.5 bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-4 py-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
1
|
+
<script>import Wrapper from '../utils/Wrapper.svelte';
|
|
2
|
+
import Input from './Input.svelte';
|
|
3
|
+
export let size = 'lg';
|
|
5
4
|
export let placeholder = 'Search';
|
|
5
|
+
const sizes = {
|
|
6
|
+
sm: 'w-3.5 h-3.5',
|
|
7
|
+
md: 'w-5 h-5',
|
|
8
|
+
lg: 'w-6 h-6'
|
|
9
|
+
};
|
|
6
10
|
</script>
|
|
7
11
|
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
12
|
+
<Wrapper class="relative w-full" show={$$slots.default}>
|
|
13
|
+
<Input
|
|
14
|
+
on:blur
|
|
15
|
+
on:change
|
|
16
|
+
on:click
|
|
17
|
+
on:focus
|
|
18
|
+
on:keydown
|
|
19
|
+
on:keypress
|
|
20
|
+
on:keyup
|
|
21
|
+
on:mouseenter
|
|
22
|
+
on:mouseleave
|
|
23
|
+
on:mouseover
|
|
24
|
+
on:paste
|
|
25
|
+
type="search"
|
|
26
|
+
{placeholder}
|
|
27
|
+
{size}
|
|
28
|
+
{...$$restProps}
|
|
29
|
+
class={$$props.class}>
|
|
30
|
+
<svg
|
|
31
|
+
slot="left"
|
|
32
|
+
class={sizes[size]}
|
|
33
|
+
fill="currentColor"
|
|
34
|
+
viewBox="0 0 20 20"
|
|
35
|
+
xmlns="http://www.w3.org/2000/svg">
|
|
36
|
+
<path
|
|
37
|
+
fill-rule="evenodd"
|
|
38
|
+
d="M8 4a4 4 0 100 8 4 4 0 000-8zM2 8a6 6 0 1110.89 3.476l4.817 4.817a1 1 0 01-1.414 1.414l-4.816-4.816A6 6 0 012 8z"
|
|
39
|
+
clip-rule="evenodd" />
|
|
40
|
+
</svg>
|
|
41
|
+
<!-- We can use it here. See below. This will trigger right padding
|
|
42
|
+
<slot slot="right" />
|
|
43
|
+
-->
|
|
44
|
+
</Input>
|
|
45
|
+
<!-- This slot should be within Input as a slot='right'
|
|
46
|
+
Svelete has an issue with forwarded slots and even empty slot here will appear as existing slot in Input.
|
|
47
|
+
Due to that we need the below slot and Wrapper around
|
|
48
|
+
-->
|
|
49
|
+
{#if $$slots.default}
|
|
50
|
+
<div class="flex absolute inset-y-0 right-0 items-center pr-3 text-gray-500 dark:text-gray-400">
|
|
51
|
+
<slot />
|
|
52
|
+
</div>
|
|
53
|
+
{/if}
|
|
54
|
+
</Wrapper>
|
package/forms/Search.svelte.d.ts
CHANGED
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { FormSizeType } from '../types';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
5
|
-
|
|
6
|
-
labelClass?: string | undefined;
|
|
7
|
-
inputClass?: string | undefined;
|
|
8
|
-
btnClass?: string | undefined;
|
|
6
|
+
size?: FormSizeType | undefined;
|
|
9
7
|
placeholder?: string | undefined;
|
|
10
8
|
};
|
|
11
9
|
events: {
|
|
12
|
-
submit: SubmitEvent;
|
|
13
10
|
blur: FocusEvent;
|
|
14
11
|
change: Event;
|
|
15
12
|
click: MouseEvent;
|
|
@@ -24,7 +21,9 @@ declare const __propDef: {
|
|
|
24
21
|
} & {
|
|
25
22
|
[evt: string]: CustomEvent<any>;
|
|
26
23
|
};
|
|
27
|
-
slots: {
|
|
24
|
+
slots: {
|
|
25
|
+
default: {};
|
|
26
|
+
};
|
|
28
27
|
};
|
|
29
28
|
export declare type SearchProps = typeof __propDef.props;
|
|
30
29
|
export declare type SearchEvents = typeof __propDef.events;
|
|
@@ -1,65 +1,20 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
|
|
3
|
-
export let labelClass = 'sr-only';
|
|
4
|
-
export let iconClass = 'w-5 h-5 text-gray-500 dark:text-gray-400';
|
|
5
|
-
export let iconDivClass = 'flex absolute inset-y-0 left-0 items-center pl-3 pointer-events-none';
|
|
6
|
-
export let inputClass = 'bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full pl-10 p-2.5 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500';
|
|
7
|
-
export let btnClass = 'p-2.5 ml-2 text-sm font-medium text-white bg-blue-700 rounded-lg border border-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
8
|
-
export let placeholder = 'Search';
|
|
9
|
-
// tainted if put in component having its own background
|
|
10
|
-
let background = getContext('background');
|
|
1
|
+
<script>import Search from './Search.svelte';
|
|
2
|
+
import Button from '../buttons/Button.svelte';
|
|
11
3
|
</script>
|
|
12
4
|
|
|
13
|
-
<form class="flex
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
</div>
|
|
29
|
-
<input
|
|
30
|
-
on:blur
|
|
31
|
-
on:change
|
|
32
|
-
on:click
|
|
33
|
-
on:focus
|
|
34
|
-
on:keydown
|
|
35
|
-
on:keypress
|
|
36
|
-
on:keyup
|
|
37
|
-
on:mouseenter
|
|
38
|
-
on:mouseleave
|
|
39
|
-
on:mouseover
|
|
40
|
-
on:paste
|
|
41
|
-
{...$$restProps}
|
|
42
|
-
type="text"
|
|
43
|
-
{id}
|
|
44
|
-
class="{background
|
|
45
|
-
? 'dark:bg-gray-600 dark:border-gray-500'
|
|
46
|
-
: ' dark:bg-gray-700 dark:border-gray-600'} {inputClass}"
|
|
47
|
-
{placeholder}
|
|
48
|
-
/>
|
|
49
|
-
</div>
|
|
50
|
-
<button type="submit" class={btnClass}
|
|
51
|
-
><svg
|
|
52
|
-
class="w-5 h-5"
|
|
53
|
-
fill="none"
|
|
54
|
-
stroke="currentColor"
|
|
55
|
-
viewBox="0 0 24 24"
|
|
56
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
57
|
-
><path
|
|
58
|
-
stroke-linecap="round"
|
|
59
|
-
stroke-linejoin="round"
|
|
60
|
-
stroke-width="2"
|
|
61
|
-
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"
|
|
62
|
-
/></svg
|
|
63
|
-
></button
|
|
64
|
-
>
|
|
5
|
+
<form class="flex gap-2" on:submit>
|
|
6
|
+
<Search size="md" {...$$restProps} />
|
|
7
|
+
<Button class="!p-2.5">
|
|
8
|
+
<svg
|
|
9
|
+
class="w-5 h-5"
|
|
10
|
+
fill="none"
|
|
11
|
+
stroke="currentColor"
|
|
12
|
+
viewBox="0 0 24 24"
|
|
13
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
14
|
+
><path
|
|
15
|
+
stroke-linecap="round"
|
|
16
|
+
stroke-linejoin="round"
|
|
17
|
+
stroke-width="2"
|
|
18
|
+
d="M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z" /></svg>
|
|
19
|
+
</Button>
|
|
65
20
|
</form>
|
|
@@ -2,27 +2,9 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
id?: string | undefined;
|
|
6
|
-
labelClass?: string | undefined;
|
|
7
|
-
iconClass?: string | undefined;
|
|
8
|
-
iconDivClass?: string | undefined;
|
|
9
|
-
inputClass?: string | undefined;
|
|
10
|
-
btnClass?: string | undefined;
|
|
11
|
-
placeholder?: string | undefined;
|
|
12
5
|
};
|
|
13
6
|
events: {
|
|
14
7
|
submit: SubmitEvent;
|
|
15
|
-
blur: FocusEvent;
|
|
16
|
-
change: Event;
|
|
17
|
-
click: MouseEvent;
|
|
18
|
-
focus: FocusEvent;
|
|
19
|
-
keydown: KeyboardEvent;
|
|
20
|
-
keypress: KeyboardEvent;
|
|
21
|
-
keyup: KeyboardEvent;
|
|
22
|
-
mouseenter: MouseEvent;
|
|
23
|
-
mouseleave: MouseEvent;
|
|
24
|
-
mouseover: MouseEvent;
|
|
25
|
-
paste: ClipboardEvent;
|
|
26
8
|
} & {
|
|
27
9
|
[evt: string]: CustomEvent<any>;
|
|
28
10
|
};
|
package/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export { default as Accordion } from './accordions/Accordion.svelte';
|
|
1
2
|
export { default as AccordionItem } from './accordions/AccordionItem.svelte';
|
|
2
3
|
export { default as Alert } from './alerts/Alert.svelte';
|
|
3
4
|
export { default as Avatar } from './avatar/Avatar.svelte';
|
|
@@ -29,6 +30,7 @@ export { default as FloatingLabelInput } from './forms/FloatingLabelInput.svelte
|
|
|
29
30
|
export { default as Helper } from './forms/Helper.svelte';
|
|
30
31
|
export { default as Iconinput } from './forms/Iconinput.svelte';
|
|
31
32
|
export { default as Input } from './forms/Input.svelte';
|
|
33
|
+
export { default as InputAddon } from './forms/InputAddon.svelte';
|
|
32
34
|
export { default as Label } from './forms/Label.svelte';
|
|
33
35
|
export { default as RadioInline } from './forms/RadioInline.svelte';
|
|
34
36
|
export { default as Radio } from './forms/Radio.svelte';
|
package/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Accordion
|
|
2
|
+
export { default as Accordion } from './accordions/Accordion.svelte';
|
|
2
3
|
export { default as AccordionItem } from './accordions/AccordionItem.svelte';
|
|
3
4
|
// Alerts
|
|
4
5
|
export { default as Alert } from './alerts/Alert.svelte';
|
|
@@ -44,6 +45,7 @@ export { default as FloatingLabelInput } from './forms/FloatingLabelInput.svelte
|
|
|
44
45
|
export { default as Helper } from './forms/Helper.svelte';
|
|
45
46
|
export { default as Iconinput } from './forms/Iconinput.svelte';
|
|
46
47
|
export { default as Input } from './forms/Input.svelte';
|
|
48
|
+
export { default as InputAddon } from './forms/InputAddon.svelte';
|
|
47
49
|
export { default as Label } from './forms/Label.svelte';
|
|
48
50
|
export { default as RadioInline } from './forms/RadioInline.svelte';
|
|
49
51
|
export { default as Radio } from './forms/Radio.svelte';
|
package/modals/Modal.svelte.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { Size } from '../types';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: {
|
|
5
4
|
[x: string]: any;
|
|
6
5
|
open?: boolean | undefined;
|
|
7
6
|
title?: string | undefined;
|
|
8
|
-
size?:
|
|
7
|
+
size?: any;
|
|
9
8
|
placement?: "top-left" | "top-center" | "top-right" | "center-left" | "center" | "center-right" | "bottom-left" | "bottom-center" | "bottom-right" | undefined;
|
|
10
9
|
autoclose?: boolean | undefined;
|
|
11
10
|
permanent?: boolean | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.27.
|
|
3
|
+
"version": "0.27.5",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -101,6 +101,7 @@
|
|
|
101
101
|
],
|
|
102
102
|
"exports": {
|
|
103
103
|
"./package.json": "./package.json",
|
|
104
|
+
"./accordions/Accordion.svelte": "./accordions/Accordion.svelte",
|
|
104
105
|
"./accordions/AccordionItem.svelte": "./accordions/AccordionItem.svelte",
|
|
105
106
|
"./alerts/Alert.svelte": "./alerts/Alert.svelte",
|
|
106
107
|
"./avatar/Avatar.svelte": "./avatar/Avatar.svelte",
|
|
@@ -139,6 +140,7 @@
|
|
|
139
140
|
"./forms/Helper.svelte": "./forms/Helper.svelte",
|
|
140
141
|
"./forms/Iconinput.svelte": "./forms/Iconinput.svelte",
|
|
141
142
|
"./forms/Input.svelte": "./forms/Input.svelte",
|
|
143
|
+
"./forms/InputAddon.svelte": "./forms/InputAddon.svelte",
|
|
142
144
|
"./forms/Label.svelte": "./forms/Label.svelte",
|
|
143
145
|
"./forms/Radio.svelte": "./forms/Radio.svelte",
|
|
144
146
|
"./forms/RadioInline.svelte": "./forms/RadioInline.svelte",
|
package/toasts/Toast.svelte
CHANGED
|
@@ -4,7 +4,6 @@ import CloseButton from '../utils/CloseButton.svelte';
|
|
|
4
4
|
import { fade } from 'svelte/transition';
|
|
5
5
|
export let color = 'blue';
|
|
6
6
|
export let simple = false;
|
|
7
|
-
// Absolute position
|
|
8
7
|
export let position = 'none'; // default not set
|
|
9
8
|
export let open = true;
|
|
10
9
|
export let divClass = 'w-full max-w-xs p-4';
|
package/types.d.ts
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import type { SvelteComponent } from 'svelte';
|
|
2
|
-
export declare type AccordionIconType = {
|
|
3
|
-
up: typeof SvelteComponent;
|
|
4
|
-
down: typeof SvelteComponent;
|
|
5
|
-
};
|
|
6
2
|
export interface ActivityType {
|
|
7
3
|
title: HTMLElement | string;
|
|
8
4
|
date: Date | string;
|
|
@@ -18,34 +14,9 @@ export interface AuthFieldType {
|
|
|
18
14
|
placeholder?: string;
|
|
19
15
|
}
|
|
20
16
|
export declare type AuthFunctionType = () => Promise<void>;
|
|
21
|
-
export interface AvatarType {
|
|
22
|
-
src?: string;
|
|
23
|
-
alt?: string;
|
|
24
|
-
size?: number;
|
|
25
|
-
border?: boolean;
|
|
26
|
-
round?: boolean;
|
|
27
|
-
header?: string;
|
|
28
|
-
text?: string;
|
|
29
|
-
}
|
|
30
|
-
export interface ButtonGroupType {
|
|
31
|
-
name: string;
|
|
32
|
-
href?: string;
|
|
33
|
-
rel?: string;
|
|
34
|
-
icon?: typeof SvelteComponent;
|
|
35
|
-
iconSize?: number;
|
|
36
|
-
iconClass?: string;
|
|
37
|
-
}
|
|
38
17
|
export declare type ButtonType = 'button' | 'submit' | 'reset';
|
|
39
18
|
export declare type Buttontypes = 'blue' | 'blue-outline' | 'dark' | 'dark-outline' | 'light' | 'green' | 'green-outline' | 'red' | 'red-outline' | 'yellow' | 'yellow-outline' | 'purple' | 'purple-outline';
|
|
40
19
|
export declare type Buttonshadows = 'blue' | 'green' | 'cyan' | 'teal' | 'lime' | 'red' | 'pink' | 'purple';
|
|
41
|
-
export declare type CardButtonType = {
|
|
42
|
-
textSize?: Textsize;
|
|
43
|
-
name: string;
|
|
44
|
-
type?: Buttontypes;
|
|
45
|
-
href?: string;
|
|
46
|
-
rel?: string;
|
|
47
|
-
rounded?: boolean;
|
|
48
|
-
};
|
|
49
20
|
export declare type CarouselIconType = {
|
|
50
21
|
next: typeof SvelteComponent;
|
|
51
22
|
prev: typeof SvelteComponent;
|
|
@@ -72,7 +43,6 @@ export interface drawerTransitionParamTypes {
|
|
|
72
43
|
y?: number;
|
|
73
44
|
}
|
|
74
45
|
export declare type drawerTransitionTypes = 'fade' | 'fly' | 'slide' | 'blur' | 'in:fly' | 'out:fly' | 'in:slide' | 'out:slide' | 'in:fade' | 'out:fade' | 'in:blur' | 'out:blur' | undefined;
|
|
75
|
-
export declare type DropdownColorType = 'blue' | 'blue-outline' | 'dark' | 'dark-outline' | 'light' | 'green' | 'green-outline' | 'red' | 'red-outline' | 'yellow' | 'yellow-outline' | 'purple' | 'purple-outline';
|
|
76
46
|
export interface DropdownType {
|
|
77
47
|
name: string;
|
|
78
48
|
href: string;
|
|
@@ -106,7 +76,7 @@ export declare type ImgType = {
|
|
|
106
76
|
src: string;
|
|
107
77
|
alt?: string;
|
|
108
78
|
};
|
|
109
|
-
export declare type InputType = 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'reset' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
|
79
|
+
export declare type InputType = 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'reset' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | 'search';
|
|
110
80
|
export interface InteractiveTabType {
|
|
111
81
|
name: string;
|
|
112
82
|
id: number;
|
|
@@ -148,7 +118,8 @@ export declare const sm = "sm";
|
|
|
148
118
|
export declare const md = "md";
|
|
149
119
|
export declare const lg = "lg";
|
|
150
120
|
export declare const xl = "xl";
|
|
151
|
-
export declare type
|
|
121
|
+
export declare type SizeType = typeof xs | typeof sm | typeof md | typeof lg | typeof xl;
|
|
122
|
+
export declare type FormSizeType = typeof sm | typeof md | typeof lg;
|
|
152
123
|
export interface PillTabType {
|
|
153
124
|
name: string;
|
|
154
125
|
selected: boolean;
|