flowbite-svelte 0.26.13 → 0.26.16
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 +30 -0
- package/drawer/Drawer.svelte +8 -4
- package/drawer/Drawer.svelte.d.ts +4 -0
- package/dropdowns/DropdownItem.svelte +22 -16
- package/forms/Radio.svelte +2 -3
- package/forms/Select.svelte +4 -4
- package/forms/Select.svelte.d.ts +1 -1
- package/package.json +20 -16
- package/toasts/Toast.svelte +15 -14
- package/typography/Heading.svelte +1 -1
- package/typography/Heading.svelte.d.ts +1 -1
- package/typography/P.svelte +1 -3
- package/typography/P.svelte.d.ts +1 -1
- package/utils/Popper.svelte +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
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.26.16](https://github.com/themesberg/flowbite-svelte/compare/v0.26.15...v0.26.16) (2022-09-06)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add offset position props to Drawer and example in the drawer page ([680d358](https://github.com/themesberg/flowbite-svelte/commit/680d358ef3d55df202ae2bcaf5deb9c3e6834c18))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* [#273](https://github.com/themesberg/flowbite-svelte/issues/273) remove number from select value type ([529510b](https://github.com/themesberg/flowbite-svelte/commit/529510bc50e561b544175a350390d7f32291727c))
|
|
16
|
+
* [#274](https://github.com/themesberg/flowbite-svelte/issues/274) change the links to singular for blocks components ([7378935](https://github.com/themesberg/flowbite-svelte/commit/73789353f4d598722db88cecb595303e8d60ac31))
|
|
17
|
+
* index blocks names, e.g. Tooltips to Tooltip ([5f902b2](https://github.com/themesberg/flowbite-svelte/commit/5f902b22043838a3e3413679632c9516ea81b906))
|
|
18
|
+
|
|
19
|
+
### [0.26.15](https://github.com/themesberg/flowbite-svelte/compare/v0.26.14...v0.26.15) (2022-09-06)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Bug Fixes
|
|
23
|
+
|
|
24
|
+
* dropdowns events docs ([a6d86b6](https://github.com/themesberg/flowbite-svelte/commit/a6d86b671a5c481288a20c1fe68cfcfe0faea880))
|
|
25
|
+
* dropdowns tweaks ([ad797ca](https://github.com/themesberg/flowbite-svelte/commit/ad797ca4a4a60abd7723b3b1415e70fb6e1328a6))
|
|
26
|
+
|
|
27
|
+
### [0.26.14](https://github.com/themesberg/flowbite-svelte/compare/v0.26.13...v0.26.14) (2022-09-06)
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* Heading and P update ([2313e3e](https://github.com/themesberg/flowbite-svelte/commit/2313e3e5ecb38ee69839a26b12b7c41cc099f75e))
|
|
33
|
+
* toast transitions ([6659682](https://github.com/themesberg/flowbite-svelte/commit/6659682250ab9d2337f06c2b424431366cf9ced0))
|
|
34
|
+
|
|
5
35
|
### [0.26.13](https://github.com/themesberg/flowbite-svelte/compare/v0.26.12...v0.26.13) (2022-09-05)
|
|
6
36
|
|
|
7
37
|
|
package/drawer/Drawer.svelte
CHANGED
|
@@ -3,6 +3,10 @@ import { fly, slide, blur, fade } from 'svelte/transition';
|
|
|
3
3
|
import { clickOutside } from '../utils/clickOutside';
|
|
4
4
|
export let hidden = true;
|
|
5
5
|
export let position = 'fixed';
|
|
6
|
+
export let leftOffset = 'inset-y-0 left-0';
|
|
7
|
+
export let rightOffset = 'inset-y-0right-0';
|
|
8
|
+
export let topOffset = 'inset-x-0 top-0';
|
|
9
|
+
export let bottomOffset = 'inset-x-0 bottom-0';
|
|
6
10
|
export let width = 'w-80';
|
|
7
11
|
export let backdrop = true;
|
|
8
12
|
export let bgColor = 'bg-gray-900';
|
|
@@ -25,10 +29,10 @@ function multiple(node, params) {
|
|
|
25
29
|
}
|
|
26
30
|
}
|
|
27
31
|
const placements = {
|
|
28
|
-
left:
|
|
29
|
-
right:
|
|
30
|
-
top:
|
|
31
|
-
bottom:
|
|
32
|
+
left: leftOffset,
|
|
33
|
+
right: rightOffset,
|
|
34
|
+
top: topOffset,
|
|
35
|
+
bottom: bottomOffset
|
|
32
36
|
};
|
|
33
37
|
const handleDrawer = () => {
|
|
34
38
|
hidden = !hidden;
|
|
@@ -8,20 +8,26 @@ const colors = {
|
|
|
8
8
|
};
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
11
|
+
{#if href}
|
|
12
|
+
<li>
|
|
13
|
+
<svelte:element
|
|
14
|
+
this={href ? 'a' : 'div'}
|
|
15
|
+
{href}
|
|
16
|
+
{...$$restProps}
|
|
17
|
+
class={classNames(liClass, colors[color] ?? colors.default, $$props.class)}
|
|
18
|
+
on:click
|
|
19
|
+
on:change
|
|
20
|
+
on:keydown
|
|
21
|
+
on:keyup
|
|
22
|
+
on:focus
|
|
23
|
+
on:blur
|
|
24
|
+
on:mouseenter
|
|
25
|
+
on:mouseleave>
|
|
26
|
+
<slot />
|
|
27
|
+
</svelte:element>
|
|
28
|
+
</li>
|
|
29
|
+
{:else}
|
|
30
|
+
<li class={classNames(liClass, colors[color] ?? colors.default, $$props.class)}>
|
|
25
31
|
<slot />
|
|
26
|
-
</
|
|
27
|
-
|
|
32
|
+
</li>
|
|
33
|
+
{/if}
|
package/forms/Radio.svelte
CHANGED
|
@@ -37,7 +37,7 @@ export let value = '';
|
|
|
37
37
|
let background = getContext('background');
|
|
38
38
|
</script>
|
|
39
39
|
|
|
40
|
-
<Label class={labelClass(inline, $$props.class)} show={
|
|
40
|
+
<Label class={labelClass(inline, $$props.class)} show={$$slots.default}>
|
|
41
41
|
<input
|
|
42
42
|
type="radio"
|
|
43
43
|
bind:group
|
|
@@ -54,6 +54,5 @@ let background = getContext('background');
|
|
|
54
54
|
on:paste
|
|
55
55
|
{value}
|
|
56
56
|
{...$$restProps}
|
|
57
|
-
class={inputClass(custom, color, false, background, $$slots.default || $$props.class)}
|
|
58
|
-
/><slot />
|
|
57
|
+
class={inputClass(custom, color, false, background, $$slots.default || $$props.class)} /><slot />
|
|
59
58
|
</Label>
|
package/forms/Select.svelte
CHANGED
|
@@ -17,9 +17,9 @@ $: selectClass = classNames(common, underline ? underlineClass : defaultClass, s
|
|
|
17
17
|
</script>
|
|
18
18
|
|
|
19
19
|
<select {...$$restProps} bind:value class={selectClass} on:change on:input>
|
|
20
|
-
|
|
20
|
+
<option disabled selected value="">{placeholder}</option>
|
|
21
21
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
22
|
+
{#each items as { value, name }}
|
|
23
|
+
<option {value}>{name}</option>
|
|
24
|
+
{/each}
|
|
25
25
|
</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.26.
|
|
3
|
+
"version": "0.26.16",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -49,11 +49,11 @@
|
|
|
49
49
|
"accordion",
|
|
50
50
|
"alert",
|
|
51
51
|
"avatar",
|
|
52
|
-
"
|
|
53
|
-
"
|
|
54
|
-
"button-
|
|
55
|
-
"
|
|
56
|
-
"
|
|
52
|
+
"badge",
|
|
53
|
+
"breadcrumb",
|
|
54
|
+
"button-group",
|
|
55
|
+
"button",
|
|
56
|
+
"card",
|
|
57
57
|
"carousel",
|
|
58
58
|
"darkmode",
|
|
59
59
|
"dropdown",
|
|
@@ -61,19 +61,22 @@
|
|
|
61
61
|
"forms",
|
|
62
62
|
"kbd",
|
|
63
63
|
"list group",
|
|
64
|
+
"mega menu",
|
|
64
65
|
"modal",
|
|
65
66
|
"navbar",
|
|
66
|
-
"
|
|
67
|
-
"
|
|
67
|
+
"pagination",
|
|
68
|
+
"progressbar",
|
|
68
69
|
"rating",
|
|
69
|
-
"
|
|
70
|
+
"sidebar",
|
|
70
71
|
"skeleton",
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"tooltip"
|
|
72
|
+
"spinner",
|
|
73
|
+
"table",
|
|
74
|
+
"tab",
|
|
75
|
+
"timeline",
|
|
76
|
+
"toast",
|
|
77
|
+
"tooltip",
|
|
78
|
+
"typography",
|
|
79
|
+
"video"
|
|
77
80
|
],
|
|
78
81
|
"repository": {
|
|
79
82
|
"type": "git",
|
|
@@ -93,7 +96,8 @@
|
|
|
93
96
|
"Zoltán Szőgyényi <zoltan@themesberg.com>",
|
|
94
97
|
"Robert Tanislav <robert@themesberg.com>",
|
|
95
98
|
"Victor Cordos <victor@themesberg.com>",
|
|
96
|
-
"Shinichi Okada <okada.shin@gmail.com>"
|
|
99
|
+
"Shinichi Okada <okada.shin@gmail.com>",
|
|
100
|
+
"Jakub Jagielka <jjagielka@gmail.com>"
|
|
97
101
|
],
|
|
98
102
|
"exports": {
|
|
99
103
|
"./package.json": "./package.json",
|
package/toasts/Toast.svelte
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>import Frame from '../utils/Frame.svelte';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
import CloseButton from '../utils/CloseButton.svelte';
|
|
4
|
+
import { fade } from 'svelte/transition';
|
|
4
5
|
export let color = 'blue';
|
|
5
6
|
export let simple = false;
|
|
6
7
|
// Absolute position
|
|
@@ -18,19 +19,19 @@ $: iconClass = classNames('inline-flex items-center justify-center flex-shrink-0
|
|
|
18
19
|
</script>
|
|
19
20
|
|
|
20
21
|
{#if visible}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
<Frame rounded border transition={fade} {...$$restProps} class={classDiv} role="alert">
|
|
23
|
+
<div class="flex {$$slots.extra ? 'items-start' : 'items-center'}">
|
|
24
|
+
{#if $$slots.icon}
|
|
25
|
+
<Frame {color} rounded class={iconClass}><slot name="icon" /></Frame>
|
|
26
|
+
{/if}
|
|
26
27
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
<div class="text-sm font-normal w-full">
|
|
29
|
+
<slot />
|
|
30
|
+
<slot name="extra" />
|
|
31
|
+
</div>
|
|
32
|
+
{#if !simple}
|
|
33
|
+
<CloseButton on:click={() => (visible = false)} />
|
|
34
|
+
{/if}
|
|
35
|
+
</div>
|
|
36
|
+
</Frame>
|
|
36
37
|
{/if}
|
package/typography/P.svelte
CHANGED
|
@@ -10,7 +10,7 @@ export let opacity;
|
|
|
10
10
|
export let whitespace = 'normal';
|
|
11
11
|
export let size = 'base';
|
|
12
12
|
export let space;
|
|
13
|
-
export let weight;
|
|
13
|
+
export let weight = 'normal';
|
|
14
14
|
const sizes = {
|
|
15
15
|
xs: 'text-xs',
|
|
16
16
|
sm: 'text-sm',
|
|
@@ -67,8 +67,6 @@ let colorAndopacity = color
|
|
|
67
67
|
.map((element) => element.trim())
|
|
68
68
|
.map((element) => element + '/' + String(opacity))
|
|
69
69
|
.join(' ');
|
|
70
|
-
// console.log('colorArr', colorAndopacity);
|
|
71
|
-
// console.log(typeof colorAndopacity);
|
|
72
70
|
let classP = classNames(size && sizes[size], (opacity && colorAndopacity) || (color && color), height && heights[height], weight && weights[weight], space && spaces[space], align && aligns[align], justify && 'text-justify', italic && 'italic', firstupper && upperClass, whitespace && whitespaces[whitespace], $$props.class);
|
|
73
71
|
</script>
|
|
74
72
|
|
package/typography/P.svelte.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ declare const __propDef: {
|
|
|
13
13
|
whitespace?: 'normal' | 'nowrap' | 'pre' | 'preline' | 'prewrap';
|
|
14
14
|
size?: 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
|
|
15
15
|
space: 'tighter' | 'tight' | 'normal' | 'wide' | 'wider' | 'widest';
|
|
16
|
-
weight
|
|
16
|
+
weight?: 'thin' | 'extralight' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black';
|
|
17
17
|
};
|
|
18
18
|
events: {
|
|
19
19
|
[evt: string]: CustomEvent<any>;
|
package/utils/Popper.svelte
CHANGED
|
@@ -61,11 +61,13 @@ function init(node, _triggerEl) {
|
|
|
61
61
|
name: 'offset',
|
|
62
62
|
options: {
|
|
63
63
|
offset: ({ placement, reference, popper }) => {
|
|
64
|
+
// for full screen mega menu
|
|
64
65
|
return [yOnly ? popper.width / 2 - reference.width / 2 - reference.x : 0, offset];
|
|
65
66
|
}
|
|
66
67
|
}
|
|
67
68
|
},
|
|
68
|
-
{ name: 'eventListeners', enabled: open }
|
|
69
|
+
{ name: 'eventListeners', enabled: open },
|
|
70
|
+
{ name: 'flip', enabled: false }
|
|
69
71
|
]
|
|
70
72
|
});
|
|
71
73
|
return {
|
|
@@ -127,8 +129,7 @@ onMount(() => {
|
|
|
127
129
|
on:mouseenter={showHandler}
|
|
128
130
|
on:mouseleave={activeContent && !clickable ? hideHandler : undefined}
|
|
129
131
|
{...$$restProps}
|
|
130
|
-
class={classNames('z-10', $$props.class)}
|
|
131
|
-
style="position: absolute;">
|
|
132
|
+
class={classNames('z-10', $$props.class)}>
|
|
132
133
|
<slot />
|
|
133
134
|
{#if arrow}<div data-popper-arrow />{/if}
|
|
134
135
|
</Frame>
|