flowbite-svelte 0.26.7 → 0.26.10
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 +48 -0
- package/buttons/Button.svelte +18 -19
- package/drawer/Drawer.svelte +55 -0
- package/drawer/Drawer.svelte.d.ts +32 -0
- package/dropdowns/Dropdown.svelte +29 -34
- package/dropdowns/Dropdown.svelte.d.ts +2 -2
- package/dropdowns/DropdownItem.svelte +17 -14
- package/dropdowns/DropdownItem.svelte.d.ts +1 -0
- package/index.d.ts +2 -1
- package/index.js +3 -1
- package/megamenu/MegaMenu.svelte +20 -8
- package/megamenu/MegaMenu.svelte.d.ts +3 -0
- package/navbar/NavHamburger.svelte +5 -9
- package/navbar/NavLi.svelte +8 -7
- package/navbar/NavUl.svelte +13 -11
- package/navbar/Navbar.svelte +7 -21
- package/navbar/Navbar.svelte.d.ts +1 -2
- package/package.json +4 -2
- package/popover/Popover.svelte +13 -15
- package/popover/Popover.svelte.d.ts +1 -0
- package/toolbar/ToolbarButton.svelte +4 -12
- package/tooltips/Tooltip.svelte +14 -9
- package/tooltips/Tooltip.svelte.d.ts +0 -1
- package/typography/A.svelte +3 -2
- package/typography/A.svelte.d.ts +2 -1
- package/typography/Blockquote.svelte +2 -0
- package/typography/Blockquote.svelte.d.ts +1 -0
- package/typography/DescriptionList.svelte +2 -1
- package/typography/DescriptionList.svelte.d.ts +1 -0
- package/typography/Heading.svelte +4 -2
- package/typography/Heading.svelte.d.ts +2 -1
- package/typography/Hr.svelte +8 -7
- package/typography/Hr.svelte.d.ts +1 -0
- package/typography/Img.svelte +15 -10
- package/typography/Img.svelte.d.ts +1 -0
- package/typography/Layout.svelte +2 -1
- package/typography/Layout.svelte.d.ts +1 -0
- package/typography/Li.svelte +2 -1
- package/typography/Li.svelte.d.ts +1 -0
- package/typography/List.svelte +2 -1
- package/typography/List.svelte.d.ts +1 -0
- package/typography/Mark.svelte +4 -3
- package/typography/Mark.svelte.d.ts +2 -1
- package/typography/P.svelte +2 -1
- package/typography/P.svelte.d.ts +1 -0
- package/typography/Secondary.svelte +4 -3
- package/typography/Secondary.svelte.d.ts +2 -1
- package/typography/Span.svelte +2 -1
- package/typography/Span.svelte.d.ts +1 -0
- package/typography/Ul.svelte +2 -1
- package/typography/Ul.svelte.d.ts +1 -0
- package/utils/Chevron.svelte +27 -0
- package/utils/Chevron.svelte.d.ts +20 -0
- package/utils/Frame.svelte +33 -12
- package/utils/Frame.svelte.d.ts +13 -4
- package/utils/Popper.svelte +24 -14
- package/utils/Popper.svelte.d.ts +2 -1
- package/utils/backdrop.d.ts +6 -0
- package/utils/backdrop.js +90 -0
- package/typography/Underline.svelte +0 -7
- package/typography/Underline.svelte.d.ts +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,54 @@
|
|
|
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.10](https://github.com/themesberg/flowbite-svelte/compare/v0.26.9...v0.26.10) (2022-09-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add bgColor and bgOpacity to Drawer component ([8dc01fb](https://github.com/themesberg/flowbite-svelte/commit/8dc01fb9ec82b14d5f893d1255b646630e205ce2))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* 683restProps for toolbarbutton ([6ce830c](https://github.com/themesberg/flowbite-svelte/commit/6ce830c2657c6727835ded2b01728c8830a1a7d2))
|
|
16
|
+
* change ml-2 after get access to ml-1 ([b8ffc2c](https://github.com/themesberg/flowbite-svelte/commit/b8ffc2ca5016737da2d40ed5b83d4ef5fdc07e08))
|
|
17
|
+
* megamenu fullscreen position ([eaf0729](https://github.com/themesberg/flowbite-svelte/commit/eaf07294a728b524f2873df26f8250d23682dd81))
|
|
18
|
+
* navbar updates ([468839b](https://github.com/themesberg/flowbite-svelte/commit/468839bd2efee738787b428ef902cecee3f70e12))
|
|
19
|
+
* remove Figma from image page ([0276b51](https://github.com/themesberg/flowbite-svelte/commit/0276b517fc828e77bfd383be122b514bb0793da0))
|
|
20
|
+
|
|
21
|
+
### [0.26.9](https://github.com/themesberg/flowbite-svelte/compare/v0.26.8...v0.26.9) (2022-09-04)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* add id to typograpy components ([64cbe1b](https://github.com/themesberg/flowbite-svelte/commit/64cbe1b6f2cbe43fdf5cb71a0d82e3a5caad1586))
|
|
27
|
+
* add placement to Drawer component ([1b91e52](https://github.com/themesberg/flowbite-svelte/commit/1b91e52618da8935b326a69161d01f0cc7739158))
|
|
28
|
+
* working on drawer ([07a8e02](https://github.com/themesberg/flowbite-svelte/commit/07a8e02ceac450e7e7ceeb2ad9b98bfac7c7c1cf))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* folder names without s and update tests ([4e9c9ce](https://github.com/themesberg/flowbite-svelte/commit/4e9c9ce69e06b1a8e4394c3920c75606894c06d3))
|
|
34
|
+
* no dropdown docs ([4f92d9b](https://github.com/themesberg/flowbite-svelte/commit/4f92d9b56a53677bed7264b6f044e64a10c42c7e))
|
|
35
|
+
* update Htwo using scroll-mt-20 ([2006490](https://github.com/themesberg/flowbite-svelte/commit/200649069a05c6df4ed0e269d3479526092afe01))
|
|
36
|
+
|
|
37
|
+
### [0.26.8](https://github.com/themesberg/flowbite-svelte/compare/v0.26.7...v0.26.8) (2022-09-03)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Features
|
|
41
|
+
|
|
42
|
+
* dropdown button ([f6347f2](https://github.com/themesberg/flowbite-svelte/commit/f6347f280cbfc552d001aa22128026174b46a6f3))
|
|
43
|
+
* more Frame inheritance ([bb72d69](https://github.com/themesberg/flowbite-svelte/commit/bb72d6952386bd0f6dec4711795e3591a6837c02))
|
|
44
|
+
* popover finalization ([c71481e](https://github.com/themesberg/flowbite-svelte/commit/c71481ec18e2850488d86cfdb583587eae4a19b2))
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
### Bug Fixes
|
|
48
|
+
|
|
49
|
+
* missing 683restProps ([0d52fd1](https://github.com/themesberg/flowbite-svelte/commit/0d52fd1b4168c8cc707c174dc2c18f532cf2e93c))
|
|
50
|
+
* no triggers error ([83075e1](https://github.com/themesberg/flowbite-svelte/commit/83075e1a969bdf93a520bd9e35b339e36bf4f325))
|
|
51
|
+
* remove unused imports ([acb58b9](https://github.com/themesberg/flowbite-svelte/commit/acb58b9144948feeb3c1c14b41a71d2122187340))
|
|
52
|
+
|
|
5
53
|
### [0.26.7](https://github.com/themesberg/flowbite-svelte/compare/v0.26.6...v0.26.7) (2022-09-03)
|
|
6
54
|
|
|
7
55
|
|
package/buttons/Button.svelte
CHANGED
|
@@ -77,7 +77,7 @@ const hasBorder = () => outline || color === 'alternative' || color === 'light';
|
|
|
77
77
|
let buttonClass;
|
|
78
78
|
$: buttonClass = btnClass
|
|
79
79
|
? btnClass
|
|
80
|
-
: classNames('
|
|
80
|
+
: classNames('text-center font-medium', group ? 'focus:ring-2' : 'focus:ring-4', group && 'focus:z-10', !group || color === 'alternative' || (outline && color === 'dark') || 'focus:outline-none', outline && gradient
|
|
81
81
|
? 'p-0.5'
|
|
82
82
|
: 'inline-flex items-center justify-center ' + sizeClasses[size], gradient ? gradientClasses[color] : outline ? outlineClasses[color] : colorClasses[color], color === 'alternative' &&
|
|
83
83
|
(background
|
|
@@ -93,24 +93,23 @@ $: gradientOutlineClass = classNames('inline-flex items-center justify-center',
|
|
|
93
93
|
</script>
|
|
94
94
|
|
|
95
95
|
<svelte:element
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
<!-- Trick to prentend outline without using border
|
|
96
|
+
this={href ? 'a' : 'button'}
|
|
97
|
+
type={href ? undefined : type}
|
|
98
|
+
{href}
|
|
99
|
+
{...$$restProps}
|
|
100
|
+
class={buttonClass}
|
|
101
|
+
on:click
|
|
102
|
+
on:change
|
|
103
|
+
on:keydown
|
|
104
|
+
on:keyup
|
|
105
|
+
on:mouseenter
|
|
106
|
+
on:mouseleave>
|
|
107
|
+
{#if outline && gradient}
|
|
108
|
+
<!-- Trick to prentend outline without using border
|
|
110
109
|
This has a limitation of no supporting transparency as
|
|
111
110
|
background is set to bg-white dark:bg-gray-900 -->
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
111
|
+
<span class={gradientOutlineClass}><slot /></span>
|
|
112
|
+
{:else}
|
|
113
|
+
<slot />
|
|
114
|
+
{/if}
|
|
116
115
|
</svelte:element>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
import { fly, slide, blur, fade } from 'svelte/transition';
|
|
3
|
+
import { clickOutside } from '../utils/clickOutside';
|
|
4
|
+
export let hidden = true;
|
|
5
|
+
export let position = 'fixed';
|
|
6
|
+
export let width = 'w-80';
|
|
7
|
+
export let backdrop = true;
|
|
8
|
+
export let bgColor = 'bg-gray-900';
|
|
9
|
+
export let bgOpacity = 'bg-opacity-75';
|
|
10
|
+
export let placement = 'left';
|
|
11
|
+
export let id = 'drawer-example';
|
|
12
|
+
export let divClass = 'overflow-y-auto z-50 p-4 bg-white dark:bg-gray-800';
|
|
13
|
+
export let transitionParams = {};
|
|
14
|
+
export let transitionType = 'fly';
|
|
15
|
+
function multiple(node, params) {
|
|
16
|
+
switch (transitionType) {
|
|
17
|
+
case 'slide':
|
|
18
|
+
return slide(node, params);
|
|
19
|
+
case 'blur':
|
|
20
|
+
return blur(node, params);
|
|
21
|
+
case 'fly':
|
|
22
|
+
return fly(node, params);
|
|
23
|
+
case 'fade':
|
|
24
|
+
return fade(node, params);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const placements = {
|
|
28
|
+
left: 'inset-y-0 left-0',
|
|
29
|
+
right: 'inset-y-0 right-0',
|
|
30
|
+
top: 'inset-x-0 top-0',
|
|
31
|
+
bottom: 'inset-x-0 bottom-0'
|
|
32
|
+
};
|
|
33
|
+
const handleDrawer = () => {
|
|
34
|
+
hidden = !hidden;
|
|
35
|
+
console.log('clicked');
|
|
36
|
+
};
|
|
37
|
+
let backdropDivClass = classNames('fixed top-0 left-0 z-50 w-full h-full', backdrop && bgColor, backdrop && bgOpacity);
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
{#if !hidden}
|
|
41
|
+
{#if backdrop}
|
|
42
|
+
<div class={backdropDivClass} on:click={() => !hidden && handleDrawer()} />
|
|
43
|
+
{/if}
|
|
44
|
+
<div
|
|
45
|
+
use:clickOutside={() => !hidden && handleDrawer()}
|
|
46
|
+
{id}
|
|
47
|
+
{...$$restProps}
|
|
48
|
+
class={classNames(divClass, width, position, placements[placement], $$props.class)}
|
|
49
|
+
transition:multiple={transitionParams}
|
|
50
|
+
tabindex="-1"
|
|
51
|
+
aria-controls={id}
|
|
52
|
+
aria-labelledby={id}>
|
|
53
|
+
<slot {hidden} />
|
|
54
|
+
</div>
|
|
55
|
+
{/if}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { drawerTransitionParamTypes, drawerTransitionTypes } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
hidden?: boolean;
|
|
7
|
+
position?: 'fixed' | 'absolute';
|
|
8
|
+
width?: string;
|
|
9
|
+
backdrop?: boolean;
|
|
10
|
+
bgColor?: string;
|
|
11
|
+
bgOpacity?: string;
|
|
12
|
+
placement?: 'left' | 'right' | 'top' | 'bottom';
|
|
13
|
+
id?: string;
|
|
14
|
+
divClass?: string;
|
|
15
|
+
transitionParams?: drawerTransitionParamTypes;
|
|
16
|
+
transitionType?: drawerTransitionTypes;
|
|
17
|
+
};
|
|
18
|
+
events: {
|
|
19
|
+
[evt: string]: CustomEvent<any>;
|
|
20
|
+
};
|
|
21
|
+
slots: {
|
|
22
|
+
default: {
|
|
23
|
+
hidden: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
export declare type DrawerProps = typeof __propDef.props;
|
|
28
|
+
export declare type DrawerEvents = typeof __propDef.events;
|
|
29
|
+
export declare type DrawerSlots = typeof __propDef.slots;
|
|
30
|
+
export default class Drawer extends SvelteComponentTyped<DrawerProps, DrawerEvents, DrawerSlots> {
|
|
31
|
+
}
|
|
32
|
+
export {};
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
import Button from '../buttons/Button.svelte';
|
|
3
3
|
import Popper from '../utils/Popper.svelte';
|
|
4
|
-
import
|
|
5
|
-
import ChevronUp from '../utils/ChevronUp.svelte';
|
|
6
|
-
import ChevronRight from '../utils/ChevronRight.svelte';
|
|
7
|
-
import ChevronDown from '../utils/ChevronDown.svelte';
|
|
8
|
-
import ChevronLeft from '../utils/ChevronLeft.svelte';
|
|
4
|
+
import Chevron from '../utils/Chevron.svelte';
|
|
9
5
|
export let label = '';
|
|
10
6
|
export let inline = false;
|
|
11
7
|
export let arrowIcon = true;
|
|
12
8
|
export let labelClass = 'flex items-center justify-between w-full py-2 pl-3 pr-4 font-medium text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 md:w-auto dark:text-gray-400 dark:hover:text-white dark:focus:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent';
|
|
13
9
|
export let placement = 'bottom';
|
|
14
10
|
export let open = false;
|
|
15
|
-
export let
|
|
16
|
-
const icons = {
|
|
17
|
-
top: ChevronUp,
|
|
18
|
-
right: ChevronRight,
|
|
19
|
-
bottom: ChevronDown,
|
|
20
|
-
left: ChevronLeft
|
|
21
|
-
};
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
$: icon = icons[placement.split('-')[0]];
|
|
11
|
+
export let color = 'dropdown';
|
|
24
12
|
let popoverClass;
|
|
25
13
|
$: popoverClass = classNames('outline-none', $$props.class);
|
|
26
14
|
</script>
|
|
@@ -28,33 +16,40 @@ $: popoverClass = classNames('outline-none', $$props.class);
|
|
|
28
16
|
{#if label}
|
|
29
17
|
<slot name="trigger">
|
|
30
18
|
{#if inline}
|
|
31
|
-
<button class={labelClass}
|
|
32
|
-
<slot name="label">{label}</slot>
|
|
19
|
+
<button class={labelClass}>
|
|
33
20
|
{#if arrowIcon}
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
21
|
+
<Chevron {placement}><slot name="label">{label}</slot></Chevron>
|
|
22
|
+
{:else}
|
|
23
|
+
<slot name="label">{label}</slot>
|
|
37
24
|
{/if}
|
|
38
25
|
</button>
|
|
39
26
|
{:else}
|
|
40
|
-
<Button
|
|
41
|
-
<slot name="label">{label}</slot>
|
|
27
|
+
<Button>
|
|
42
28
|
{#if arrowIcon}
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
29
|
+
<Chevron {placement}><slot name="label">{label}</slot></Chevron>
|
|
30
|
+
{:else}
|
|
31
|
+
<slot name="label">{label}</slot>
|
|
46
32
|
{/if}
|
|
47
33
|
</Button>
|
|
48
34
|
{/if}
|
|
49
35
|
</slot>
|
|
50
36
|
{/if}
|
|
51
37
|
|
|
52
|
-
<Popper
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
38
|
+
<Popper
|
|
39
|
+
rounded
|
|
40
|
+
shadow
|
|
41
|
+
activeContent
|
|
42
|
+
{color}
|
|
43
|
+
arrow={false}
|
|
44
|
+
{placement}
|
|
45
|
+
trigger="click"
|
|
46
|
+
{...$$restProps}
|
|
47
|
+
class={popoverClass}
|
|
48
|
+
on:show
|
|
49
|
+
bind:open>
|
|
50
|
+
<slot name="content">
|
|
51
|
+
<ul class="py-1">
|
|
52
|
+
<slot />
|
|
53
|
+
</ul>
|
|
54
|
+
</slot>
|
|
60
55
|
</Popper>
|
|
@@ -7,9 +7,9 @@ declare const __propDef: {
|
|
|
7
7
|
inline?: boolean;
|
|
8
8
|
arrowIcon?: boolean;
|
|
9
9
|
labelClass?: string;
|
|
10
|
-
placement?:
|
|
10
|
+
placement?: Placement;
|
|
11
11
|
open?: boolean;
|
|
12
|
-
|
|
12
|
+
color?: string;
|
|
13
13
|
};
|
|
14
14
|
events: {
|
|
15
15
|
show: CustomEvent<any>;
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
2
|
export let liClass = 'block font-medium cursor-pointer py-2 px-4 text-sm hover:bg-gray-100 dark:hover:bg-gray-600';
|
|
3
3
|
export let color = 'default';
|
|
4
|
+
export let href = undefined;
|
|
4
5
|
const colors = {
|
|
5
6
|
default: 'text-gray-700 dark:text-gray-200 dark:hover:text-white',
|
|
6
7
|
red: 'text-red-600 dark:text-red-500'
|
|
7
8
|
};
|
|
8
9
|
</script>
|
|
9
10
|
|
|
10
|
-
<li
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
11
|
+
<li>
|
|
12
|
+
<svelte:element
|
|
13
|
+
this={href ? 'a' : 'div'}
|
|
14
|
+
{href}
|
|
15
|
+
{...$$restProps}
|
|
16
|
+
class={classNames(liClass, colors[color] ?? colors.default, $$props.class)}
|
|
17
|
+
on:click
|
|
18
|
+
on:change
|
|
19
|
+
on:keydown
|
|
20
|
+
on:keyup
|
|
21
|
+
on:focus
|
|
22
|
+
on:blur
|
|
23
|
+
on:mouseenter
|
|
24
|
+
on:mouseleave>
|
|
25
|
+
<slot />
|
|
26
|
+
</svelte:element>
|
|
24
27
|
</li>
|
package/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export { default as Carousel } from './carousels/Carousel.svelte';
|
|
|
11
11
|
export { default as CarouselTransition } from './carousels/CarouselTransition.svelte';
|
|
12
12
|
export { default as DarkMode } from './darkmode/DarkMode.svelte';
|
|
13
13
|
export { default as Datepicker } from './datepicker/Datepicker.svelte';
|
|
14
|
+
export { default as Drawer } from './drawer/Drawer.svelte';
|
|
14
15
|
export { default as Dropdown } from './dropdowns/Dropdown.svelte';
|
|
15
16
|
export { default as DropdownDivider } from './dropdowns/DropdownDivider.svelte';
|
|
16
17
|
export { default as DropdownHeader } from './dropdowns/DropdownHeader.svelte';
|
|
@@ -49,7 +50,6 @@ export { default as Modal } from './modals/Modal.svelte';
|
|
|
49
50
|
export { default as MegaMenu } from './megamenu/MegaMenu.svelte';
|
|
50
51
|
export { default as Navbar } from './navbar/Navbar.svelte';
|
|
51
52
|
export { default as NavBrand } from './navbar/NavBrand.svelte';
|
|
52
|
-
export { default as NavDropdown } from './navbar/NavDropdown.svelte';
|
|
53
53
|
export { default as NavHamburger } from './navbar/NavHamburger.svelte';
|
|
54
54
|
export { default as NavLi } from './navbar/NavLi.svelte';
|
|
55
55
|
export { default as NavUl } from './navbar/NavUl.svelte';
|
|
@@ -124,5 +124,6 @@ export { default as ChevronDown } from './utils/ChevronDown.svelte';
|
|
|
124
124
|
export { default as ChevronLeft } from './utils/ChevronLeft.svelte';
|
|
125
125
|
export { default as ChevronRight } from './utils/ChevronRight.svelte';
|
|
126
126
|
export { default as ChevronUp } from './utils/ChevronUp.svelte';
|
|
127
|
+
export { default as Chevron } from './utils/Chevron.svelte';
|
|
127
128
|
export { default as InformationCircle } from './utils/InformationCircle.svelte';
|
|
128
129
|
export { default as UserCircle } from './utils/UserCircle.svelte';
|
package/index.js
CHANGED
|
@@ -22,6 +22,8 @@ export { default as CarouselTransition } from './carousels/CarouselTransition.sv
|
|
|
22
22
|
export { default as DarkMode } from './darkmode/DarkMode.svelte';
|
|
23
23
|
// Datepicker
|
|
24
24
|
export { default as Datepicker } from './datepicker/Datepicker.svelte';
|
|
25
|
+
// Drawer
|
|
26
|
+
export { default as Drawer } from './drawer/Drawer.svelte';
|
|
25
27
|
// Dropdown
|
|
26
28
|
export { default as Dropdown } from './dropdowns/Dropdown.svelte';
|
|
27
29
|
export { default as DropdownDivider } from './dropdowns/DropdownDivider.svelte';
|
|
@@ -68,7 +70,6 @@ export { default as MegaMenu } from './megamenu/MegaMenu.svelte';
|
|
|
68
70
|
// Navbar
|
|
69
71
|
export { default as Navbar } from './navbar/Navbar.svelte';
|
|
70
72
|
export { default as NavBrand } from './navbar/NavBrand.svelte';
|
|
71
|
-
export { default as NavDropdown } from './navbar/NavDropdown.svelte';
|
|
72
73
|
export { default as NavHamburger } from './navbar/NavHamburger.svelte';
|
|
73
74
|
export { default as NavLi } from './navbar/NavLi.svelte';
|
|
74
75
|
export { default as NavUl } from './navbar/NavUl.svelte';
|
|
@@ -158,5 +159,6 @@ export { default as ChevronDown } from './utils/ChevronDown.svelte';
|
|
|
158
159
|
export { default as ChevronLeft } from './utils/ChevronLeft.svelte';
|
|
159
160
|
export { default as ChevronRight } from './utils/ChevronRight.svelte';
|
|
160
161
|
export { default as ChevronUp } from './utils/ChevronUp.svelte';
|
|
162
|
+
export { default as Chevron } from './utils/Chevron.svelte';
|
|
161
163
|
export { default as InformationCircle } from './utils/InformationCircle.svelte';
|
|
162
164
|
export { default as UserCircle } from './utils/UserCircle.svelte';
|
package/megamenu/MegaMenu.svelte
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
import Popper from '../utils/Popper.svelte';
|
|
3
3
|
export let items = [];
|
|
4
4
|
export let full = false;
|
|
5
|
-
|
|
5
|
+
export let open = false;
|
|
6
6
|
let wrapperClass;
|
|
7
|
-
$: wrapperClass = classNames(
|
|
7
|
+
$: wrapperClass = classNames(full && 'border-y w-full', $$props.class);
|
|
8
8
|
let ulClass;
|
|
9
|
-
$: ulClass = classNames('grid grid-flow-row gap-y-4 md:gap-x-0 auto-col-max auto-row-max', full && $$slots.extra ? 'grid-cols-2' : 'grid-cols-2 md:grid-cols-3', 'text-sm font-medium',
|
|
9
|
+
$: ulClass = classNames('grid grid-flow-row gap-y-4 md:gap-x-0 auto-col-max auto-row-max', full && $$slots.extra ? 'grid-cols-2' : 'grid-cols-2 md:grid-cols-3', 'text-sm font-medium', full && $$slots.extra && 'md:w-2/3');
|
|
10
10
|
const init = (node) => {
|
|
11
11
|
if (full) {
|
|
12
12
|
node.parentElement.classList.add('inset-x-0');
|
|
@@ -14,8 +14,20 @@ const init = (node) => {
|
|
|
14
14
|
};
|
|
15
15
|
</script>
|
|
16
16
|
|
|
17
|
-
<
|
|
18
|
-
|
|
17
|
+
<Popper
|
|
18
|
+
color={full ? 'default' : 'dropdown'}
|
|
19
|
+
border={!full}
|
|
20
|
+
rounded={!full}
|
|
21
|
+
activeContent
|
|
22
|
+
arrow={false}
|
|
23
|
+
trigger="click"
|
|
24
|
+
placement="bottom"
|
|
25
|
+
yOnly={full}
|
|
26
|
+
{...$$restProps}
|
|
27
|
+
class={wrapperClass}
|
|
28
|
+
on:show
|
|
29
|
+
bind:open>
|
|
30
|
+
<div class="flex flex-col md:flex-row p-4 max-w-screen-md justify-center mx-auto">
|
|
19
31
|
<ul class={ulClass}>
|
|
20
32
|
{#each items as item, index}
|
|
21
33
|
<li>
|
|
@@ -27,4 +39,4 @@ const init = (node) => {
|
|
|
27
39
|
</ul>
|
|
28
40
|
{#if full && $$slots.extra}<div class="md:w-1/3 mt-4 md:mt-0"><slot name="extra" /></div>{/if}
|
|
29
41
|
</div>
|
|
30
|
-
</
|
|
42
|
+
</Popper>
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
-
<script>import
|
|
1
|
+
<script>import ToolbarButton from '../toolbar/ToolbarButton.svelte';
|
|
2
|
+
import classNames from 'classnames';
|
|
2
3
|
import Menu from './Menu.svelte';
|
|
3
|
-
export let btnClass = 'ml-3
|
|
4
|
+
export let btnClass = 'ml-3 md:hidden';
|
|
4
5
|
</script>
|
|
5
6
|
|
|
6
|
-
<
|
|
7
|
-
{...$$restProps}
|
|
8
|
-
class={classNames(btnClass, $$props.class)}
|
|
9
|
-
data-testid="navbar-toggle"
|
|
10
|
-
on:click>
|
|
11
|
-
<span class="sr-only">Open main menu</span>
|
|
7
|
+
<ToolbarButton name="Open main menu" on:click {...$$restProps} class={classNames(btnClass, $$props.class)}>
|
|
12
8
|
<Menu class="h-6 w-6 shrink-0" />
|
|
13
|
-
</
|
|
9
|
+
</ToolbarButton>
|
package/navbar/NavLi.svelte
CHANGED
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
2
|
export let href = '';
|
|
3
3
|
export let active = false;
|
|
4
|
-
export let activeClass = '
|
|
5
|
-
export let nonActiveClass = '
|
|
6
|
-
|
|
4
|
+
export let activeClass = 'text-white bg-blue-700 md:bg-transparent md:text-blue-700 md:dark:text-white dark:bg-blue-600 md:dark:bg-transparent';
|
|
5
|
+
export let nonActiveClass = 'text-gray-700 hover:bg-gray-100 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 dark:text-gray-400 md:dark:hover:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent';
|
|
6
|
+
let liClass;
|
|
7
|
+
$: liClass = classNames('block py-2 pr-4 pl-3 md:p-0 rounded md:border-0', active ? activeClass : nonActiveClass, $$props.class);
|
|
7
8
|
</script>
|
|
8
9
|
|
|
9
10
|
<li>
|
|
10
|
-
<
|
|
11
|
+
<svelte:element
|
|
12
|
+
this={href ? 'a' : 'div'}
|
|
11
13
|
{href}
|
|
12
14
|
{...$$restProps}
|
|
13
15
|
on:blur
|
|
@@ -20,8 +22,7 @@ $: aClass = active ? activeClass : nonActiveClass;
|
|
|
20
22
|
on:mouseenter
|
|
21
23
|
on:mouseleave
|
|
22
24
|
on:mouseover
|
|
23
|
-
class={
|
|
24
|
-
>
|
|
25
|
+
class={liClass}>
|
|
25
26
|
<slot />
|
|
26
|
-
</
|
|
27
|
+
</svelte:element>
|
|
27
28
|
</li>
|
package/navbar/NavUl.svelte
CHANGED
|
@@ -1,25 +1,27 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
2
|
import { slide } from 'svelte/transition';
|
|
3
3
|
import { quintOut } from 'svelte/easing';
|
|
4
|
+
import Frame from '../utils/Frame.svelte';
|
|
4
5
|
export let divClass = 'w-full md:block md:w-auto';
|
|
5
|
-
export let ulClass = 'flex flex-col mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium';
|
|
6
|
+
export let ulClass = 'flex flex-col p-4 mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium';
|
|
6
7
|
export let hidden = true;
|
|
8
|
+
let _divClass;
|
|
9
|
+
$: _divClass = classNames(divClass, $$props.class);
|
|
10
|
+
let _ulClass;
|
|
11
|
+
$: _ulClass = classNames(ulClass,
|
|
12
|
+
// 'divide-y md:divide-y-0 divide-gray-100 dark:divide-gray-700',
|
|
13
|
+
$$props.class);
|
|
7
14
|
</script>
|
|
8
15
|
|
|
9
16
|
{#if !hidden}
|
|
10
|
-
<div
|
|
11
|
-
{
|
|
12
|
-
class={classNames(divClass, $$props.class)}
|
|
13
|
-
id="mobile-menu"
|
|
14
|
-
transition:slide={{ delay: 250, duration: 500, easing: quintOut }}
|
|
15
|
-
>
|
|
16
|
-
<ul class={classNames(ulClass, $$props.class)}>
|
|
17
|
+
<div {...$$restProps} class={_divClass} transition:slide={{ delay: 250, duration: 500, easing: quintOut }}>
|
|
18
|
+
<Frame tag="ul" border rounded color="navbarUl" class={_ulClass}>
|
|
17
19
|
<slot />
|
|
18
|
-
</
|
|
20
|
+
</Frame>
|
|
19
21
|
</div>
|
|
20
22
|
{:else}
|
|
21
|
-
<div {...$$restProps} class={
|
|
22
|
-
<ul class={
|
|
23
|
+
<div {...$$restProps} class={_divClass} {hidden}>
|
|
24
|
+
<ul class={_ulClass}>
|
|
23
25
|
<slot />
|
|
24
26
|
</ul>
|
|
25
27
|
</div>
|
package/navbar/Navbar.svelte
CHANGED
|
@@ -1,31 +1,17 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
|
|
1
|
+
<script>import Frame from '../utils/Frame.svelte';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
export let navClass = 'px-2 sm:px-4 py-2.5';
|
|
3
4
|
export let navDivClass = 'mx-auto flex flex-wrap justify-between items-center ';
|
|
4
5
|
export let fluid = true;
|
|
5
|
-
export let
|
|
6
|
-
export let border = false;
|
|
6
|
+
export let color = 'navbar';
|
|
7
7
|
let hidden = true;
|
|
8
8
|
let toggle = () => {
|
|
9
9
|
hidden = !hidden;
|
|
10
10
|
};
|
|
11
11
|
</script>
|
|
12
12
|
|
|
13
|
-
<nav
|
|
14
|
-
{
|
|
15
|
-
class={classNames(
|
|
16
|
-
navClass,
|
|
17
|
-
{
|
|
18
|
-
rounded: rounded,
|
|
19
|
-
border: border
|
|
20
|
-
},
|
|
21
|
-
$$props.class
|
|
22
|
-
)}
|
|
23
|
-
>
|
|
24
|
-
<div
|
|
25
|
-
class={classNames(navDivClass, {
|
|
26
|
-
container: fluid
|
|
27
|
-
})}
|
|
28
|
-
>
|
|
13
|
+
<Frame tag="nav" {color} {...$$restProps} class={classNames(navClass, $$props.class)}>
|
|
14
|
+
<div class={classNames(navDivClass, fluid && 'container')}>
|
|
29
15
|
<slot {hidden} {toggle} />
|
|
30
16
|
</div>
|
|
31
|
-
</
|
|
17
|
+
</Frame>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.10",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -118,6 +118,7 @@
|
|
|
118
118
|
"./darkmode/DarkMode.svelte": "./darkmode/DarkMode.svelte",
|
|
119
119
|
"./datepicker/Calender.svelte": "./datepicker/Calender.svelte",
|
|
120
120
|
"./datepicker/Datepicker.svelte": "./datepicker/Datepicker.svelte",
|
|
121
|
+
"./drawer/Drawer.svelte": "./drawer/Drawer.svelte",
|
|
121
122
|
"./dropdowns/Dropdown.svelte": "./dropdowns/Dropdown.svelte",
|
|
122
123
|
"./dropdowns/DropdownDivider.svelte": "./dropdowns/DropdownDivider.svelte",
|
|
123
124
|
"./dropdowns/DropdownHeader.svelte": "./dropdowns/DropdownHeader.svelte",
|
|
@@ -232,7 +233,7 @@
|
|
|
232
233
|
"./typography/Secondary.svelte": "./typography/Secondary.svelte",
|
|
233
234
|
"./typography/Span.svelte": "./typography/Span.svelte",
|
|
234
235
|
"./typography/Ul.svelte": "./typography/Ul.svelte",
|
|
235
|
-
"./
|
|
236
|
+
"./utils/Chevron.svelte": "./utils/Chevron.svelte",
|
|
236
237
|
"./utils/ChevronDown.svelte": "./utils/ChevronDown.svelte",
|
|
237
238
|
"./utils/ChevronLeft.svelte": "./utils/ChevronLeft.svelte",
|
|
238
239
|
"./utils/ChevronRight.svelte": "./utils/ChevronRight.svelte",
|
|
@@ -243,6 +244,7 @@
|
|
|
243
244
|
"./utils/Popper.svelte": "./utils/Popper.svelte",
|
|
244
245
|
"./utils/UserCircle.svelte": "./utils/UserCircle.svelte",
|
|
245
246
|
"./utils/Wrapper.svelte": "./utils/Wrapper.svelte",
|
|
247
|
+
"./utils/backdrop": "./utils/backdrop.js",
|
|
246
248
|
"./utils/clickOutside": "./utils/clickOutside.js",
|
|
247
249
|
"./utils/createEventDispatcher": "./utils/createEventDispatcher.js",
|
|
248
250
|
"./utils/focusTrap": "./utils/focusTrap.js",
|