flowbite-svelte 0.30.4 → 0.30.6
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/navbar/NavLi.svelte +5 -3
- package/dist/navbar/NavUl.svelte +7 -0
- package/dist/navbar/NavUl.svelte.d.ts +6 -0
- package/dist/sidebars/SidebarDropdownWrapper.svelte +19 -4
- package/dist/sidebars/SidebarDropdownWrapper.svelte.d.ts +3 -0
- package/package.json +43 -5
|
@@ -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
|
package/dist/navbar/NavLi.svelte
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
+
import { getContext } from 'svelte';
|
|
2
3
|
export let href = '';
|
|
3
4
|
export let active = false;
|
|
4
|
-
export let activeClass =
|
|
5
|
-
export let nonActiveClass =
|
|
5
|
+
export let activeClass = undefined;
|
|
6
|
+
export let nonActiveClass = undefined;
|
|
7
|
+
const context = getContext('navbar');
|
|
6
8
|
let liClass;
|
|
7
|
-
$: liClass = classNames('block py-2 pr-4 pl-3 md:p-0 rounded md:border-0', active ? activeClass : nonActiveClass, $$props.class);
|
|
9
|
+
$: liClass = classNames('block py-2 pr-4 pl-3 md:p-0 rounded md:border-0', active ? activeClass ?? context.activeClass : nonActiveClass ?? context.nonActiveClass, $$props.class);
|
|
8
10
|
</script>
|
|
9
11
|
|
|
10
12
|
<li>
|
package/dist/navbar/NavUl.svelte
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
<script context="module">export {};
|
|
2
|
+
</script>
|
|
3
|
+
|
|
1
4
|
<script>import classNames from 'classnames';
|
|
2
5
|
import { slide } from 'svelte/transition';
|
|
3
6
|
import { quintOut } from 'svelte/easing';
|
|
4
7
|
import Frame from '../utils/Frame.svelte';
|
|
8
|
+
import { setContext } from 'svelte';
|
|
5
9
|
export let divClass = 'w-full md:block md:w-auto';
|
|
6
10
|
export let ulClass = 'flex flex-col p-4 mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium';
|
|
7
11
|
export let hidden = true;
|
|
8
12
|
export let slideParams = { delay: 250, duration: 500, easing: quintOut };
|
|
13
|
+
export let activeClass = 'text-white bg-blue-700 md:bg-transparent md:text-blue-700 md:dark:text-white dark:bg-blue-600 md:dark:bg-transparent';
|
|
14
|
+
export let nonActiveClass = 'text-gray-700 hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 dark:text-gray-400 md:dark:hover:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent';
|
|
15
|
+
setContext('navbar', { activeClass, nonActiveClass });
|
|
9
16
|
let _divClass;
|
|
10
17
|
$: _divClass = classNames(divClass, $$props.class);
|
|
11
18
|
let _ulClass;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
export type NavbarLiType = {
|
|
3
|
+
activeClass: string;
|
|
4
|
+
nonActiveClass: string;
|
|
5
|
+
};
|
|
2
6
|
import { type SlideParams } from 'svelte/transition';
|
|
3
7
|
declare const __propDef: {
|
|
4
8
|
props: {
|
|
@@ -7,6 +11,8 @@ declare const __propDef: {
|
|
|
7
11
|
ulClass?: string | undefined;
|
|
8
12
|
hidden?: boolean | undefined;
|
|
9
13
|
slideParams?: SlideParams | undefined;
|
|
14
|
+
activeClass?: string | undefined;
|
|
15
|
+
nonActiveClass?: string | undefined;
|
|
10
16
|
};
|
|
11
17
|
events: {
|
|
12
18
|
[evt: string]: CustomEvent<any>;
|
|
@@ -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.6",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Shinichi Okada",
|
|
@@ -128,10 +128,48 @@
|
|
|
128
128
|
"svelte": "./dist/index.js",
|
|
129
129
|
"types": "./dist/index.d.ts",
|
|
130
130
|
"contributors": [
|
|
131
|
-
"Zoltán Szőgyényi <zoltan@themesberg.com>",
|
|
132
|
-
"Robert Tanislav <robert@themesberg.com>",
|
|
133
|
-
"Victor Cordos <victor@themesberg.com>",
|
|
134
131
|
"Shinichi Okada <okada.shin@gmail.com>",
|
|
135
|
-
"Jakub Jagielka <jjagielka@gmail.com>"
|
|
132
|
+
"Jakub Jagielka <jjagielka@gmail.com>",
|
|
133
|
+
"olivier <orefalo@gmail.com>",
|
|
134
|
+
"Junjae Lee <ejj612o@gmail.com>",
|
|
135
|
+
"Zhi Nie <ryanzhinie@gmail.com>",
|
|
136
|
+
"edde746 <86283021+edde746@users.noreply.github.com>",
|
|
137
|
+
"Christoph Sturm <me@christophsturm.com>",
|
|
138
|
+
"Frail Bongat <frail.bongat@gmail.com>",
|
|
139
|
+
"Hetarth Shah <80420115+Hetarth02@users.noreply.github.com>",
|
|
140
|
+
"Roger Lucas <rogeriolucas@gmail.com>",
|
|
141
|
+
"Alessio Gravili <70709113+AlessioGr@users.noreply.github.com>",
|
|
142
|
+
"Gus Hogg-Blake <gus@gushogg-blake.com>",
|
|
143
|
+
"Shuang Wu <seanwu1105@gmail.com>",
|
|
144
|
+
"mikerowe81 <mikerowe81@gmail.com>",
|
|
145
|
+
"Garrett Suhm <garrett@bigroadadventure.com>",
|
|
146
|
+
"Oliver Weber <ow@uix.io>",
|
|
147
|
+
"Olivier Refalo <orefalo@gmail.com>",
|
|
148
|
+
"Yassine Zeriouh <y@zeriouh.io>",
|
|
149
|
+
"Zoltán Szőgyényi <zoltan.szogyenyi@gmail.com>",
|
|
150
|
+
"nobody0 <nobodyrrd@gmail.com>",
|
|
151
|
+
"Alex Miller <codex.nz@gmail.com>",
|
|
152
|
+
"Bernhard Richter <bernhard.richter@gmail.com>",
|
|
153
|
+
"ByteDream <63594396+ByteDream@users.noreply.github.com>",
|
|
154
|
+
"CBB <38453357+CrystalBallBe@users.noreply.github.com>",
|
|
155
|
+
"Carsten Lebek <59960385+carstenlebek@users.noreply.github.com>",
|
|
156
|
+
"Daniel Hughes <2237515+dan-hughes@users.noreply.github.com>",
|
|
157
|
+
"Feynman Liang <feynmanliang@users.noreply.github.com>",
|
|
158
|
+
"Hetarth Shah <hetarth02@gmail.com>",
|
|
159
|
+
"Hirtol <55356909+Hirtol@users.noreply.github.com>",
|
|
160
|
+
"James Scott-Brown <james@jamesscottbrown.com>",
|
|
161
|
+
"Maarten <90111831+mjoosten42@users.noreply.github.com>",
|
|
162
|
+
"Michael Adams <mtadams42@gmail.com>",
|
|
163
|
+
"Mr. Mendez <56850299+JustMrMendez@users.noreply.github.com>",
|
|
164
|
+
"Navtoj Chahal <github@navtoj.com>",
|
|
165
|
+
"Niklas Haug <54448642+niklashaug@users.noreply.github.com>",
|
|
166
|
+
"Pevey <7490308+pevey@users.noreply.github.com>",
|
|
167
|
+
"Pierre <pierre-H@users.noreply.github.com>",
|
|
168
|
+
"Sumanth Chinthagunta <xmlking@gmail.com>",
|
|
169
|
+
"Thomas <51747351+andocodes@users.noreply.github.com>",
|
|
170
|
+
"Tyler Miller <tyler.rw.miller@protonmail.com>",
|
|
171
|
+
"Zoltán Szőgyényi <zoltan@themesberg.com>",
|
|
172
|
+
"ciril.tr <ciroman@gmail.com>",
|
|
173
|
+
"jakobsturm <jakob@sturm.li>"
|
|
136
174
|
]
|
|
137
175
|
}
|