flowbite-svelte 0.21.2 → 0.21.5
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 +22 -0
- package/alerts/Alert.svelte +3 -3
- package/avatar/Avatar.svelte +35 -19
- package/avatar/Avatar.svelte.d.ts +13 -5
- package/avatar/Dot.svelte +32 -0
- package/avatar/Dot.svelte.d.ts +22 -0
- package/avatar/Placeholder.svelte +15 -0
- package/avatar/Placeholder.svelte.d.ts +16 -0
- package/buttons/Button.svelte +5 -5
- package/forms/Fileupload.svelte +8 -9
- package/forms/Fileupload.svelte.d.ts +1 -4
- package/forms/FloatingLabelInput.svelte +1 -2
- package/forms/FloatingLabelInput.svelte.d.ts +1 -1
- package/forms/Input.svelte +0 -4
- package/forms/Range.svelte +0 -4
- package/forms/Range.svelte.d.ts +0 -1
- package/forms/Select.svelte +2 -8
- package/forms/Select.svelte.d.ts +1 -4
- package/package.json +3 -1
- package/types.d.ts +4 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,28 @@
|
|
|
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.21.5](https://github.com/themesberg/flowbite-svelte/compare/v0.21.4...v0.21.5) (2022-07-16)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* alerts more functions, changed API ([a2306fb](https://github.com/themesberg/flowbite-svelte/commit/a2306fb2a980a140da51f4f36ac299a5ce33c1c8))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* add href prop to jjagielka avatars and fix doc ([ea97577](https://github.com/themesberg/flowbite-svelte/commit/ea975779365d8a9d8b6fd2fe22e36d94636957f2))
|
|
16
|
+
* buttons - update sizes and force round ([22284ad](https://github.com/themesberg/flowbite-svelte/commit/22284ada79396136f8dce288de87112e74e6f82a))
|
|
17
|
+
|
|
18
|
+
### [0.21.4](https://github.com/themesberg/flowbite-svelte/compare/v0.21.3...v0.21.4) (2022-07-14)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* alerts dismissable button color ([779e863](https://github.com/themesberg/flowbite-svelte/commit/779e863a6b321ea84ae65484b05ed6cd7d73ccd9))
|
|
24
|
+
|
|
25
|
+
### [0.21.3](https://github.com/themesberg/flowbite-svelte/compare/v0.21.2...v0.21.3) (2022-07-14)
|
|
26
|
+
|
|
5
27
|
### [0.21.2](https://github.com/themesberg/flowbite-svelte/compare/v0.21.1...v0.21.2) (2022-07-13)
|
|
6
28
|
|
|
7
29
|
|
package/alerts/Alert.svelte
CHANGED
|
@@ -54,12 +54,12 @@ $: textColor = textColors[color] ?? textColors.blue;
|
|
|
54
54
|
</script>
|
|
55
55
|
|
|
56
56
|
<div id={$$props.id} class:hidden class={divClass} role="alert">
|
|
57
|
-
<div class="flex items-center">
|
|
57
|
+
<div class="flex items-center {textColor}">
|
|
58
58
|
{#if icon}
|
|
59
|
-
<svelte:component this={icon} class="flex-shrink-0 w-5 h-5
|
|
59
|
+
<svelte:component this={icon} class="flex-shrink-0 w-5 h-5 mr-3" />
|
|
60
60
|
{/if}
|
|
61
61
|
|
|
62
|
-
<div class="text-sm
|
|
62
|
+
<div class="text-sm">
|
|
63
63
|
<slot />
|
|
64
64
|
</div>
|
|
65
65
|
|
package/avatar/Avatar.svelte
CHANGED
|
@@ -1,22 +1,38 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export let
|
|
5
|
-
export let
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
import AvatarPlaceholder from './Placeholder.svelte';
|
|
3
|
+
import Dot from './Dot.svelte';
|
|
4
|
+
export let src = '';
|
|
5
|
+
export let href = '#';
|
|
6
|
+
export let rounded = false;
|
|
7
|
+
export let border = false;
|
|
8
|
+
export let stacked = false;
|
|
9
|
+
export let dot = { top: false, color: 'bg-gray-300 dark:bg-gray-500' };
|
|
10
|
+
export let alt = '';
|
|
11
|
+
export let size = 'md';
|
|
12
|
+
// export let ring: string = 'ring-gray-300 dark:ring-gray-500';
|
|
13
|
+
const sizes = {
|
|
14
|
+
xs: 'w-6 h-6',
|
|
15
|
+
sm: 'w-8 h-8',
|
|
16
|
+
md: 'w-10 h-10',
|
|
17
|
+
lg: 'w-20 h-20',
|
|
18
|
+
xl: 'w-36 h-36'
|
|
19
|
+
};
|
|
20
|
+
let avatarClass;
|
|
21
|
+
$: avatarClass = classNames(rounded ? 'rounded' : 'rounded-full', border && 'p-1 ring-2 ring-gray-300 dark:ring-gray-500', sizes[size], stacked && 'border-2 -ml-4 border-white dark:border-gray-800', $$props.class);
|
|
6
22
|
</script>
|
|
7
23
|
|
|
8
|
-
{
|
|
9
|
-
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
<Dot show={$$props.dot} {rounded} {...dot} {size}>
|
|
25
|
+
{#if src}
|
|
26
|
+
<img class={avatarClass} {alt} {src} />
|
|
27
|
+
{:else if $$slots.default}
|
|
28
|
+
<a
|
|
29
|
+
class="flex justify-center items-center {avatarClass} text-xs font-medium text-white bg-gray-700 hover:bg-gray-600"
|
|
30
|
+
{href}
|
|
31
|
+
><slot />
|
|
32
|
+
</a>
|
|
33
|
+
{:else}
|
|
34
|
+
<div class={avatarClass}>
|
|
35
|
+
<AvatarPlaceholder {rounded} />
|
|
18
36
|
</div>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<img class={avatarClass} alt={avatar.alt} src={avatar.src} />
|
|
22
|
-
{/if}
|
|
37
|
+
{/if}
|
|
38
|
+
</Dot>
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { DotType } from '../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
src?: string;
|
|
7
|
+
href?: string;
|
|
8
|
+
rounded?: boolean;
|
|
9
|
+
border?: boolean;
|
|
10
|
+
stacked?: boolean;
|
|
11
|
+
dot?: DotType;
|
|
12
|
+
alt?: string;
|
|
13
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
8
14
|
};
|
|
9
15
|
events: {
|
|
10
16
|
[evt: string]: CustomEvent<any>;
|
|
11
17
|
};
|
|
12
|
-
slots: {
|
|
18
|
+
slots: {
|
|
19
|
+
default: {};
|
|
20
|
+
};
|
|
13
21
|
};
|
|
14
22
|
export declare type AvatarProps = typeof __propDef.props;
|
|
15
23
|
export declare type AvatarEvents = typeof __propDef.events;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
export let show = false;
|
|
3
|
+
export let top = false;
|
|
4
|
+
export let color = 'bg-gray-300 dark:bg-gray-500';
|
|
5
|
+
export let rounded = false;
|
|
6
|
+
export let size = 'md';
|
|
7
|
+
const sizes = {
|
|
8
|
+
xs: 'w-2.5 h-2.5',
|
|
9
|
+
sm: 'w-3 h-3',
|
|
10
|
+
md: 'w-3.5 h-3.5',
|
|
11
|
+
lg: 'w-6 h-6',
|
|
12
|
+
xl: 'w-10 h-10'
|
|
13
|
+
};
|
|
14
|
+
const offsets = {
|
|
15
|
+
xs: ['left-4', 'left-5'],
|
|
16
|
+
sm: ['left-6', 'left-6'],
|
|
17
|
+
md: ['left-7', 'left-8'],
|
|
18
|
+
lg: ['left-14', 'left-16'],
|
|
19
|
+
xl: ['left-24', 'left-32']
|
|
20
|
+
};
|
|
21
|
+
let dotClass;
|
|
22
|
+
$: dotClass = classNames('absolute rounded-full border-white dark:border-gray-800 border-2', sizes[size], offsets[size][+rounded], top ? 'top-0' : 'bottom-0', rounded && top && 'transform -translate-y-1/2', rounded && !top && 'transform translate-y-1/4', color);
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
{#if show}
|
|
26
|
+
<div class="relative">
|
|
27
|
+
<slot />
|
|
28
|
+
<span class={dotClass} />
|
|
29
|
+
</div>
|
|
30
|
+
{:else}
|
|
31
|
+
<slot />
|
|
32
|
+
{/if}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
show?: boolean;
|
|
5
|
+
top?: boolean;
|
|
6
|
+
color?: string;
|
|
7
|
+
rounded?: boolean;
|
|
8
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {
|
|
14
|
+
default: {};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export declare type DotProps = typeof __propDef.props;
|
|
18
|
+
export declare type DotEvents = typeof __propDef.events;
|
|
19
|
+
export declare type DotSlots = typeof __propDef.slots;
|
|
20
|
+
export default class Dot extends SvelteComponentTyped<DotProps, DotEvents, DotSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<script>export let rounded = false;
|
|
2
|
+
</script>
|
|
3
|
+
|
|
4
|
+
<svg
|
|
5
|
+
class="text-gray-400 bg-gray-200 dark:bg-gray-600 {rounded ? 'rounded' : 'rounded-full'}"
|
|
6
|
+
fill="currentColor"
|
|
7
|
+
viewBox="0 0 16 16"
|
|
8
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
+
>
|
|
10
|
+
<path
|
|
11
|
+
fill-rule="evenodd"
|
|
12
|
+
d="M8 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
|
|
13
|
+
clip-rule="evenodd"
|
|
14
|
+
/>
|
|
15
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
rounded?: boolean;
|
|
5
|
+
};
|
|
6
|
+
events: {
|
|
7
|
+
[evt: string]: CustomEvent<any>;
|
|
8
|
+
};
|
|
9
|
+
slots: {};
|
|
10
|
+
};
|
|
11
|
+
export declare type PlaceholderProps = typeof __propDef.props;
|
|
12
|
+
export declare type PlaceholderEvents = typeof __propDef.events;
|
|
13
|
+
export declare type PlaceholderSlots = typeof __propDef.slots;
|
|
14
|
+
export default class Placeholder extends SvelteComponentTyped<PlaceholderProps, PlaceholderEvents, PlaceholderSlots> {
|
|
15
|
+
}
|
|
16
|
+
export {};
|
package/buttons/Button.svelte
CHANGED
|
@@ -51,11 +51,11 @@ const outlineClasses = {
|
|
|
51
51
|
purple: 'text-purple-700 hover:text-white border border-purple-700 hover:bg-purple-800 focus:ring-purple-300 dark:border-purple-400 dark:text-purple-400 dark:hover:text-white dark:hover:bg-purple-500 dark:focus:ring-purple-900'
|
|
52
52
|
};
|
|
53
53
|
const sizeClasses = {
|
|
54
|
-
xs: '
|
|
55
|
-
sm: '
|
|
56
|
-
md: '
|
|
57
|
-
lg: '
|
|
58
|
-
xl: '
|
|
54
|
+
xs: 'px-3 py-2 text-xs',
|
|
55
|
+
sm: 'px-3 py-2 text-sm',
|
|
56
|
+
md: 'px-5 py-2.5 text-sm',
|
|
57
|
+
lg: 'px-5 py-3 text-base',
|
|
58
|
+
xl: 'px-6 py-3.5 text-base'
|
|
59
59
|
};
|
|
60
60
|
let buttonClass;
|
|
61
61
|
$: buttonClass = classNames('group text-center font-medium focus:ring-4 focus:outline-none', outline && gradient ? 'p-0.5' : 'inline-flex items-center justify-center ' + sizeClasses[size], gradient ? gradientClasses[color] : outline ? outlineClasses[color] : colorClasses[color], pill ? 'rounded-full' : 'rounded-lg', shadow && coloredShadowClasses[shadow], $$props.disabled && 'cursor-not-allowed opacity-50', $$props.class);
|
package/forms/Fileupload.svelte
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
<script>export let value = '';
|
|
2
2
|
export let id = 'user_avatar';
|
|
3
|
-
export let label = 'Upload file';
|
|
4
|
-
export let labelClass = 'block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300" for="user_avatar';
|
|
5
3
|
export let inputClass = 'block w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 cursor-pointer dark:text-gray-400 focus:outline-none focus:border-transparent dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400';
|
|
6
|
-
export let divClass = 'mt-1 text-sm text-gray-500 dark:text-gray-300';
|
|
7
|
-
export let helper = '';
|
|
8
4
|
</script>
|
|
9
5
|
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
{
|
|
6
|
+
<input
|
|
7
|
+
{...$$restProps}
|
|
8
|
+
bind:value
|
|
9
|
+
class={inputClass}
|
|
10
|
+
aria-describedby="{id}_help"
|
|
11
|
+
{id}
|
|
12
|
+
type="file"
|
|
13
|
+
/>
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
+
[x: string]: any;
|
|
4
5
|
value?: string;
|
|
5
6
|
id?: string;
|
|
6
|
-
label?: string;
|
|
7
|
-
labelClass?: string;
|
|
8
7
|
inputClass?: string;
|
|
9
|
-
divClass?: string;
|
|
10
|
-
helper?: string;
|
|
11
8
|
};
|
|
12
9
|
events: {
|
|
13
10
|
[evt: string]: CustomEvent<any>;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
export let id = generateId();
|
|
3
3
|
export let type;
|
|
4
4
|
export let value = '';
|
|
5
|
-
export let name = '';
|
|
6
5
|
export let label = '';
|
|
7
6
|
export let required = false;
|
|
8
7
|
export let divClass = 'relative z-0 mb-6 w-full group';
|
|
@@ -14,6 +13,6 @@ function setType(node) {
|
|
|
14
13
|
</script>
|
|
15
14
|
|
|
16
15
|
<div class={divClass}>
|
|
17
|
-
<input bind:value use:setType
|
|
16
|
+
<input bind:value use:setType class={inputClass} placeholder=" " {...$$restProps} />
|
|
18
17
|
<label for={id} class={labelClass}>{label}</label>
|
|
19
18
|
</div>
|
|
@@ -2,10 +2,10 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
import type { InputType } from '../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
+
[x: string]: any;
|
|
5
6
|
id?: string;
|
|
6
7
|
type: InputType;
|
|
7
8
|
value?: string;
|
|
8
|
-
name?: string;
|
|
9
9
|
label?: string;
|
|
10
10
|
required?: boolean;
|
|
11
11
|
divClass?: string;
|
package/forms/Input.svelte
CHANGED
|
@@ -25,10 +25,6 @@ function setType(node) {
|
|
|
25
25
|
inputClass,
|
|
26
26
|
colorClasses[color],
|
|
27
27
|
{
|
|
28
|
-
// 'pl-10': icon !== null,
|
|
29
|
-
// 'rounded-lg': !($$slots.addon || addon),
|
|
30
|
-
// 'rounded-r-lg': $$slots.addon || addon,
|
|
31
|
-
// 'shadow-sm dark:shadow-sm-light': shadow,
|
|
32
28
|
'p-2 sm:text-xs': size === 'sm',
|
|
33
29
|
'p-2.5 text-sm': size === 'md',
|
|
34
30
|
'sm:text-md p-4': size === 'lg'
|
package/forms/Range.svelte
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script>export let id = 'range';
|
|
2
|
-
export let label = 'Range';
|
|
3
2
|
export let min;
|
|
4
3
|
export let max;
|
|
5
4
|
export let value;
|
|
@@ -17,9 +16,6 @@ else {
|
|
|
17
16
|
}
|
|
18
17
|
</script>
|
|
19
18
|
|
|
20
|
-
<label for={id} class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
|
|
21
|
-
>{label}</label
|
|
22
|
-
>
|
|
23
19
|
<input
|
|
24
20
|
{id}
|
|
25
21
|
name={id}
|
package/forms/Range.svelte.d.ts
CHANGED
package/forms/Select.svelte
CHANGED
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export let value;
|
|
3
|
-
export let id = generateId();
|
|
4
|
-
export let name = '';
|
|
5
|
-
export let label = '';
|
|
6
|
-
export let labelClass = 'block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400';
|
|
1
|
+
<script>export let value;
|
|
7
2
|
export let selectClass = 'bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 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';
|
|
8
3
|
</script>
|
|
9
4
|
|
|
10
|
-
<
|
|
11
|
-
<select bind:value {id} {name} class={selectClass} on:change>
|
|
5
|
+
<select bind:value class={selectClass} {...$$restProps} on:change>
|
|
12
6
|
<slot />
|
|
13
7
|
</select>
|
package/forms/Select.svelte.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.21.
|
|
3
|
+
"version": "0.21.5",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -97,6 +97,8 @@
|
|
|
97
97
|
"./accordions/AccordionItem.svelte": "./accordions/AccordionItem.svelte",
|
|
98
98
|
"./alerts/Alert.svelte": "./alerts/Alert.svelte",
|
|
99
99
|
"./avatar/Avatar.svelte": "./avatar/Avatar.svelte",
|
|
100
|
+
"./avatar/Dot.svelte": "./avatar/Dot.svelte",
|
|
101
|
+
"./avatar/Placeholder.svelte": "./avatar/Placeholder.svelte",
|
|
100
102
|
"./badges/Badge.svelte": "./badges/Badge.svelte",
|
|
101
103
|
"./breadcrumbs/Breadcrumb.svelte": "./breadcrumbs/Breadcrumb.svelte",
|
|
102
104
|
"./breadcrumbs/BreadcrumbItem.svelte": "./breadcrumbs/BreadcrumbItem.svelte",
|
package/types.d.ts
CHANGED
|
@@ -62,6 +62,10 @@ export declare type CrumbType = {
|
|
|
62
62
|
label: string;
|
|
63
63
|
href: string;
|
|
64
64
|
};
|
|
65
|
+
export interface DotType {
|
|
66
|
+
top?: boolean;
|
|
67
|
+
color?: string;
|
|
68
|
+
}
|
|
65
69
|
export declare type DropdownColorType = 'blue' | 'blue-outline' | 'dark' | 'dark-outline' | 'light' | 'green' | 'green-outline' | 'red' | 'red-outline' | 'yellow' | 'yellow-outline' | 'purple' | 'purple-outline';
|
|
66
70
|
export interface DropdownType {
|
|
67
71
|
name: string;
|