flowbite-svelte 0.22.3 → 0.22.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/CHANGELOG.md +27 -0
- package/dropdowns/Dropdown.svelte +10 -4
- package/forms/Label.svelte +1 -1
- package/forms/Radio.svelte +1 -0
- package/forms/Radio.svelte.d.ts +1 -0
- package/forms/Select.svelte +22 -4
- package/forms/Select.svelte.d.ts +9 -4
- package/forms/Toggle.svelte +3 -1
- package/forms/Toggle.svelte.d.ts +2 -0
- package/package.json +5 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
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.22.6](https://github.com/themesberg/flowbite-svelte/compare/v0.22.5...v0.22.6) (2022-07-22)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* select input [#50](https://github.com/themesberg/flowbite-svelte/issues/50) ([8cea993](https://github.com/themesberg/flowbite-svelte/commit/8cea993344f1427f83ab46f29a9bc1613c67960c))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* add on:change to Radio ([074bd16](https://github.com/themesberg/flowbite-svelte/commit/074bd1677ced075971173c8abf1cf15387026efd))
|
|
16
|
+
|
|
17
|
+
### [0.22.5](https://github.com/themesberg/flowbite-svelte/compare/v0.22.4...v0.22.5) (2022-07-21)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* [#144](https://github.com/themesberg/flowbite-svelte/issues/144) ChevronLeft fix ([016940b](https://github.com/themesberg/flowbite-svelte/commit/016940b36c6782c2481d8ff6c489c2808945d674))
|
|
23
|
+
|
|
24
|
+
### [0.22.4](https://github.com/themesberg/flowbite-svelte/compare/v0.22.3...v0.22.4) (2022-07-21)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* [#165](https://github.com/themesberg/flowbite-svelte/issues/165) toggle bind:group bind:checked ([3ca4010](https://github.com/themesberg/flowbite-svelte/commit/3ca40109f13e31afa76e02c96d387ff476880e52))
|
|
30
|
+
* change from # to / for href ([b79fd81](https://github.com/themesberg/flowbite-svelte/commit/b79fd8112d2fb15657058dd0184b113228d8a6aa))
|
|
31
|
+
|
|
5
32
|
### [0.22.3](https://github.com/themesberg/flowbite-svelte/compare/v0.22.2...v0.22.3) (2022-07-21)
|
|
6
33
|
|
|
7
34
|
|
|
@@ -28,17 +28,23 @@ $: icon = icons[placement.split('-')[0]];
|
|
|
28
28
|
>
|
|
29
29
|
<slot name="trigger">
|
|
30
30
|
{#if inline}
|
|
31
|
-
<button class={labelClass}>
|
|
31
|
+
<button class={labelClass} class:flex-row-reverse={icon == ChevronLeft}>
|
|
32
32
|
<slot name="label">{label}</slot>
|
|
33
33
|
{#if arrowIcon}
|
|
34
|
-
<svelte:component
|
|
34
|
+
<svelte:component
|
|
35
|
+
this={icon ?? ChevronDown}
|
|
36
|
+
class={classNames('h-4 w-4', icon == ChevronLeft ? 'mr-2' : 'ml-2')}
|
|
37
|
+
/>
|
|
35
38
|
{/if}
|
|
36
39
|
</button>
|
|
37
40
|
{:else}
|
|
38
|
-
<Button {...$$restProps}>
|
|
41
|
+
<Button {...$$restProps} class={icon == ChevronLeft && 'flex-row-reverse'}>
|
|
39
42
|
<slot name="label">{label}</slot>
|
|
40
43
|
{#if arrowIcon}
|
|
41
|
-
<svelte:component
|
|
44
|
+
<svelte:component
|
|
45
|
+
this={icon ?? ChevronDown}
|
|
46
|
+
class={classNames('h-4 w-4', icon == ChevronLeft ? 'mr-2' : 'ml-2')}
|
|
47
|
+
/>
|
|
42
48
|
{/if}
|
|
43
49
|
</Button>
|
|
44
50
|
{/if}
|
package/forms/Label.svelte
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
2
|
export let color = 'gray';
|
|
3
|
-
export let defaultClass = 'text-sm font-medium';
|
|
3
|
+
export let defaultClass = 'text-sm font-medium block';
|
|
4
4
|
export let show = true; // helper for inheritance
|
|
5
5
|
let node;
|
|
6
6
|
const colorClasses = {
|
package/forms/Radio.svelte
CHANGED
package/forms/Radio.svelte.d.ts
CHANGED
package/forms/Select.svelte
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export let
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
export let items = [];
|
|
3
|
+
export let value;
|
|
4
|
+
export let placeholder = 'Choose option ...';
|
|
5
|
+
export let underline = false;
|
|
6
|
+
export let size = 'md';
|
|
7
|
+
const common = 'block w-full';
|
|
8
|
+
export let defaultClass = 'text-gray-900 bg-gray-50 border border-gray-300 rounded-lg focus:ring-blue-500 focus:border-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500';
|
|
9
|
+
export let underlineClass = 'text-gray-500 bg-transparent border-0 border-b-2 border-gray-200 appearance-none dark:text-gray-400 dark:border-gray-700 focus:outline-none focus:ring-0 focus:border-gray-200 peer';
|
|
10
|
+
const sizes = {
|
|
11
|
+
sm: 'text-sm p-2',
|
|
12
|
+
md: 'text-sm p-2.5',
|
|
13
|
+
lg: 'text-base py-3 px-4'
|
|
14
|
+
};
|
|
15
|
+
let selectClass;
|
|
16
|
+
$: selectClass = classNames(common, underline ? underlineClass : defaultClass, sizes[size], underline && '!px-0', $$restProps.class);
|
|
3
17
|
</script>
|
|
4
18
|
|
|
5
|
-
<select {...$$restProps} bind:value class={selectClass} on:change>
|
|
6
|
-
<
|
|
19
|
+
<select {...$$restProps} bind:value class={selectClass} on:change on:input>
|
|
20
|
+
<option disabled selected value="">{placeholder}</option>
|
|
21
|
+
|
|
22
|
+
{#each items as { value, name }}
|
|
23
|
+
<option {value}>{name}</option>
|
|
24
|
+
{/each}
|
|
7
25
|
</select>
|
package/forms/Select.svelte.d.ts
CHANGED
|
@@ -1,18 +1,23 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { SelectOptionType } from '../types';
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
6
|
+
items?: SelectOptionType[];
|
|
5
7
|
value: string | number;
|
|
6
|
-
|
|
8
|
+
placeholder?: string;
|
|
9
|
+
underline?: boolean;
|
|
10
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
|
+
defaultClass?: string;
|
|
12
|
+
underlineClass?: string;
|
|
7
13
|
};
|
|
8
14
|
events: {
|
|
9
15
|
change: Event;
|
|
16
|
+
input: Event;
|
|
10
17
|
} & {
|
|
11
18
|
[evt: string]: CustomEvent<any>;
|
|
12
19
|
};
|
|
13
|
-
slots: {
|
|
14
|
-
default: {};
|
|
15
|
-
};
|
|
20
|
+
slots: {};
|
|
16
21
|
};
|
|
17
22
|
export declare type SelectProps = typeof __propDef.props;
|
|
18
23
|
export declare type SelectEvents = typeof __propDef.events;
|
package/forms/Toggle.svelte
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
2
|
import Checkbox from './Checkbox.svelte';
|
|
3
3
|
export let size = 'default';
|
|
4
|
+
export let group = [];
|
|
4
5
|
export let value = '';
|
|
6
|
+
export let checked = undefined;
|
|
5
7
|
const common = "mr-3 bg-gray-200 rounded-full peer-focus:ring-4 dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:bg-white after:border-gray-300 after:border after:rounded-full after:transition-all dark:border-gray-600";
|
|
6
8
|
const colors = {
|
|
7
9
|
red: 'peer-focus:ring-red-300 dark:peer-focus:ring-red-800 peer-checked:bg-red-600',
|
|
@@ -19,7 +21,7 @@ const sizes = {
|
|
|
19
21
|
};
|
|
20
22
|
</script>
|
|
21
23
|
|
|
22
|
-
<Checkbox custom class="relative {$$props.class}" {value} {...$$restProps} on:click>
|
|
24
|
+
<Checkbox custom class="relative {$$props.class}" {value} bind:checked bind:group {...$$restProps} on:click>
|
|
23
25
|
<div class={classNames(common, colors[$$restProps.color ?? 'blue'], sizes[size])} />
|
|
24
26
|
<slot />
|
|
25
27
|
</Checkbox>
|
package/forms/Toggle.svelte.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.22.
|
|
3
|
+
"version": "0.22.6",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -58,12 +58,15 @@
|
|
|
58
58
|
"dropdown",
|
|
59
59
|
"footer",
|
|
60
60
|
"forms",
|
|
61
|
+
"kbd",
|
|
61
62
|
"list group",
|
|
62
|
-
"
|
|
63
|
+
"modal",
|
|
63
64
|
"navbar",
|
|
64
65
|
"paginations",
|
|
65
66
|
"progress bars",
|
|
67
|
+
"rating",
|
|
66
68
|
"sidebars",
|
|
69
|
+
"skeleton",
|
|
67
70
|
"spinners",
|
|
68
71
|
"tables",
|
|
69
72
|
"tabs",
|