flowbite-svelte 0.16.12 → 0.17.0
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 +22 -0
- package/buttongroups/ButtonGroup.svelte +1 -1
- package/buttongroups/ButtonGroupItem.svelte +2 -2
- package/index.d.ts +6 -0
- package/index.js +6 -0
- package/package.json +7 -2
- package/sidebars/Sidebar.svelte +3 -22
- package/sidebars/Sidebar.svelte.d.ts +2 -3
- package/sidebars/SidebarBrand.svelte +10 -0
- package/sidebars/SidebarBrand.svelte.d.ts +21 -0
- package/sidebars/SidebarCta.svelte +15 -0
- package/sidebars/SidebarCta.svelte.d.ts +22 -0
- package/sidebars/SidebarDropdownItem.svelte +8 -0
- package/sidebars/SidebarDropdownItem.svelte.d.ts +18 -0
- package/sidebars/SidebarDropdownWrapper.svelte +41 -0
- package/sidebars/SidebarDropdownWrapper.svelte.d.ts +24 -0
- package/sidebars/SidebarGroup.svelte +11 -0
- package/sidebars/SidebarGroup.svelte.d.ts +21 -0
- package/sidebars/SidebarItem.svelte +19 -27
- package/sidebars/SidebarItem.svelte.d.ts +11 -6
- package/sidebars/SidebarWrapper.svelte +6 -0
- package/sidebars/SidebarWrapper.svelte.d.ts +19 -0
- package/types.d.ts +6 -0
- package/sidebars/SidebarDropdown.svelte +0 -30
- package/sidebars/SidebarDropdown.svelte.d.ts +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
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.17.0](https://github.com/themesberg/flowbite-svelte/compare/v0.16.14...v0.17.0) (2022-06-07)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### ⚠ BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
* read the doc how to use them
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
* add {...39090restProps} to ButtonGroup ([9744917](https://github.com/themesberg/flowbite-svelte/commit/9744917f9a036771e1ec285f43de56502e776a3d))
|
|
15
|
+
* new sidebar structure ([bf35b3e](https://github.com/themesberg/flowbite-svelte/commit/bf35b3e230b9d2f9b27d2e9576c70a3db47bc48c))
|
|
16
|
+
* update Sidebar components ([4f15325](https://github.com/themesberg/flowbite-svelte/commit/4f153257b519d4cbbb405a357e4c6ee7ebe30249))
|
|
17
|
+
|
|
18
|
+
### [0.16.14](https://github.com/themesberg/flowbite-svelte/compare/v0.16.13...v0.16.14) (2022-06-07)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Features
|
|
22
|
+
|
|
23
|
+
* add {...39090restProps} to ButtonGroupItem ([6af6066](https://github.com/themesberg/flowbite-svelte/commit/6af6066928200750036b5f19e2711383f02ccfa3))
|
|
24
|
+
|
|
25
|
+
### [0.16.13](https://github.com/themesberg/flowbite-svelte/compare/v0.16.12...v0.16.13) (2022-06-07)
|
|
26
|
+
|
|
5
27
|
### [0.16.12](https://github.com/themesberg/flowbite-svelte/compare/v0.16.11...v0.16.12) (2022-06-07)
|
|
6
28
|
|
|
7
29
|
|
|
@@ -9,9 +9,9 @@ if (outline) {
|
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
{#if href}
|
|
12
|
-
<a {href} class="{btnClass} {$$props.class}" on:click><slot /></a>
|
|
12
|
+
<a {href} class="{btnClass} {$$props.class}" {...$$restProps} on:click><slot /></a>
|
|
13
13
|
{:else}
|
|
14
|
-
<button {type} class="{btnClass} {$$props.class}" on:click>
|
|
14
|
+
<button {type} class="{btnClass} {$$props.class}" {...$$restProps} on:click>
|
|
15
15
|
<slot />
|
|
16
16
|
</button>
|
|
17
17
|
{/if}
|
package/index.d.ts
CHANGED
|
@@ -67,6 +67,12 @@ export { default as AdvancedRating } from './ratings/AdvancedRating.svelte';
|
|
|
67
67
|
export { default as ScoreRating } from './ratings/ScoreRating.svelte';
|
|
68
68
|
export { default as Sidebar } from './sidebars/Sidebar.svelte';
|
|
69
69
|
export { default as SidebarItem } from './sidebars/SidebarItem.svelte';
|
|
70
|
+
export { default as SidebarBrand } from './sidebars/SidebarBrand.svelte';
|
|
71
|
+
export { default as SidebarCta } from './sidebars/SidebarCta.svelte';
|
|
72
|
+
export { default as SidebarDropdownItem } from './sidebars/SidebarDropdownItem.svelte';
|
|
73
|
+
export { default as SidebarDropdownWrapper } from './sidebars/SidebarDropdownWrapper.svelte';
|
|
74
|
+
export { default as SidebarGroup } from './sidebars/SidebarGroup.svelte';
|
|
75
|
+
export { default as SidebarWrapper } from './sidebars/SidebarWrapper.svelte';
|
|
70
76
|
export { default as Spinner } from './spinners/Spinner.svelte';
|
|
71
77
|
export { default as Table } from './tables/Table.svelte';
|
|
72
78
|
export { default as TableDefaultRow } from './tables/TableDefaultRow.svelte';
|
package/index.js
CHANGED
|
@@ -87,6 +87,12 @@ export { default as ScoreRating } from './ratings/ScoreRating.svelte';
|
|
|
87
87
|
// Sidebar
|
|
88
88
|
export { default as Sidebar } from './sidebars/Sidebar.svelte';
|
|
89
89
|
export { default as SidebarItem } from './sidebars/SidebarItem.svelte';
|
|
90
|
+
export { default as SidebarBrand } from './sidebars/SidebarBrand.svelte';
|
|
91
|
+
export { default as SidebarCta } from './sidebars/SidebarCta.svelte';
|
|
92
|
+
export { default as SidebarDropdownItem } from './sidebars/SidebarDropdownItem.svelte';
|
|
93
|
+
export { default as SidebarDropdownWrapper } from './sidebars/SidebarDropdownWrapper.svelte';
|
|
94
|
+
export { default as SidebarGroup } from './sidebars/SidebarGroup.svelte';
|
|
95
|
+
export { default as SidebarWrapper } from './sidebars/SidebarWrapper.svelte';
|
|
90
96
|
// Spin
|
|
91
97
|
export { default as Spinner } from './spinners/Spinner.svelte';
|
|
92
98
|
// Tables
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -162,8 +162,13 @@
|
|
|
162
162
|
"./ratings/RatingComment.svelte": "./ratings/RatingComment.svelte",
|
|
163
163
|
"./ratings/ScoreRating.svelte": "./ratings/ScoreRating.svelte",
|
|
164
164
|
"./sidebars/Sidebar.svelte": "./sidebars/Sidebar.svelte",
|
|
165
|
-
"./sidebars/
|
|
165
|
+
"./sidebars/SidebarBrand.svelte": "./sidebars/SidebarBrand.svelte",
|
|
166
|
+
"./sidebars/SidebarCta.svelte": "./sidebars/SidebarCta.svelte",
|
|
167
|
+
"./sidebars/SidebarDropdownItem.svelte": "./sidebars/SidebarDropdownItem.svelte",
|
|
168
|
+
"./sidebars/SidebarDropdownWrapper.svelte": "./sidebars/SidebarDropdownWrapper.svelte",
|
|
169
|
+
"./sidebars/SidebarGroup.svelte": "./sidebars/SidebarGroup.svelte",
|
|
166
170
|
"./sidebars/SidebarItem.svelte": "./sidebars/SidebarItem.svelte",
|
|
171
|
+
"./sidebars/SidebarWrapper.svelte": "./sidebars/SidebarWrapper.svelte",
|
|
167
172
|
"./spinners/Spinner.svelte": "./spinners/Spinner.svelte",
|
|
168
173
|
"./tables/Table.svelte": "./tables/Table.svelte",
|
|
169
174
|
"./tables/TableCheckbox.svelte": "./tables/TableCheckbox.svelte",
|
package/sidebars/Sidebar.svelte
CHANGED
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
<script>export let
|
|
2
|
-
export let cta;
|
|
1
|
+
<script>export let asideClass = 'w-64';
|
|
3
2
|
</script>
|
|
4
3
|
|
|
5
|
-
<aside class="
|
|
6
|
-
<
|
|
7
|
-
{#if site}
|
|
8
|
-
<a href={site.href} class="flex items-center pl-2.5 mb-5">
|
|
9
|
-
<img src={site.img} class="h-6 mr-3 sm:h-7" alt={site.name} />
|
|
10
|
-
<span class="self-center text-xl font-semibold whitespace-nowrap dark:text-white">{site.name}</span>
|
|
11
|
-
</a>
|
|
12
|
-
{/if}
|
|
13
|
-
<slot />
|
|
14
|
-
{#if cta}
|
|
15
|
-
<div id="dropdown-cta" class="p-4 mt-6 bg-blue-50 rounded-lg dark:bg-blue-900" role="alert">
|
|
16
|
-
<div class="flex items-center mb-3">
|
|
17
|
-
<span class="bg-orange-100 text-orange-800 text-sm font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-orange-200 dark:text-orange-900">{cta.label}</span>
|
|
18
|
-
</div>
|
|
19
|
-
<p class="mb-3 text-sm text-blue-900 dark:text-blue-400">
|
|
20
|
-
{cta.text}
|
|
21
|
-
</p>
|
|
22
|
-
</div>
|
|
23
|
-
{/if}
|
|
24
|
-
</div>
|
|
4
|
+
<aside class="{asideClass} {$$props.class || ''}" {...$$restProps} aria-label="Sidebar">
|
|
5
|
+
<slot />
|
|
25
6
|
</aside>
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { SiteType, SidebarCtaType } from '../types';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
asideClass?: string;
|
|
7
6
|
};
|
|
8
7
|
events: {
|
|
9
8
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script>export let site;
|
|
2
|
+
export let aClass = 'flex items-center pl-2.5 mb-5';
|
|
3
|
+
export let imgClass = 'h-6 mr-3 sm:h-7';
|
|
4
|
+
export let spanClass = 'self-center text-xl font-semibold whitespace-nowrap dark:text-white';
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<a href={site.href} class="{aClass} {$$props.class || ''}" {...$$restProps}>
|
|
8
|
+
<img src={site.img} class={imgClass} alt={site.name} />
|
|
9
|
+
<span class={spanClass}>{site.name}</span>
|
|
10
|
+
</a>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { SiteType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
site: SiteType;
|
|
7
|
+
aClass?: string;
|
|
8
|
+
imgClass?: string;
|
|
9
|
+
spanClass?: string;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
};
|
|
14
|
+
slots: {};
|
|
15
|
+
};
|
|
16
|
+
export declare type SidebarBrandProps = typeof __propDef.props;
|
|
17
|
+
export declare type SidebarBrandEvents = typeof __propDef.events;
|
|
18
|
+
export declare type SidebarBrandSlots = typeof __propDef.slots;
|
|
19
|
+
export default class SidebarBrand extends SvelteComponentTyped<SidebarBrandProps, SidebarBrandEvents, SidebarBrandSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script>export let divWrapperClass = 'p-4 mt-6 bg-blue-50 rounded-lg dark:bg-blue-900';
|
|
2
|
+
export let divClass = 'flex items-center mb-3';
|
|
3
|
+
export let spanClass = 'bg-orange-100 text-orange-800 text-sm font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-orange-200 dark:text-orange-900';
|
|
4
|
+
export let label = '';
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div id="dropdown-cta" class={divWrapperClass} role="alert">
|
|
8
|
+
<div class={divClass}>
|
|
9
|
+
<span class={spanClass}>{label}</span>
|
|
10
|
+
{#if $$slots.icon}
|
|
11
|
+
<slot name="icon" />
|
|
12
|
+
{/if}
|
|
13
|
+
</div>
|
|
14
|
+
<slot />
|
|
15
|
+
</div>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
divWrapperClass?: string;
|
|
5
|
+
divClass?: string;
|
|
6
|
+
spanClass?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
icon: {};
|
|
14
|
+
default: {};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare type SidebarCtaProps = typeof __propDef.props;
|
|
18
|
+
export declare type SidebarCtaEvents = typeof __propDef.events;
|
|
19
|
+
export declare type SidebarCtaSlots = typeof __propDef.slots;
|
|
20
|
+
export default class SidebarCta extends SvelteComponentTyped<SidebarCtaProps, SidebarCtaEvents, SidebarCtaSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<script>export let aClass = 'flex items-center p-2 pl-11 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';
|
|
2
|
+
export let href = '';
|
|
3
|
+
export let label = '';
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<li>
|
|
7
|
+
<a {href} class={aClass}>{label}</a>
|
|
8
|
+
</li>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
aClass?: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
label?: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {};
|
|
12
|
+
};
|
|
13
|
+
export declare type SidebarDropdownItemProps = typeof __propDef.props;
|
|
14
|
+
export declare type SidebarDropdownItemEvents = typeof __propDef.events;
|
|
15
|
+
export declare type SidebarDropdownItemSlots = typeof __propDef.slots;
|
|
16
|
+
export default class SidebarDropdownItem extends SvelteComponentTyped<SidebarDropdownItemProps, SidebarDropdownItemEvents, SidebarDropdownItemSlots> {
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script>import { slide } from 'svelte/transition';
|
|
2
|
+
import { quintOut } from 'svelte/easing';
|
|
3
|
+
import { ChevronDown } from 'svelte-heros';
|
|
4
|
+
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';
|
|
5
|
+
export let label = '';
|
|
6
|
+
export let spanClass = 'flex-1 ml-3 text-left whitespace-nowrap';
|
|
7
|
+
export let ulClass = 'py-2 space-y-2';
|
|
8
|
+
export let icon;
|
|
9
|
+
let isOpen = false;
|
|
10
|
+
const handleDropdown = () => {
|
|
11
|
+
isOpen = !isOpen;
|
|
12
|
+
};
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<li>
|
|
16
|
+
<button
|
|
17
|
+
on:click={() => handleDropdown()}
|
|
18
|
+
type="button"
|
|
19
|
+
class="{btnClass} {$$props.class || ''}"
|
|
20
|
+
{...$$restProps}
|
|
21
|
+
aria-controls="sidebar-dropdown"
|
|
22
|
+
>
|
|
23
|
+
<svelte:component
|
|
24
|
+
this={icon.name}
|
|
25
|
+
size={icon.size}
|
|
26
|
+
color={icon.color}
|
|
27
|
+
class="mr-2 {icon.class}"
|
|
28
|
+
/>
|
|
29
|
+
<span class={spanClass} sidebar-toggle-item>{label}</span>
|
|
30
|
+
<ChevronDown />
|
|
31
|
+
</button>
|
|
32
|
+
{#if isOpen}
|
|
33
|
+
<ul
|
|
34
|
+
id="dropdown"
|
|
35
|
+
class={ulClass}
|
|
36
|
+
transition:slide={{ delay: 250, duration: 300, easing: quintOut }}
|
|
37
|
+
>
|
|
38
|
+
<slot />
|
|
39
|
+
</ul>
|
|
40
|
+
{/if}
|
|
41
|
+
</li>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { IconType } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
btnClass?: string;
|
|
7
|
+
label?: string;
|
|
8
|
+
spanClass?: string;
|
|
9
|
+
ulClass?: string;
|
|
10
|
+
icon: IconType;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {
|
|
16
|
+
default: {};
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare type SidebarDropdownWrapperProps = typeof __propDef.props;
|
|
20
|
+
export declare type SidebarDropdownWrapperEvents = typeof __propDef.events;
|
|
21
|
+
export declare type SidebarDropdownWrapperSlots = typeof __propDef.slots;
|
|
22
|
+
export default class SidebarDropdownWrapper extends SvelteComponentTyped<SidebarDropdownWrapperProps, SidebarDropdownWrapperEvents, SidebarDropdownWrapperSlots> {
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script>export let ulClass = 'space-y-2';
|
|
2
|
+
export let borderClass = 'pt-4 mt-4 border-t border-gray-200 dark:border-gray-700';
|
|
3
|
+
export let border = false;
|
|
4
|
+
if (border) {
|
|
5
|
+
ulClass += ' ' + borderClass;
|
|
6
|
+
}
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<ul class="{ulClass} {$$props.class || ''}" {...$$restProps}>
|
|
10
|
+
<slot />
|
|
11
|
+
</ul>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
ulClass?: string;
|
|
6
|
+
borderClass?: string;
|
|
7
|
+
border?: boolean;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
default: {};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare type SidebarGroupProps = typeof __propDef.props;
|
|
17
|
+
export declare type SidebarGroupEvents = typeof __propDef.events;
|
|
18
|
+
export declare type SidebarGroupSlots = typeof __propDef.slots;
|
|
19
|
+
export default class SidebarGroup extends SvelteComponentTyped<SidebarGroupProps, SidebarGroupEvents, SidebarGroupSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -1,30 +1,22 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export let
|
|
3
|
-
export let
|
|
4
|
-
export let
|
|
5
|
-
let
|
|
6
|
-
export let
|
|
7
|
-
if (border) {
|
|
8
|
-
ulClass = 'pt-4 mt-4 space-y-2 border-t border-gray-200 dark:border-gray-700';
|
|
9
|
-
}
|
|
1
|
+
<script>export let aClass = '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';
|
|
2
|
+
export let href = '';
|
|
3
|
+
export let rel = '';
|
|
4
|
+
export let label = '';
|
|
5
|
+
export let spanClass = 'ml-3';
|
|
6
|
+
export let icon;
|
|
10
7
|
</script>
|
|
11
8
|
|
|
12
|
-
<
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{#if link.subtext}
|
|
24
|
-
{@html link.subtext}
|
|
25
|
-
{/if}
|
|
26
|
-
</a>
|
|
27
|
-
</li>
|
|
9
|
+
<li>
|
|
10
|
+
<a {href} {rel} class="{aClass} {$$props.class || ''}" {...$$restProps}>
|
|
11
|
+
<svelte:component
|
|
12
|
+
this={icon.name}
|
|
13
|
+
size={icon.size}
|
|
14
|
+
color={icon.color}
|
|
15
|
+
class="mr-2 {icon.class}"
|
|
16
|
+
/>
|
|
17
|
+
<span class={spanClass}>{label}</span>
|
|
18
|
+
{#if $$slots.subtext}
|
|
19
|
+
<slot name="subtext" />
|
|
28
20
|
{/if}
|
|
29
|
-
|
|
30
|
-
</
|
|
21
|
+
</a>
|
|
22
|
+
</li>
|
|
@@ -1,16 +1,21 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { IconType } from '../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
aClass?: string;
|
|
7
|
+
href?: string;
|
|
8
|
+
rel?: string;
|
|
9
|
+
label?: string;
|
|
10
|
+
spanClass?: string;
|
|
11
|
+
icon: IconType;
|
|
9
12
|
};
|
|
10
13
|
events: {
|
|
11
14
|
[evt: string]: CustomEvent<any>;
|
|
12
15
|
};
|
|
13
|
-
slots: {
|
|
16
|
+
slots: {
|
|
17
|
+
subtext: {};
|
|
18
|
+
};
|
|
14
19
|
};
|
|
15
20
|
export declare type SidebarItemProps = typeof __propDef.props;
|
|
16
21
|
export declare type SidebarItemEvents = typeof __propDef.events;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
divClass?: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {
|
|
11
|
+
default: {};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare type SidebarWrapperProps = typeof __propDef.props;
|
|
15
|
+
export declare type SidebarWrapperEvents = typeof __propDef.events;
|
|
16
|
+
export declare type SidebarWrapperSlots = typeof __propDef.slots;
|
|
17
|
+
export default class SidebarWrapper extends SvelteComponentTyped<SidebarWrapperProps, SidebarWrapperEvents, SidebarWrapperSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
package/types.d.ts
CHANGED
|
@@ -78,6 +78,12 @@ export interface GroupTimelineType {
|
|
|
78
78
|
isPrivate?: boolean;
|
|
79
79
|
comment?: string | HTMLElement;
|
|
80
80
|
}
|
|
81
|
+
export interface IconType {
|
|
82
|
+
name: string;
|
|
83
|
+
size?: number;
|
|
84
|
+
color?: Colors;
|
|
85
|
+
class?: string;
|
|
86
|
+
}
|
|
81
87
|
export interface IconTabType {
|
|
82
88
|
name: string;
|
|
83
89
|
active: boolean;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
<script>import { slide } from 'svelte/transition';
|
|
2
|
-
export let link;
|
|
3
|
-
export let childClass = 'flex items-center p-2 pl-11 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';
|
|
4
|
-
export let ulClass = 'py-2 space-y-2';
|
|
5
|
-
let isOpen = false;
|
|
6
|
-
let activeDropdown = undefined;
|
|
7
|
-
const handleDropdown = (id) => {
|
|
8
|
-
isOpen = !isOpen;
|
|
9
|
-
activeDropdown = id;
|
|
10
|
-
};
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<li>
|
|
14
|
-
<button type="button" on:click={() => handleDropdown(link.id)} class="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" aria-controls="dropdown">
|
|
15
|
-
{#if link.icon}
|
|
16
|
-
<svelte:component this={link.icon} class="mr-2 {link.iconClass}" size={link.iconSize} color={link.iconColor} />
|
|
17
|
-
{/if}
|
|
18
|
-
<span class="flex-1 ml-3 text-left whitespace-nowrap" sidebar-toggle-item="">{link.name}</span>
|
|
19
|
-
<svg sidebar-toggle-item="" class="w-6 h-6" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" 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" clip-rule="evenodd" /></svg>
|
|
20
|
-
</button>
|
|
21
|
-
{#if isOpen && link.id == activeDropdown}
|
|
22
|
-
<ul id="dropdown" class={ulClass} transition:slide={{ duration: 500 }}>
|
|
23
|
-
{#each link.children as child}
|
|
24
|
-
<li>
|
|
25
|
-
<a href={child.href} rel={child.rel} class={childClass}>{child.name}</a>
|
|
26
|
-
</li>
|
|
27
|
-
{/each}
|
|
28
|
-
</ul>
|
|
29
|
-
{/if}
|
|
30
|
-
</li>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { SidebarType } from '../types';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
link: SidebarType;
|
|
6
|
-
childClass?: string;
|
|
7
|
-
ulClass?: string;
|
|
8
|
-
};
|
|
9
|
-
events: {
|
|
10
|
-
[evt: string]: CustomEvent<any>;
|
|
11
|
-
};
|
|
12
|
-
slots: {};
|
|
13
|
-
};
|
|
14
|
-
export declare type SidebarDropdownProps = typeof __propDef.props;
|
|
15
|
-
export declare type SidebarDropdownEvents = typeof __propDef.events;
|
|
16
|
-
export declare type SidebarDropdownSlots = typeof __propDef.slots;
|
|
17
|
-
export default class SidebarDropdown extends SvelteComponentTyped<SidebarDropdownProps, SidebarDropdownEvents, SidebarDropdownSlots> {
|
|
18
|
-
}
|
|
19
|
-
export {};
|