flowbite-svelte 0.30.3 → 0.30.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/dist/list-group/Listgroup.svelte.d.ts +1 -1
- package/dist/list-group/ListgroupItem.svelte +0 -4
- package/dist/list-group/ListgroupItem.svelte.d.ts +1 -1
- package/dist/sidebars/SidebarDropdownWrapper.svelte +19 -4
- package/dist/sidebars/SidebarDropdownWrapper.svelte.d.ts +3 -0
- package/package.json +2 -1
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
<script>import { getContext } from 'svelte';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
import { createEventDispatcher } from 'svelte';
|
|
4
3
|
export let active = getContext('active');
|
|
5
4
|
export let current = false;
|
|
6
5
|
export let disabled = false;
|
|
7
6
|
export let href = '';
|
|
8
|
-
let dispatch = createEventDispatcher();
|
|
9
7
|
const states = {
|
|
10
8
|
current: 'text-white bg-blue-700 dark:text-white dark:bg-gray-800',
|
|
11
9
|
normal: '',
|
|
@@ -27,7 +25,6 @@ $: itemClass = classNames('py-2 px-4 w-full text-sm font-medium', 'first:rounded
|
|
|
27
25
|
<a
|
|
28
26
|
{href}
|
|
29
27
|
class="block {itemClass}"
|
|
30
|
-
on:click={() => dispatch('click', $$props)}
|
|
31
28
|
aria-current={current}
|
|
32
29
|
on:blur
|
|
33
30
|
on:change
|
|
@@ -46,7 +43,6 @@ $: itemClass = classNames('py-2 px-4 w-full text-sm font-medium', 'first:rounded
|
|
|
46
43
|
type="button"
|
|
47
44
|
class="inline-flex relative items-center text-left {itemClass}"
|
|
48
45
|
{disabled}
|
|
49
|
-
on:click={() => dispatch('click', $$props)}
|
|
50
46
|
on:blur
|
|
51
47
|
on:change
|
|
52
48
|
on:click
|
|
@@ -1,12 +1,27 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
import { slide } from 'svelte/transition';
|
|
3
|
-
import { quintOut } from 'svelte/easing';
|
|
2
|
+
import { fade, blur, fly, slide } from 'svelte/transition';
|
|
3
|
+
// import { quintOut } from 'svelte/easing';
|
|
4
4
|
import ChevronDown from '../utils/ChevronDown.svelte';
|
|
5
5
|
import ChevronUp from '../utils/ChevronUp.svelte';
|
|
6
6
|
export let btnClass = 'flex items-center p-2 w-full text-base font-normal text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700';
|
|
7
7
|
export let label = '';
|
|
8
8
|
export let spanClass = 'flex-1 ml-3 text-left whitespace-nowrap';
|
|
9
9
|
export let ulClass = 'py-2 space-y-2';
|
|
10
|
+
export let transitionType = 'slide';
|
|
11
|
+
export let transitionParams = {};
|
|
12
|
+
// make a custom transition function that returns the desired transition
|
|
13
|
+
const multiple = (node, params) => {
|
|
14
|
+
switch (transitionType) {
|
|
15
|
+
case 'blur':
|
|
16
|
+
return blur(node, params);
|
|
17
|
+
case 'fly':
|
|
18
|
+
return fly(node, params);
|
|
19
|
+
case 'fade':
|
|
20
|
+
return fade(node, params);
|
|
21
|
+
default:
|
|
22
|
+
return slide(node, params);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
10
25
|
export let isOpen = false;
|
|
11
26
|
const handleDropdown = () => {
|
|
12
27
|
isOpen = !isOpen;
|
|
@@ -21,7 +36,7 @@ const handleDropdown = () => {
|
|
|
21
36
|
class={classNames(btnClass, $$props.class)}
|
|
22
37
|
aria-controls="sidebar-dropdown">
|
|
23
38
|
<slot name="icon" />
|
|
24
|
-
<span class={spanClass}
|
|
39
|
+
<span class={spanClass}>{label}</span>
|
|
25
40
|
{#if isOpen}
|
|
26
41
|
{#if $$slots.arrowup}
|
|
27
42
|
<slot name="arrowup" />
|
|
@@ -38,7 +53,7 @@ const handleDropdown = () => {
|
|
|
38
53
|
<ul
|
|
39
54
|
id="dropdown"
|
|
40
55
|
class={ulClass}
|
|
41
|
-
transition:
|
|
56
|
+
transition:multiple|local={transitionParams}>
|
|
42
57
|
<slot />
|
|
43
58
|
</ul>
|
|
44
59
|
{/if}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { TransitionTypes, TransitionParamTypes } from '../types';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
@@ -6,6 +7,8 @@ declare const __propDef: {
|
|
|
6
7
|
label?: string | undefined;
|
|
7
8
|
spanClass?: string | undefined;
|
|
8
9
|
ulClass?: string | undefined;
|
|
10
|
+
transitionType?: TransitionTypes | undefined;
|
|
11
|
+
transitionParams?: TransitionParamTypes | undefined;
|
|
9
12
|
isOpen?: boolean | undefined;
|
|
10
13
|
};
|
|
11
14
|
events: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.30.
|
|
3
|
+
"version": "0.30.5",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Shinichi Okada",
|
|
@@ -126,6 +126,7 @@
|
|
|
126
126
|
"dist"
|
|
127
127
|
],
|
|
128
128
|
"svelte": "./dist/index.js",
|
|
129
|
+
"types": "./dist/index.d.ts",
|
|
129
130
|
"contributors": [
|
|
130
131
|
"Zoltán Szőgyényi <zoltan@themesberg.com>",
|
|
131
132
|
"Robert Tanislav <robert@themesberg.com>",
|