flowbite-svelte 0.15.34 → 0.15.37
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 +11 -8
- package/accordions/AccordionItem.svelte.d.ts +2 -1
- 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/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.37](https://github.com/themesberg/flowbite-svelte/compare/v0.15.36...v0.15.37) (2022-05-18)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* add buttonClass to AccordionItem ([8387244](https://github.com/themesberg/flowbite-svelte/commit/83872440ebb872843a0f016f7fb576d156295b96))
|
|
11
|
+
|
|
12
|
+
### [0.15.36](https://github.com/themesberg/flowbite-svelte/compare/v0.15.35...v0.15.36) (2022-05-17)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* add '' to string types ([387363a](https://github.com/themesberg/flowbite-svelte/commit/387363a3b3668dc66a7790331927e1c1641e4de6))
|
|
18
|
+
* add bind:checked to Checkbox ([7cfcf67](https://github.com/themesberg/flowbite-svelte/commit/7cfcf67b52a1496f57f8ef31b4205464f9eb82a0))
|
|
19
|
+
* add bind:checked to Toggle ([18a34ea](https://github.com/themesberg/flowbite-svelte/commit/18a34eaaf65539bf176da642b4a04f644265f647))
|
|
20
|
+
* remove radio, search etc from InputType ([ed95418](https://github.com/themesberg/flowbite-svelte/commit/ed9541808da054b383c6addff55907d955dad32f))
|
|
21
|
+
|
|
22
|
+
### [0.15.35](https://github.com/themesberg/flowbite-svelte/compare/v0.15.34...v0.15.35) (2022-05-15)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* add ulClass and childClass in SidebarItem's SidebarDropdown ([2e0f46b](https://github.com/themesberg/flowbite-svelte/commit/2e0f46b6c65037e4a40bba688936af99839bd863))
|
|
28
|
+
|
|
5
29
|
### [0.15.34](https://github.com/themesberg/flowbite-svelte/compare/v0.15.33...v0.15.34) (2022-05-15)
|
|
6
30
|
|
|
7
31
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { onMount } from 'svelte';
|
|
3
3
|
import { ChevronDownSolid, ChevronUpSolid } from 'svelte-heros';
|
|
4
4
|
export let id = '';
|
|
5
|
-
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
6
|
export let isOpen = false;
|
|
8
7
|
export let color = false;
|
|
@@ -15,21 +14,25 @@ onMount(() => {
|
|
|
15
14
|
isOpen = true;
|
|
16
15
|
}
|
|
17
16
|
});
|
|
17
|
+
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';
|
|
18
|
+
$: btnClass;
|
|
19
|
+
export let colorClass = 'focus:ring-blue-200 dark:focus:ring-blue-800 hover:bg-blue-100 text-blue-500 bg-blue-200 text-blue-700';
|
|
18
20
|
const handleToggle = (id) => {
|
|
19
21
|
isOpen = !isOpen;
|
|
20
|
-
if (color && isOpen) {
|
|
21
|
-
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 focus:ring-blue-200 dark:focus:ring-blue-800 hover:bg-blue-100 text-blue-500 bg-blue-200 text-blue-700';
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
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';
|
|
25
|
-
}
|
|
26
22
|
};
|
|
23
|
+
let buttonClass;
|
|
24
|
+
$: if (color && isOpen) {
|
|
25
|
+
buttonClass = btnClass + colorClass;
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
buttonClass = btnClass;
|
|
29
|
+
}
|
|
27
30
|
export let iconSize = 24;
|
|
28
31
|
export let iconClass = 'text-gray-500 sm:w-6 sm:h-6 dark:text-gray-300';
|
|
29
32
|
</script>
|
|
30
33
|
|
|
31
34
|
<h2 aria-expanded={isOpen}>
|
|
32
|
-
<button on:click={() => handleToggle(id)} type="button" class:rounded-t-xl={id === '1'} class:border-t-0={id !== '1'} class="{
|
|
35
|
+
<button on:click={() => handleToggle(id)} type="button" class:rounded-t-xl={id === '1'} class:border-t-0={id !== '1'} class="{buttonClass} {$$props.class ? $$props.class : ''}">
|
|
33
36
|
<slot name="header" />
|
|
34
37
|
{#if isOpen}
|
|
35
38
|
<svelte:component this={icons.up} size={iconSize} class="mr-2 {iconClass}" />
|
|
@@ -4,11 +4,12 @@ declare const __propDef: {
|
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
id?: string;
|
|
7
|
-
btnClass?: string;
|
|
8
7
|
slotClass?: string;
|
|
9
8
|
isOpen?: boolean;
|
|
10
9
|
color?: boolean;
|
|
11
10
|
icons?: AccordionIconType;
|
|
11
|
+
btnClass?: string;
|
|
12
|
+
colorClass?: string;
|
|
12
13
|
iconSize?: number;
|
|
13
14
|
iconClass?: string;
|
|
14
15
|
};
|
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 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;
|