flowbite-svelte 0.15.33 → 0.15.36
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 +24 -0
- package/accordions/AccordionItem.svelte +0 -6
- package/forms/Checkbox.svelte +7 -6
- package/forms/Checkbox.svelte.d.ts +5 -4
- package/forms/Toggle.svelte +4 -4
- package/forms/Toggle.svelte.d.ts +2 -2
- package/package.json +1 -1
- package/sidebars/SidebarDropdown.svelte +4 -2
- package/sidebars/SidebarDropdown.svelte.d.ts +2 -0
- package/sidebars/SidebarItem.svelte +3 -1
- package/sidebars/SidebarItem.svelte.d.ts +2 -0
- package/types.d.ts +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
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.36](https://github.com/themesberg/flowbite-svelte/compare/v0.15.35...v0.15.36) (2022-05-17)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* add '' to string types ([387363a](https://github.com/themesberg/flowbite-svelte/commit/387363a3b3668dc66a7790331927e1c1641e4de6))
|
|
11
|
+
* add bind:checked to Checkbox ([7cfcf67](https://github.com/themesberg/flowbite-svelte/commit/7cfcf67b52a1496f57f8ef31b4205464f9eb82a0))
|
|
12
|
+
* add bind:checked to Toggle ([18a34ea](https://github.com/themesberg/flowbite-svelte/commit/18a34eaaf65539bf176da642b4a04f644265f647))
|
|
13
|
+
* remove radio, search etc from InputType ([ed95418](https://github.com/themesberg/flowbite-svelte/commit/ed9541808da054b383c6addff55907d955dad32f))
|
|
14
|
+
|
|
15
|
+
### [0.15.35](https://github.com/themesberg/flowbite-svelte/compare/v0.15.34...v0.15.35) (2022-05-15)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* add ulClass and childClass in SidebarItem's SidebarDropdown ([2e0f46b](https://github.com/themesberg/flowbite-svelte/commit/2e0f46b6c65037e4a40bba688936af99839bd863))
|
|
21
|
+
|
|
22
|
+
### [0.15.34](https://github.com/themesberg/flowbite-svelte/compare/v0.15.33...v0.15.34) (2022-05-15)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* add childClass and ulClass to SidebarDropdown ([8754489](https://github.com/themesberg/flowbite-svelte/commit/875448911cbf0e427f51a08b51d5f160974b159b))
|
|
28
|
+
|
|
5
29
|
### [0.15.33](https://github.com/themesberg/flowbite-svelte/compare/v0.15.32...v0.15.33) (2022-05-15)
|
|
6
30
|
|
|
7
31
|
|
|
@@ -6,16 +6,10 @@ export let btnClass = 'flex items-center focus:ring-4 focus:ring-gray-200 dark:f
|
|
|
6
6
|
export let slotClass = 'p-5 border border-t-0 border-gray-200 dark:border-gray-700';
|
|
7
7
|
export let isOpen = false;
|
|
8
8
|
export let color = false;
|
|
9
|
-
// export let flush: boolean = false;
|
|
10
9
|
export let icons = {
|
|
11
10
|
up: ChevronUpSolid,
|
|
12
11
|
down: ChevronDownSolid
|
|
13
12
|
};
|
|
14
|
-
// if (flush) {
|
|
15
|
-
// btnClass = 'flex justify-between items-center py-5 w-full font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400';
|
|
16
|
-
// slotClass = 'py-5 border-b border-gray-200 dark:border-gray-700';
|
|
17
|
-
// }
|
|
18
|
-
// $: console.log('isOpen', isOpen);
|
|
19
13
|
onMount(() => {
|
|
20
14
|
if (isOpen) {
|
|
21
15
|
isOpen = true;
|
package/forms/Checkbox.svelte
CHANGED
|
@@ -31,16 +31,17 @@ else if (color === 'orange') {
|
|
|
31
31
|
else {
|
|
32
32
|
inputClass += 'text-blue-600 focus:ring-blue-500 dark:focus:ring-blue-600';
|
|
33
33
|
}
|
|
34
|
-
export let helper;
|
|
35
|
-
export let id;
|
|
36
|
-
export let value;
|
|
37
|
-
export let label;
|
|
34
|
+
export let helper = '';
|
|
35
|
+
export let id = '';
|
|
36
|
+
export let value = '';
|
|
37
|
+
export let label = '';
|
|
38
|
+
export let checked = false;
|
|
38
39
|
</script>
|
|
39
40
|
|
|
40
41
|
{#if helper}
|
|
41
42
|
<div class="flex">
|
|
42
43
|
<div class={divHelperClass}>
|
|
43
|
-
<input {id} type="checkbox" {name} {value} class={inputClass} aria-labelledby={id} aria-describedby={id} {disabled} {...$$restProps} />
|
|
44
|
+
<input {id} type="checkbox" bind:checked {name} {value} class={inputClass} aria-labelledby={id} aria-describedby={id} {disabled} {...$$restProps} />
|
|
44
45
|
</div>
|
|
45
46
|
<div class="ml-2 text-sm">
|
|
46
47
|
<label for={id} class={labelHelperClass}>
|
|
@@ -51,7 +52,7 @@ export let label;
|
|
|
51
52
|
</div>
|
|
52
53
|
{:else}
|
|
53
54
|
<div class={divClass}>
|
|
54
|
-
<input {id} type="checkbox" {name} {value} class={inputClass} aria-labelledby={id} aria-describedby={id} {disabled} {...$$restProps} />
|
|
55
|
+
<input {id} type="checkbox" bind:checked {name} {value} class={inputClass} aria-labelledby={id} aria-describedby={id} {disabled} {...$$restProps} />
|
|
55
56
|
<label for={id} class={labelClass}>
|
|
56
57
|
{@html label}
|
|
57
58
|
</label>
|
|
@@ -12,10 +12,11 @@ declare const __propDef: {
|
|
|
12
12
|
labelHelperClass?: string;
|
|
13
13
|
helperClass?: string;
|
|
14
14
|
color?: FormColorType;
|
|
15
|
-
helper
|
|
16
|
-
id
|
|
17
|
-
value
|
|
18
|
-
label
|
|
15
|
+
helper?: string;
|
|
16
|
+
id?: string;
|
|
17
|
+
value?: string;
|
|
18
|
+
label?: string;
|
|
19
|
+
checked?: boolean;
|
|
19
20
|
};
|
|
20
21
|
events: {
|
|
21
22
|
[evt: string]: CustomEvent<any>;
|
package/forms/Toggle.svelte
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script>import generateId from '../utils/generateId.js';
|
|
2
2
|
export let name = 'toggle-example';
|
|
3
|
-
export let color;
|
|
3
|
+
export let color = 'blue';
|
|
4
4
|
export let size = 'default';
|
|
5
5
|
export let id = generateId();
|
|
6
6
|
export let label = 'Toggle me';
|
|
7
|
-
export let value;
|
|
7
|
+
export let value = '';
|
|
8
8
|
export let checked = false;
|
|
9
9
|
export let disabled = false;
|
|
10
10
|
export let labelClass = 'relative inline-flex items-center cursor-pointer';
|
|
11
|
-
export let divClass =
|
|
11
|
+
export let divClass = "w-11 h-6 bg-gray-200 rounded-full peer peer-focus:ring-4 peer-focus:ring-blue-300 dark:peer-focus:ring-blue-800 dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-0.5 after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-blue-600";
|
|
12
12
|
export let inputClass = 'sr-only';
|
|
13
13
|
if (color || size) {
|
|
14
14
|
inputClass += ' peer';
|
|
@@ -41,7 +41,7 @@ else if (size === 'large') {
|
|
|
41
41
|
</script>
|
|
42
42
|
|
|
43
43
|
<label for={id} class={labelClass}>
|
|
44
|
-
<input type="checkbox" {id} class={inputClass} {value}
|
|
44
|
+
<input type="checkbox" {id} class={inputClass} {value} bind:checked {name} {disabled} />
|
|
45
45
|
<div class="{divClass} {$$props.class ? $$props.class : ''}" />
|
|
46
46
|
<span class={spanClass}>{label}</span>
|
|
47
47
|
</label>
|
package/forms/Toggle.svelte.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ declare const __propDef: {
|
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
name?: string;
|
|
7
|
-
color
|
|
7
|
+
color?: ToggleColorType;
|
|
8
8
|
size?: 'small' | 'default' | 'large';
|
|
9
9
|
id?: string;
|
|
10
10
|
label?: string;
|
|
11
|
-
value
|
|
11
|
+
value?: string;
|
|
12
12
|
checked?: boolean;
|
|
13
13
|
disabled?: boolean;
|
|
14
14
|
labelClass?: string;
|
package/package.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script>import { slide } from 'svelte/transition';
|
|
2
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';
|
|
3
5
|
let isOpen = false;
|
|
4
6
|
let activeDropdown = undefined;
|
|
5
7
|
const handleDropdown = (id) => {
|
|
@@ -17,10 +19,10 @@ const handleDropdown = (id) => {
|
|
|
17
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>
|
|
18
20
|
</button>
|
|
19
21
|
{#if isOpen && link.id == activeDropdown}
|
|
20
|
-
<ul id="dropdown" class=
|
|
22
|
+
<ul id="dropdown" class={ulClass} transition:slide={{ duration: 500 }}>
|
|
21
23
|
{#each link.children as child}
|
|
22
24
|
<li>
|
|
23
|
-
<a href={child.href} rel={child.rel} class=
|
|
25
|
+
<a href={child.href} rel={child.rel} class={childClass}>{child.name}</a>
|
|
24
26
|
</li>
|
|
25
27
|
{/each}
|
|
26
28
|
</ul>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<script>import SidebarDropdown from './SidebarDropdown.svelte';
|
|
2
2
|
export let links;
|
|
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 dropDownulClass = 'py-2 space-y-2';
|
|
3
5
|
let ulClass = 'space-y-2';
|
|
4
6
|
export let border = false;
|
|
5
7
|
if (border) {
|
|
@@ -10,7 +12,7 @@ if (border) {
|
|
|
10
12
|
<ul class={ulClass}>
|
|
11
13
|
{#each links as link (link.id)}
|
|
12
14
|
{#if link.children}
|
|
13
|
-
<SidebarDropdown {link} />
|
|
15
|
+
<SidebarDropdown {link} ulClass={dropDownulClass} {childClass} />
|
|
14
16
|
{:else}
|
|
15
17
|
<li>
|
|
16
18
|
<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">
|
package/types.d.ts
CHANGED
|
@@ -90,7 +90,7 @@ export declare type ImgType = {
|
|
|
90
90
|
src: string;
|
|
91
91
|
alt?: string;
|
|
92
92
|
};
|
|
93
|
-
export declare type InputType = '
|
|
93
|
+
export declare type InputType = 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'reset' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week';
|
|
94
94
|
export interface InteractiveTabType {
|
|
95
95
|
name: string;
|
|
96
96
|
id: number;
|
|
@@ -194,7 +194,7 @@ export interface TimelineItemHorizontalType {
|
|
|
194
194
|
iconClass?: string;
|
|
195
195
|
text?: HTMLElement | string;
|
|
196
196
|
}
|
|
197
|
-
export declare type ToggleColorType = 'red' | 'green' | 'purple' | 'yellow' | 'teal' | 'orange';
|
|
197
|
+
export declare type ToggleColorType = 'blue' | 'red' | 'green' | 'purple' | 'yellow' | 'teal' | 'orange';
|
|
198
198
|
export interface TransitionParamTypes {
|
|
199
199
|
delay?: number;
|
|
200
200
|
duration?: number;
|