flowbite-svelte 0.21.16 → 0.22.1
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 +33 -0
- package/forms/Checkbox.svelte +12 -13
- package/forms/Checkbox.svelte.d.ts +6 -4
- package/forms/Label.svelte +15 -4
- package/forms/Label.svelte.d.ts +2 -1
- package/forms/Radio.svelte +35 -38
- package/forms/Radio.svelte.d.ts +4 -2
- package/forms/Toggle.svelte +1 -1
- package/forms/Toggle.svelte.d.ts +2 -0
- package/package.json +18 -17
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,39 @@
|
|
|
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.1](https://github.com/themesberg/flowbite-svelte/compare/v0.22.0...v0.22.1) (2022-07-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* buttons redesign ([c0316ff](https://github.com/themesberg/flowbite-svelte/commit/c0316ff61fde6bf52166e3f0c0b30dacad4941c0))
|
|
11
|
+
* typo ([4479464](https://github.com/themesberg/flowbite-svelte/commit/4479464736800552c1c05ce6b793459e8df6ef7f))
|
|
12
|
+
|
|
13
|
+
## [0.22.0](https://github.com/themesberg/flowbite-svelte/compare/v0.21.17...v0.22.0) (2022-07-20)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### ⚠ BREAKING CHANGES
|
|
17
|
+
|
|
18
|
+
* update dependencies and vite. script dev, build preview and test work
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* update dependencies and vite. script dev, build preview and test work ([bf1b837](https://github.com/themesberg/flowbite-svelte/commit/bf1b83788d7f3ec53c2d5e5c85a825606cbce38f))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* update all dependencies ([d7ae979](https://github.com/themesberg/flowbite-svelte/commit/d7ae979973ba092f36236fe877b98314a0328a42))
|
|
28
|
+
* update package.json ([a77e3e5](https://github.com/themesberg/flowbite-svelte/commit/a77e3e57f58ac95dda547cc9a410a2aaa4559fe8))
|
|
29
|
+
|
|
30
|
+
### [0.21.17](https://github.com/themesberg/flowbite-svelte/compare/v0.21.16...v0.21.17) (2022-07-20)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Bug Fixes
|
|
34
|
+
|
|
35
|
+
* Checkbox on:click position ([cfb1c65](https://github.com/themesberg/flowbite-svelte/commit/cfb1c658ae971bb689cd4e01f797ccc5c11db991))
|
|
36
|
+
* on:click for Toggle, Checkbox and Radio ([48710b5](https://github.com/themesberg/flowbite-svelte/commit/48710b59c9a9096ec95dfa26d1764a312552b49e))
|
|
37
|
+
|
|
5
38
|
### [0.21.16](https://github.com/themesberg/flowbite-svelte/compare/v0.21.14...v0.21.16) (2022-07-20)
|
|
6
39
|
|
|
7
40
|
|
package/forms/Checkbox.svelte
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
<script>import Radio from './Radio.svelte';
|
|
1
|
+
<script>import Radio, { labelClass, inputClass } from './Radio.svelte';
|
|
2
|
+
import Label from './Label.svelte';
|
|
3
|
+
// properties forwarding
|
|
4
|
+
export let color = 'blue';
|
|
5
|
+
export let custom = false;
|
|
6
|
+
export let inline = false;
|
|
7
|
+
export let tinted = false;
|
|
2
8
|
export let group = [];
|
|
3
9
|
export let value = '';
|
|
4
10
|
export let checked = undefined;
|
|
@@ -22,22 +28,15 @@ $: {
|
|
|
22
28
|
}
|
|
23
29
|
}
|
|
24
30
|
}
|
|
25
|
-
let inputClass; // get the value from the underlying Radio
|
|
26
|
-
// properties forwarding
|
|
27
|
-
export let custom = false;
|
|
28
|
-
export let color = 'blue';
|
|
29
|
-
export let inline = false;
|
|
30
|
-
export let tinted = false;
|
|
31
31
|
</script>
|
|
32
32
|
|
|
33
|
-
<
|
|
33
|
+
<Label class={labelClass(inline, $$restProps.class)} show={!!$$slots.default}>
|
|
34
34
|
<input
|
|
35
|
-
slot="input"
|
|
36
35
|
type="checkbox"
|
|
37
36
|
bind:checked
|
|
37
|
+
on:click
|
|
38
38
|
{value}
|
|
39
39
|
{...$$restProps}
|
|
40
|
-
class=
|
|
41
|
-
/>
|
|
42
|
-
|
|
43
|
-
</Radio>
|
|
40
|
+
class={inputClass(custom, color, true, tinted, $$slots.default || $$restProps.class)}
|
|
41
|
+
/><slot />
|
|
42
|
+
</Label>
|
|
@@ -3,15 +3,17 @@ import type { FormColorType } from '../types';
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
|
-
group?: string[];
|
|
7
|
-
value?: string;
|
|
8
|
-
checked?: boolean;
|
|
9
|
-
custom?: boolean;
|
|
10
6
|
color?: FormColorType;
|
|
7
|
+
custom?: boolean;
|
|
11
8
|
inline?: boolean;
|
|
12
9
|
tinted?: boolean;
|
|
10
|
+
group?: string[];
|
|
11
|
+
value?: string;
|
|
12
|
+
checked?: boolean;
|
|
13
13
|
};
|
|
14
14
|
events: {
|
|
15
|
+
click: MouseEvent;
|
|
16
|
+
} & {
|
|
15
17
|
[evt: string]: CustomEvent<any>;
|
|
16
18
|
};
|
|
17
19
|
slots: {
|
package/forms/Label.svelte
CHANGED
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
2
|
export let color = 'gray';
|
|
3
|
-
export let
|
|
3
|
+
export let defaultClass = 'text-sm font-medium';
|
|
4
|
+
export let show = true; // helper for inheritance
|
|
5
|
+
let node;
|
|
4
6
|
const colorClasses = {
|
|
5
7
|
gray: 'text-gray-900 dark:text-gray-300',
|
|
6
8
|
green: 'text-green-700 dark:text-green-500',
|
|
7
9
|
red: 'text-red-700 dark:text-red-500',
|
|
8
10
|
disabled: 'text-gray-400 dark:text-gray-500'
|
|
9
11
|
};
|
|
12
|
+
// function checkDisabled(node: HTMLLabelElement) {
|
|
13
|
+
$: {
|
|
14
|
+
const control = node?.control;
|
|
15
|
+
color = control?.disabled ? 'disabled' : color;
|
|
16
|
+
}
|
|
17
|
+
let labelClass;
|
|
18
|
+
$: labelClass = classNames(defaultClass, colorClasses[color], $$props.class);
|
|
10
19
|
</script>
|
|
11
20
|
|
|
12
|
-
|
|
13
|
-
|
|
21
|
+
{#if show}
|
|
22
|
+
<!-- svelte-ignore a11y-label-has-associated-control -->
|
|
23
|
+
<label bind:this={node} {...$$restProps} class={labelClass}><slot /></label>
|
|
24
|
+
{:else}
|
|
14
25
|
<slot />
|
|
15
|
-
|
|
26
|
+
{/if}
|
package/forms/Label.svelte.d.ts
CHANGED
package/forms/Radio.svelte
CHANGED
|
@@ -1,50 +1,47 @@
|
|
|
1
|
-
<script
|
|
1
|
+
<script context="module">
|
|
2
|
+
// this part is shared between Radio and Checkbox
|
|
3
|
+
import classNames from 'classnames';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
+
const colorClasses = {
|
|
6
|
+
red: 'text-red-600 focus:ring-red-500 dark:focus:ring-red-600',
|
|
7
|
+
green: 'text-green-600 focus:ring-green-500 dark:focus:ring-green-600',
|
|
8
|
+
purple: 'text-purple-600 focus:ring-purple-500 dark:focus:ring-purple-600',
|
|
9
|
+
teal: 'text-teal-600 focus:ring-teal-500 dark:focus:ring-teal-600',
|
|
10
|
+
yellow: 'text-yellow-400 focus:ring-yellow-500 dark:focus:ring-yellow-600',
|
|
11
|
+
orange: 'text-orange-500 focus:ring-orange-500 dark:focus:ring-orange-600',
|
|
12
|
+
blue: 'text-blue-600 focus:ring-blue-500 dark:focus:ring-blue-600'
|
|
13
|
+
};
|
|
5
14
|
|
|
6
|
-
|
|
7
|
-
|
|
15
|
+
export const labelClass = (inline, extraClass) =>
|
|
16
|
+
classNames(inline ? 'inline-flex' : 'flex', 'items-center', extraClass);
|
|
8
17
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
18
|
+
export const inputClass = (custom, color, rounded, tinted, extraClass) =>
|
|
19
|
+
classNames(
|
|
20
|
+
'w-4 h-4 bg-gray-100 border-gray-300 dark:ring-offset-gray-800 focus:ring-2 mr-2',
|
|
21
|
+
tinted ? 'dark:bg-gray-600 dark:border-gray-500' : 'dark:bg-gray-700 dark:border-gray-600',
|
|
22
|
+
custom && 'sr-only peer',
|
|
23
|
+
rounded && 'rounded',
|
|
24
|
+
colorClasses[color],
|
|
25
|
+
extraClass
|
|
26
|
+
);
|
|
27
|
+
</script>
|
|
12
28
|
|
|
13
|
-
|
|
14
|
-
import classNames from 'classnames';
|
|
29
|
+
<script>import Label from './Label.svelte';
|
|
15
30
|
export let color = 'blue';
|
|
16
31
|
export let custom = false;
|
|
17
32
|
export let inline = false;
|
|
18
33
|
export let tinted = false;
|
|
19
34
|
export let group = '';
|
|
20
35
|
export let value = '';
|
|
21
|
-
export let inputClass;
|
|
22
|
-
$: inputClass = classNames('w-4 h-4 bg-gray-100 border-gray-300 dark:ring-offset-gray-800 focus:ring-2 mr-2', tinted ? 'dark:bg-gray-600 dark:border-gray-500' : 'dark:bg-gray-700 dark:border-gray-600', custom && 'sr-only peer', colorClasses[color]);
|
|
23
|
-
let colorLabel = 'gray';
|
|
24
|
-
$: colorLabel = $$restProps.disabled ? 'disabled' : colorLabel;
|
|
25
|
-
let labelClass;
|
|
26
|
-
$: labelClass = classNames(inline ? 'inline-flex' : 'flex', 'items-center text-sm font-medium', colorClassesLabel[colorLabel], $$restProps.class);
|
|
27
|
-
const colorClassesLabel = {
|
|
28
|
-
gray: 'text-gray-900 dark:text-gray-300',
|
|
29
|
-
green: 'text-green-700 dark:text-green-500',
|
|
30
|
-
red: 'text-red-700 dark:text-red-500',
|
|
31
|
-
disabled: 'text-gray-400 dark:text-gray-500'
|
|
32
|
-
};
|
|
33
|
-
const colorClasses = {
|
|
34
|
-
red: 'text-red-600 focus:ring-red-500 dark:focus:ring-red-600',
|
|
35
|
-
green: 'text-green-600 focus:ring-green-500 dark:focus:ring-green-600',
|
|
36
|
-
purple: 'text-purple-600 focus:ring-purple-500 dark:focus:ring-purple-600',
|
|
37
|
-
teal: 'text-teal-600 focus:ring-teal-500 dark:focus:ring-teal-600',
|
|
38
|
-
yellow: 'text-yellow-400 focus:ring-yellow-500 dark:focus:ring-yellow-600',
|
|
39
|
-
orange: 'text-orange-500 focus:ring-orange-500 dark:focus:ring-orange-600',
|
|
40
|
-
blue: 'text-blue-600 focus:ring-blue-500 dark:focus:ring-blue-600'
|
|
41
|
-
};
|
|
42
36
|
</script>
|
|
43
37
|
|
|
44
|
-
|
|
45
|
-
<
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
38
|
+
<Label class={labelClass(inline, $$restProps.class)} show={!!$$slots.default}>
|
|
39
|
+
<input
|
|
40
|
+
type="radio"
|
|
41
|
+
bind:group
|
|
42
|
+
on:click
|
|
43
|
+
{value}
|
|
44
|
+
{...$$restProps}
|
|
45
|
+
class={inputClass(custom, color, false, tinted, $$slots.default || $$restProps.class)}
|
|
46
|
+
/><slot />
|
|
47
|
+
</Label>
|
package/forms/Radio.svelte.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
export declare const labelClass: (inline: any, extraClass: any) => string;
|
|
3
|
+
export declare const inputClass: (custom: any, color: any, rounded: any, tinted: any, extraClass: any) => string;
|
|
2
4
|
import type { FormColorType } from '../types';
|
|
3
5
|
declare const __propDef: {
|
|
4
6
|
props: {
|
|
@@ -9,13 +11,13 @@ declare const __propDef: {
|
|
|
9
11
|
tinted?: boolean;
|
|
10
12
|
group?: number | string;
|
|
11
13
|
value?: string;
|
|
12
|
-
inputClass: string;
|
|
13
14
|
};
|
|
14
15
|
events: {
|
|
16
|
+
click: MouseEvent;
|
|
17
|
+
} & {
|
|
15
18
|
[evt: string]: CustomEvent<any>;
|
|
16
19
|
};
|
|
17
20
|
slots: {
|
|
18
|
-
input: {};
|
|
19
21
|
default: {};
|
|
20
22
|
};
|
|
21
23
|
};
|
package/forms/Toggle.svelte
CHANGED
|
@@ -18,7 +18,7 @@ const sizes = {
|
|
|
18
18
|
};
|
|
19
19
|
</script>
|
|
20
20
|
|
|
21
|
-
<Checkbox custom class="relative {$$restProps.class}" {...$$restProps}>
|
|
21
|
+
<Checkbox custom class="relative {$$restProps.class}" {...$$restProps} on:click>
|
|
22
22
|
<div class={classNames(common, colors[$$restProps.color ?? 'blue'], sizes[size])} />
|
|
23
23
|
<slot />
|
|
24
24
|
</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.
|
|
3
|
+
"version": "0.22.1",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -12,30 +12,31 @@
|
|
|
12
12
|
"homepage": "https://flowbite-svelte.com/",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@playwright/test": "^1.
|
|
15
|
+
"@playwright/test": "^1.23.4",
|
|
16
16
|
"@sveltejs/adapter-auto": "next",
|
|
17
17
|
"@sveltejs/kit": "next",
|
|
18
|
-
"@typescript-eslint/eslint-plugin": "^5.
|
|
19
|
-
"@typescript-eslint/parser": "^5.
|
|
18
|
+
"@typescript-eslint/eslint-plugin": "^5.30.7",
|
|
19
|
+
"@typescript-eslint/parser": "^5.30.7",
|
|
20
20
|
"autoprefixer": "^10.4.4",
|
|
21
21
|
"createprops": "^0.4.4",
|
|
22
|
-
"eslint": "^
|
|
23
|
-
"eslint-config-prettier": "^8.
|
|
24
|
-
"eslint-plugin-svelte3": "^
|
|
25
|
-
"mdsvex": "^0.10.
|
|
26
|
-
"postcss": "^8.4.
|
|
27
|
-
"postcss-load-config": "
|
|
28
|
-
"prettier": "^2.
|
|
29
|
-
"prettier-plugin-svelte": "^2.
|
|
22
|
+
"eslint": "^8.20.0",
|
|
23
|
+
"eslint-config-prettier": "^8.5.0",
|
|
24
|
+
"eslint-plugin-svelte3": "^4.0.0",
|
|
25
|
+
"mdsvex": "^0.10.6",
|
|
26
|
+
"postcss": "^8.4.14",
|
|
27
|
+
"postcss-load-config": "3.1.4",
|
|
28
|
+
"prettier": "^2.7.1",
|
|
29
|
+
"prettier-plugin-svelte": "^2.7.0",
|
|
30
30
|
"prism-themes": "^1.9.0",
|
|
31
31
|
"svelte": "^3.47.0",
|
|
32
|
-
"svelte-check": "^2.
|
|
33
|
-
"svelte-preprocess": "^4.10.
|
|
32
|
+
"svelte-check": "^2.8.0",
|
|
33
|
+
"svelte-preprocess": "^4.10.7",
|
|
34
34
|
"svelte-sidebar-menu": "^0.8.4",
|
|
35
|
-
"svelte2tsx": "^0.5.
|
|
36
|
-
"tailwindcss": "^3.
|
|
35
|
+
"svelte2tsx": "^0.5.11",
|
|
36
|
+
"tailwindcss": "^3.1.6",
|
|
37
37
|
"tslib": "^2.3.1",
|
|
38
|
-
"typescript": "~4.
|
|
38
|
+
"typescript": "~4.7.4",
|
|
39
|
+
"vite": "^3.0.2"
|
|
39
40
|
},
|
|
40
41
|
"type": "module",
|
|
41
42
|
"keywords": [
|