flowbite-svelte 0.18.1 → 0.18.2
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 +13 -0
- package/buttons/Button.svelte +2 -2
- package/forms/Checkbox.svelte +17 -78
- package/forms/Checkbox.svelte.d.ts +1 -12
- package/forms/Helper.svelte +7 -0
- package/forms/Helper.svelte.d.ts +19 -0
- package/forms/Label.svelte +15 -0
- package/forms/Label.svelte.d.ts +20 -0
- package/index.d.ts +2 -1
- package/index.js +2 -1
- package/package.json +3 -2
- package/forms/CheckboxInline.svelte +0 -3
- package/forms/CheckboxInline.svelte.d.ts +0 -23
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,19 @@
|
|
|
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.18.2](https://github.com/themesberg/flowbite-svelte/compare/v0.18.1...v0.18.2) (2022-06-22)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* make button styles reactive ([d74dd9b](https://github.com/themesberg/flowbite-svelte/commit/d74dd9b37c58716e33ca72ce5058b557a6b43ced))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* make disabled button unclickable ([df1c66d](https://github.com/themesberg/flowbite-svelte/commit/df1c66d08e6090a66cff12d2d41f6b72a93324dc))
|
|
16
|
+
* update checkbox, add Label and Helper components, update checkbox page ([07de620](https://github.com/themesberg/flowbite-svelte/commit/07de6208e256cb364d9ae1ed02b321168119514d))
|
|
17
|
+
|
|
5
18
|
### [0.18.1](https://github.com/themesberg/flowbite-svelte/compare/v0.18.0...v0.18.1) (2022-06-18)
|
|
6
19
|
|
|
7
20
|
|
package/buttons/Button.svelte
CHANGED
|
@@ -18,7 +18,7 @@ else {
|
|
|
18
18
|
}
|
|
19
19
|
let buttonClass;
|
|
20
20
|
let round = rounded ? 'rounded-full' : 'rounded-lg';
|
|
21
|
-
switch (btnColor) {
|
|
21
|
+
$: switch (btnColor) {
|
|
22
22
|
default:
|
|
23
23
|
case 'blue':
|
|
24
24
|
buttonClass = `text-white text-center font-medium ${round} ${textSize} ${paddings}`;
|
|
@@ -87,6 +87,6 @@ switch (btnColor) {
|
|
|
87
87
|
buttonClass += ' items-center inline-flex';
|
|
88
88
|
</script>
|
|
89
89
|
|
|
90
|
-
<button {type} class="{buttonClass} {$$props.class ? $$props.class : ''}" on:click>
|
|
90
|
+
<button {type} class="{buttonClass} {$$props.class ? $$props.class : ''}" on:click {disabled}>
|
|
91
91
|
<slot>Read more</slot>
|
|
92
92
|
</button>
|
package/forms/Checkbox.svelte
CHANGED
|
@@ -1,82 +1,21 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
2
|
export let inputClass = 'w-4 h-4 bg-gray-100 rounded border-gray-300 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600 ';
|
|
3
|
-
export let labelClass = 'ml-2 text-sm font-medium text-gray-900 dark:text-gray-300';
|
|
4
|
-
export let disabled = false;
|
|
5
|
-
export let name = '';
|
|
6
|
-
export let divHelperClass = 'flex items-center h-5';
|
|
7
|
-
export let labelHelperClass = 'font-medium text-gray-900 dark:text-gray-300';
|
|
8
|
-
export let helperClass = 'text-xs font-normal text-gray-500 dark:text-gray-300';
|
|
9
|
-
export let color = 'blue';
|
|
10
|
-
export let helper = '';
|
|
11
|
-
export let id = '';
|
|
12
|
-
export let value = '';
|
|
13
|
-
export let label = '';
|
|
14
3
|
export let checked = false;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
inputClass += 'text-purple-600 focus:ring-purple-500 dark:focus:ring-purple-600';
|
|
26
|
-
}
|
|
27
|
-
else if (color === 'teal') {
|
|
28
|
-
inputClass += 'text-teal-600 focus:ring-teal-500 dark:focus:ring-teal-600';
|
|
29
|
-
}
|
|
30
|
-
else if (color === 'yellow') {
|
|
31
|
-
inputClass += 'text-yellow-400 focus:ring-yellow-500 dark:focus:ring-yellow-600';
|
|
32
|
-
}
|
|
33
|
-
else if (color === 'orange') {
|
|
34
|
-
inputClass += 'text-orange-500 focus:ring-orange-500 dark:focus:ring-orange-600';
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
inputClass += 'text-blue-600 focus:ring-blue-500 dark:focus:ring-blue-600';
|
|
38
|
-
}
|
|
4
|
+
export let color = 'blue';
|
|
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
|
+
};
|
|
39
14
|
</script>
|
|
40
15
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
bind:checked
|
|
48
|
-
{name}
|
|
49
|
-
{value}
|
|
50
|
-
class={inputClass}
|
|
51
|
-
aria-labelledby={id}
|
|
52
|
-
aria-describedby={id}
|
|
53
|
-
{disabled}
|
|
54
|
-
{...$$restProps}
|
|
55
|
-
/>
|
|
56
|
-
</div>
|
|
57
|
-
<div class="ml-2 text-sm">
|
|
58
|
-
<label for={id} class={labelHelperClass}>
|
|
59
|
-
{@html label}
|
|
60
|
-
</label>
|
|
61
|
-
<p id="{id}-helper-radio-text" class={helperClass}>{helper}</p>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
{:else}
|
|
65
|
-
<div class={divClass}>
|
|
66
|
-
<input
|
|
67
|
-
{id}
|
|
68
|
-
type="checkbox"
|
|
69
|
-
bind:checked
|
|
70
|
-
{name}
|
|
71
|
-
{value}
|
|
72
|
-
class={inputClass}
|
|
73
|
-
aria-labelledby={id}
|
|
74
|
-
aria-describedby={id}
|
|
75
|
-
{disabled}
|
|
76
|
-
{...$$restProps}
|
|
77
|
-
/>
|
|
78
|
-
<label for={id} class={labelClass}>
|
|
79
|
-
{@html label}
|
|
80
|
-
</label>
|
|
81
|
-
</div>
|
|
82
|
-
{/if}
|
|
16
|
+
<input
|
|
17
|
+
type="checkbox"
|
|
18
|
+
bind:checked
|
|
19
|
+
class={classNames(inputClass, colorClasses[color], $$props.class)}
|
|
20
|
+
{...$$restProps}
|
|
21
|
+
/>
|
|
@@ -3,20 +3,9 @@ import type { FormColorType } from '../types';
|
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
|
-
divClass?: string;
|
|
7
6
|
inputClass?: string;
|
|
8
|
-
labelClass?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
name?: string;
|
|
11
|
-
divHelperClass?: string;
|
|
12
|
-
labelHelperClass?: string;
|
|
13
|
-
helperClass?: string;
|
|
14
|
-
color?: FormColorType;
|
|
15
|
-
helper?: string;
|
|
16
|
-
id?: string;
|
|
17
|
-
value?: string;
|
|
18
|
-
label?: string;
|
|
19
7
|
checked?: boolean;
|
|
8
|
+
color?: FormColorType;
|
|
20
9
|
};
|
|
21
10
|
events: {
|
|
22
11
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
helperClass?: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {
|
|
11
|
+
default: {};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare type HelperProps = typeof __propDef.props;
|
|
15
|
+
export declare type HelperEvents = typeof __propDef.events;
|
|
16
|
+
export declare type HelperSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Helper extends SvelteComponentTyped<HelperProps, HelperEvents, HelperSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
export let color = 'gray';
|
|
3
|
+
export let labelClass = 'text-sm font-medium';
|
|
4
|
+
const colorClasses = {
|
|
5
|
+
gray: 'text-gray-900 dark:text-gray-300',
|
|
6
|
+
green: 'text-green-700 dark:text-green-500',
|
|
7
|
+
red: 'text-red-700 dark:text-red-500',
|
|
8
|
+
disabled: 'text-gray-400 dark:text-gray-500'
|
|
9
|
+
};
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<!-- svelte-ignore a11y-label-has-associated-control -->
|
|
13
|
+
<label {...$$restProps} class={classNames(labelClass, colorClasses[color], $$props.class)}>
|
|
14
|
+
<slot />
|
|
15
|
+
</label>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
color?: 'gray' | 'green' | 'red' | 'disabled';
|
|
6
|
+
labelClass?: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare type LabelProps = typeof __propDef.props;
|
|
16
|
+
export declare type LabelEvents = typeof __propDef.events;
|
|
17
|
+
export declare type LabelSlots = typeof __propDef.slots;
|
|
18
|
+
export default class Label extends SvelteComponentTyped<LabelProps, LabelEvents, LabelSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
package/index.d.ts
CHANGED
|
@@ -31,11 +31,12 @@ export { default as LogoFooter } from './footer/LogoFooter.svelte';
|
|
|
31
31
|
export { default as SocialMediaFooter } from './footer/SocialMediaFooter.svelte';
|
|
32
32
|
export { default as SitemapFooter } from './footer/SitemapFooter.svelte';
|
|
33
33
|
export { default as Checkbox } from './forms/Checkbox.svelte';
|
|
34
|
-
export { default as CheckboxInline } from './forms/CheckboxInline.svelte';
|
|
35
34
|
export { default as Fileupload } from './forms/Fileupload.svelte';
|
|
36
35
|
export { default as FloatingLabelInput } from './forms/FloatingLabelInput.svelte';
|
|
36
|
+
export { default as Helper } from './forms/Helper.svelte';
|
|
37
37
|
export { default as Iconinput } from './forms/Iconinput.svelte';
|
|
38
38
|
export { default as Input } from './forms/Input.svelte';
|
|
39
|
+
export { default as Label } from './forms/Label.svelte';
|
|
39
40
|
export { default as RadioInline } from './forms/RadioInline.svelte';
|
|
40
41
|
export { default as Radio } from './forms/Radio.svelte';
|
|
41
42
|
export { default as Range } from './forms/Range.svelte';
|
package/index.js
CHANGED
|
@@ -44,11 +44,12 @@ export { default as SocialMediaFooter } from './footer/SocialMediaFooter.svelte'
|
|
|
44
44
|
export { default as SitemapFooter } from './footer/SitemapFooter.svelte';
|
|
45
45
|
// Forms
|
|
46
46
|
export { default as Checkbox } from './forms/Checkbox.svelte';
|
|
47
|
-
export { default as CheckboxInline } from './forms/CheckboxInline.svelte';
|
|
48
47
|
export { default as Fileupload } from './forms/Fileupload.svelte';
|
|
49
48
|
export { default as FloatingLabelInput } from './forms/FloatingLabelInput.svelte';
|
|
49
|
+
export { default as Helper } from './forms/Helper.svelte';
|
|
50
50
|
export { default as Iconinput } from './forms/Iconinput.svelte';
|
|
51
51
|
export { default as Input } from './forms/Input.svelte';
|
|
52
|
+
export { default as Label } from './forms/Label.svelte';
|
|
52
53
|
export { default as RadioInline } from './forms/RadioInline.svelte';
|
|
53
54
|
export { default as Radio } from './forms/Radio.svelte';
|
|
54
55
|
export { default as Range } from './forms/Range.svelte';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -130,11 +130,12 @@
|
|
|
130
130
|
"./footer/SitemapFooter.svelte": "./footer/SitemapFooter.svelte",
|
|
131
131
|
"./footer/SocialMediaFooter.svelte": "./footer/SocialMediaFooter.svelte",
|
|
132
132
|
"./forms/Checkbox.svelte": "./forms/Checkbox.svelte",
|
|
133
|
-
"./forms/CheckboxInline.svelte": "./forms/CheckboxInline.svelte",
|
|
134
133
|
"./forms/Fileupload.svelte": "./forms/Fileupload.svelte",
|
|
135
134
|
"./forms/FloatingLabelInput.svelte": "./forms/FloatingLabelInput.svelte",
|
|
135
|
+
"./forms/Helper.svelte": "./forms/Helper.svelte",
|
|
136
136
|
"./forms/Iconinput.svelte": "./forms/Iconinput.svelte",
|
|
137
137
|
"./forms/Input.svelte": "./forms/Input.svelte",
|
|
138
|
+
"./forms/Label.svelte": "./forms/Label.svelte",
|
|
138
139
|
"./forms/Radio.svelte": "./forms/Radio.svelte",
|
|
139
140
|
"./forms/RadioInline.svelte": "./forms/RadioInline.svelte",
|
|
140
141
|
"./forms/Range.svelte": "./forms/Range.svelte",
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** @typedef {typeof __propDef.props} CheckboxInlineProps */
|
|
2
|
-
/** @typedef {typeof __propDef.events} CheckboxInlineEvents */
|
|
3
|
-
/** @typedef {typeof __propDef.slots} CheckboxInlineSlots */
|
|
4
|
-
export default class CheckboxInline extends SvelteComponentTyped<{}, {
|
|
5
|
-
[evt: string]: CustomEvent<any>;
|
|
6
|
-
}, {
|
|
7
|
-
default: {};
|
|
8
|
-
}> {
|
|
9
|
-
}
|
|
10
|
-
export type CheckboxInlineProps = typeof __propDef.props;
|
|
11
|
-
export type CheckboxInlineEvents = typeof __propDef.events;
|
|
12
|
-
export type CheckboxInlineSlots = typeof __propDef.slots;
|
|
13
|
-
import { SvelteComponentTyped } from "svelte";
|
|
14
|
-
declare const __propDef: {
|
|
15
|
-
props: {};
|
|
16
|
-
events: {
|
|
17
|
-
[evt: string]: CustomEvent<any>;
|
|
18
|
-
};
|
|
19
|
-
slots: {
|
|
20
|
-
default: {};
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
export {};
|