flowbite-svelte 0.15.16 → 0.15.19
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 +17 -0
- package/accordions/AccordionItem.svelte +15 -22
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/package.json +3 -6
- package/sidebars/Sidebar.svelte +2 -22
- package/sidebars/Sidebar.svelte.d.ts +4 -3
- package/sidebars/SidebarItem.svelte +28 -0
- package/sidebars/SidebarItem.svelte.d.ts +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
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.15.19](https://github.com/themesberg/flowbite-svelte/compare/v0.15.18...v0.15.19) (2022-05-10)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* add SidebarItem to Sidebar component ([a3a9654](https://github.com/themesberg/flowbite-svelte/commit/a3a965498817449cc90bdb20d9babe4f000e4466))
|
|
11
|
+
|
|
12
|
+
### [0.15.18](https://github.com/themesberg/flowbite-svelte/compare/v0.15.17...v0.15.18) (2022-05-10)
|
|
13
|
+
|
|
14
|
+
### [0.15.17](https://github.com/themesberg/flowbite-svelte/compare/v0.15.16...v0.15.17) (2022-05-09)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* remove svelte-collapse from Accordion component ([7b8a642](https://github.com/themesberg/flowbite-svelte/commit/7b8a642284947c7b8c6bbabecad2ddb2cc1f3d04))
|
|
20
|
+
* update svelte-sidebar-menu to 0.8.4 ([3b07355](https://github.com/themesberg/flowbite-svelte/commit/3b073553c392f4adb47254beb49769d4e150eaa4))
|
|
21
|
+
|
|
5
22
|
### [0.15.16](https://github.com/themesberg/flowbite-svelte/compare/v0.15.15...v0.15.16) (2022-05-09)
|
|
6
23
|
|
|
7
24
|
|
|
@@ -1,37 +1,30 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import collapse from 'svelte-collapse';
|
|
1
|
+
<script>import { slide } from 'svelte/transition';
|
|
3
2
|
import { ChevronDownSolid, ChevronUpSolid } from 'svelte-heros';
|
|
4
3
|
export let id = '';
|
|
5
4
|
export let btnClass = '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';
|
|
6
5
|
export let slotClass = 'p-5 border border-t-0 border-gray-200 dark:border-gray-700';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
};
|
|
13
|
-
const handleToggle = () => {
|
|
14
|
-
if (params.open) {
|
|
15
|
-
store.update((s) => Object.assign(s, { id: null }));
|
|
16
|
-
}
|
|
17
|
-
else {
|
|
18
|
-
store.update((s) => Object.assign(s, { id }));
|
|
19
|
-
}
|
|
6
|
+
let isOpen = false;
|
|
7
|
+
let activeDropdown = undefined;
|
|
8
|
+
const handleToggle = (id) => {
|
|
9
|
+
isOpen = !isOpen;
|
|
10
|
+
activeDropdown = id;
|
|
20
11
|
};
|
|
21
12
|
</script>
|
|
22
13
|
|
|
23
|
-
<h2 aria-expanded={
|
|
24
|
-
<button on:click={handleToggle} type="button" class:rounded-t-xl={id === '1'} class:border-t-0={id !== '1'} class={btnClass}>
|
|
14
|
+
<h2 aria-expanded={isOpen}>
|
|
15
|
+
<button on:click={() => handleToggle(id)} type="button" class:rounded-t-xl={id === '1'} class:border-t-0={id !== '1'} class={btnClass}>
|
|
25
16
|
<span><slot name="header" /></span>
|
|
26
|
-
{#if
|
|
17
|
+
{#if isOpen}
|
|
27
18
|
<ChevronUpSolid />
|
|
28
19
|
{:else}
|
|
29
20
|
<ChevronDownSolid />
|
|
30
21
|
{/if}
|
|
31
22
|
</button>
|
|
32
23
|
</h2>
|
|
33
|
-
|
|
34
|
-
<div
|
|
35
|
-
<
|
|
24
|
+
{#if isOpen}
|
|
25
|
+
<div transition:slide={{ duration: 500 }}>
|
|
26
|
+
<div class={slotClass}>
|
|
27
|
+
<slot name="body" />
|
|
28
|
+
</div>
|
|
36
29
|
</div>
|
|
37
|
-
|
|
30
|
+
{/if}
|
package/index.d.ts
CHANGED
|
@@ -64,6 +64,7 @@ export { default as Rating } from './ratings/Rating.svelte';
|
|
|
64
64
|
export { default as AdvancedRating } from './ratings/AdvancedRating.svelte';
|
|
65
65
|
export { default as ScoreRating } from './ratings/ScoreRating.svelte';
|
|
66
66
|
export { default as Sidebar } from './sidebars/Sidebar.svelte';
|
|
67
|
+
export { default as SidebarItem } from './sidebars/SidebarItem.svelte';
|
|
67
68
|
export { default as Spinner } from './spinners/Spinner.svelte';
|
|
68
69
|
export { default as Table } from './tables/Table.svelte';
|
|
69
70
|
export { default as TableDefaultRow } from './tables/TableDefaultRow.svelte';
|
package/index.js
CHANGED
|
@@ -84,6 +84,7 @@ export { default as AdvancedRating } from './ratings/AdvancedRating.svelte';
|
|
|
84
84
|
export { default as ScoreRating } from './ratings/ScoreRating.svelte';
|
|
85
85
|
// Sidebar
|
|
86
86
|
export { default as Sidebar } from './sidebars/Sidebar.svelte';
|
|
87
|
+
export { default as SidebarItem } from './sidebars/SidebarItem.svelte';
|
|
87
88
|
// Spin
|
|
88
89
|
export { default as Spinner } from './spinners/Spinner.svelte';
|
|
89
90
|
// Tables
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.19",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "./package/index.js",
|
|
6
6
|
"author": {
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
"homepage": "https://flowbite-svelte.com/",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@codewithshin/svelte-utterances": "^0.2.2",
|
|
16
15
|
"@playwright/test": "^1.21.0",
|
|
17
16
|
"@sveltejs/adapter-auto": "next",
|
|
18
17
|
"@sveltejs/kit": "next",
|
|
@@ -31,10 +30,8 @@
|
|
|
31
30
|
"prism-themes": "^1.9.0",
|
|
32
31
|
"svelte": "^3.47.0",
|
|
33
32
|
"svelte-check": "^2.2.6",
|
|
34
|
-
"svelte-feathers": "^0.1.15",
|
|
35
33
|
"svelte-preprocess": "^4.10.5",
|
|
36
|
-
"svelte-sidebar-menu": "^0.
|
|
37
|
-
"svelte-simples": "^0.3.1",
|
|
34
|
+
"svelte-sidebar-menu": "^0.8.4",
|
|
38
35
|
"svelte2tsx": "^0.5.9",
|
|
39
36
|
"tailwindcss": "^3.0.23",
|
|
40
37
|
"tslib": "^2.3.1",
|
|
@@ -79,7 +76,6 @@
|
|
|
79
76
|
},
|
|
80
77
|
"dependencies": {
|
|
81
78
|
"flowbite": "^1.4.2",
|
|
82
|
-
"svelte-collapse": "^0.0.4",
|
|
83
79
|
"svelte-heros": "^2.0.0"
|
|
84
80
|
},
|
|
85
81
|
"exports": {
|
|
@@ -160,6 +156,7 @@
|
|
|
160
156
|
"./ratings/ScoreRating.svelte": "./ratings/ScoreRating.svelte",
|
|
161
157
|
"./sidebars/Sidebar.svelte": "./sidebars/Sidebar.svelte",
|
|
162
158
|
"./sidebars/SidebarDropdown.svelte": "./sidebars/SidebarDropdown.svelte",
|
|
159
|
+
"./sidebars/SidebarItem.svelte": "./sidebars/SidebarItem.svelte",
|
|
163
160
|
"./spinners/Spinner.svelte": "./spinners/Spinner.svelte",
|
|
164
161
|
"./tables/Table.svelte": "./tables/Table.svelte",
|
|
165
162
|
"./tables/TableCheckbox.svelte": "./tables/TableCheckbox.svelte",
|
package/sidebars/Sidebar.svelte
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export let site;
|
|
3
|
-
export let links;
|
|
1
|
+
<script>export let site;
|
|
4
2
|
export let cta;
|
|
5
3
|
</script>
|
|
6
4
|
|
|
@@ -12,25 +10,7 @@ export let cta;
|
|
|
12
10
|
<span class="self-center text-xl font-semibold whitespace-nowrap dark:text-white">{site.name}</span>
|
|
13
11
|
</a>
|
|
14
12
|
{/if}
|
|
15
|
-
<
|
|
16
|
-
{#each links as link (link.id)}
|
|
17
|
-
{#if link.children}
|
|
18
|
-
<SidebarDropdown {link} />
|
|
19
|
-
{:else}
|
|
20
|
-
<li>
|
|
21
|
-
<a href={link.href} rel={link.rel} class="flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700">
|
|
22
|
-
{#if link.icon}
|
|
23
|
-
<svelte:component this={link.icon} size={link.iconSize} color={link.iconColor} class="mr-2 {link.iconClass}" />
|
|
24
|
-
{/if}
|
|
25
|
-
<span class="ml-3">{link.name}</span>
|
|
26
|
-
{#if link.subtext}
|
|
27
|
-
{@html link.subtext}
|
|
28
|
-
{/if}
|
|
29
|
-
</a>
|
|
30
|
-
</li>
|
|
31
|
-
{/if}
|
|
32
|
-
{/each}
|
|
33
|
-
</ul>
|
|
13
|
+
<slot />
|
|
34
14
|
{#if cta}
|
|
35
15
|
<div id="dropdown-cta" class="p-4 mt-6 bg-blue-50 rounded-lg dark:bg-blue-900" role="alert">
|
|
36
16
|
<div class="flex items-center mb-3">
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { SiteType,
|
|
2
|
+
import type { SiteType, SidebarCtaType } from '../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
site: SiteType;
|
|
6
|
-
links: SidebarType[];
|
|
7
6
|
cta: SidebarCtaType;
|
|
8
7
|
};
|
|
9
8
|
events: {
|
|
10
9
|
[evt: string]: CustomEvent<any>;
|
|
11
10
|
};
|
|
12
|
-
slots: {
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
13
14
|
};
|
|
14
15
|
export declare type SidebarProps = typeof __propDef.props;
|
|
15
16
|
export declare type SidebarEvents = typeof __propDef.events;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script>import SidebarDropdown from './SidebarDropdown.svelte';
|
|
2
|
+
export let links;
|
|
3
|
+
let ulClass = 'space-y-2';
|
|
4
|
+
export let border = false;
|
|
5
|
+
if (border) {
|
|
6
|
+
ulClass = 'pt-4 mt-4 space-y-2 border-t border-gray-200 dark:border-gray-700';
|
|
7
|
+
}
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<ul class={ulClass}>
|
|
11
|
+
{#each links as link (link.id)}
|
|
12
|
+
{#if link.children}
|
|
13
|
+
<SidebarDropdown {link} />
|
|
14
|
+
{:else}
|
|
15
|
+
<li>
|
|
16
|
+
<a href={link.href} rel={link.rel} class="flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700">
|
|
17
|
+
{#if link.icon}
|
|
18
|
+
<svelte:component this={link.icon} size={link.iconSize} color={link.iconColor} class="mr-2 {link.iconClass}" />
|
|
19
|
+
{/if}
|
|
20
|
+
<span class="ml-3">{link.name}</span>
|
|
21
|
+
{#if link.subtext}
|
|
22
|
+
{@html link.subtext}
|
|
23
|
+
{/if}
|
|
24
|
+
</a>
|
|
25
|
+
</li>
|
|
26
|
+
{/if}
|
|
27
|
+
{/each}
|
|
28
|
+
</ul>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { SidebarType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
links: SidebarType[];
|
|
6
|
+
border?: boolean;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export declare type SidebarItemProps = typeof __propDef.props;
|
|
14
|
+
export declare type SidebarItemEvents = typeof __propDef.events;
|
|
15
|
+
export declare type SidebarItemSlots = typeof __propDef.slots;
|
|
16
|
+
export default class SidebarItem extends SvelteComponentTyped<SidebarItemProps, SidebarItemEvents, SidebarItemSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|