flowbite-svelte 0.26.9 → 0.26.12
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 +41 -0
- package/drawer/Drawer.svelte +4 -3
- package/drawer/Drawer.svelte.d.ts +2 -0
- package/dropdowns/Dropdown.svelte +2 -1
- package/dropdowns/Dropdown.svelte.d.ts +1 -0
- package/dropdowns/DropdownItem.svelte +17 -14
- package/dropdowns/DropdownItem.svelte.d.ts +1 -1
- package/forms/Range.svelte +11 -23
- package/forms/Range.svelte.d.ts +1 -5
- 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 +5 -4
- package/navbar/NavUl.svelte +13 -11
- package/navbar/Navbar.svelte +7 -21
- package/navbar/Navbar.svelte.d.ts +1 -2
- package/package.json +3 -2
- package/progressbars/Progressbar.svelte +13 -15
- package/progressbars/Progressbar.svelte.d.ts +2 -0
- package/toolbar/ToolbarButton.svelte +4 -12
- package/typography/A.svelte +1 -2
- package/typography/A.svelte.d.ts +0 -1
- package/typography/Blockquote.svelte +1 -2
- package/typography/Blockquote.svelte.d.ts +0 -1
- package/typography/DescriptionList.svelte +1 -2
- package/typography/DescriptionList.svelte.d.ts +0 -1
- package/typography/Heading.svelte +1 -2
- package/typography/Heading.svelte.d.ts +0 -1
- package/typography/Hr.svelte +1 -2
- package/typography/Hr.svelte.d.ts +0 -1
- package/typography/Img.svelte +1 -2
- package/typography/Img.svelte.d.ts +0 -1
- package/typography/Layout.svelte +1 -2
- package/typography/Layout.svelte.d.ts +1 -1
- package/typography/Li.svelte +1 -2
- package/typography/Li.svelte.d.ts +0 -1
- package/typography/List.svelte +1 -2
- package/typography/List.svelte.d.ts +0 -1
- package/typography/Mark.svelte +1 -2
- package/typography/Mark.svelte.d.ts +0 -1
- package/typography/P.svelte +1 -2
- package/typography/P.svelte.d.ts +0 -1
- package/typography/Secondary.svelte +1 -2
- package/typography/Secondary.svelte.d.ts +0 -1
- package/typography/Span.svelte +1 -2
- package/typography/Span.svelte.d.ts +0 -1
- package/typography/Ul.svelte +1 -2
- package/typography/Ul.svelte.d.ts +0 -1
- package/utils/Chevron.svelte +11 -7
- package/utils/Chevron.svelte.d.ts +1 -0
- package/utils/Frame.svelte +12 -0
- package/utils/Frame.svelte.d.ts +1 -1
- package/utils/Popper.svelte +11 -1
- package/utils/Popper.svelte.d.ts +2 -0
- package/video/Video.svelte +18 -0
- package/video/Video.svelte.d.ts +20 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,47 @@
|
|
|
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.12](https://github.com/themesberg/flowbite-svelte/compare/v0.26.11...v0.26.12) (2022-09-05)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add labelInsideClass to progressbar component ([fe20cd7](https://github.com/themesberg/flowbite-svelte/commit/fe20cd7f693f21e052dc5adb3fd3eb4bcfa80b76))
|
|
11
|
+
|
|
12
|
+
### [0.26.11](https://github.com/themesberg/flowbite-svelte/compare/v0.26.10...v0.26.11) (2022-09-05)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* range - clean up ([79d35ca](https://github.com/themesberg/flowbite-svelte/commit/79d35ca127094efb20e12ad3e14635cf607edddc))
|
|
18
|
+
* video component and page ([27cd7df](https://github.com/themesberg/flowbite-svelte/commit/27cd7df226dde37e8a598b6693ae8278671d5782))
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* [#266](https://github.com/themesberg/flowbite-svelte/issues/266) change {id} to {...$$restProps} ([b02822f](https://github.com/themesberg/flowbite-svelte/commit/b02822f273fe5b14613ec77e39285078a740cda0))
|
|
24
|
+
* github issue template ([b6b8fd4](https://github.com/themesberg/flowbite-svelte/commit/b6b8fd46aa7491e29935fe62ca5dc617513ee5ee))
|
|
25
|
+
* github issue template 2 ([343c102](https://github.com/themesberg/flowbite-svelte/commit/343c102ee1901c8d14fc75ab06a0fe28ac594a98))
|
|
26
|
+
* github issue template 3 ([e8c6a1b](https://github.com/themesberg/flowbite-svelte/commit/e8c6a1b7d148d0137ca0e395bf5904e3a2ed408c))
|
|
27
|
+
* github issue template 4 ([5565625](https://github.com/themesberg/flowbite-svelte/commit/5565625e343c197bd4d903878a2955eaae08b788))
|
|
28
|
+
* video component and page ([cc8dcb5](https://github.com/themesberg/flowbite-svelte/commit/cc8dcb54843ecff1f9aacc82d9139aedf7d6e0c1))
|
|
29
|
+
|
|
30
|
+
### [0.26.10](https://github.com/themesberg/flowbite-svelte/compare/v0.26.9...v0.26.10) (2022-09-05)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Features
|
|
34
|
+
|
|
35
|
+
* add bgColor and bgOpacity to Drawer component ([8dc01fb](https://github.com/themesberg/flowbite-svelte/commit/8dc01fb9ec82b14d5f893d1255b646630e205ce2))
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
* 683restProps for toolbarbutton ([6ce830c](https://github.com/themesberg/flowbite-svelte/commit/6ce830c2657c6727835ded2b01728c8830a1a7d2))
|
|
41
|
+
* change ml-2 after get access to ml-1 ([b8ffc2c](https://github.com/themesberg/flowbite-svelte/commit/b8ffc2ca5016737da2d40ed5b83d4ef5fdc07e08))
|
|
42
|
+
* megamenu fullscreen position ([eaf0729](https://github.com/themesberg/flowbite-svelte/commit/eaf07294a728b524f2873df26f8250d23682dd81))
|
|
43
|
+
* navbar updates ([468839b](https://github.com/themesberg/flowbite-svelte/commit/468839bd2efee738787b428ef902cecee3f70e12))
|
|
44
|
+
* remove Figma from image page ([0276b51](https://github.com/themesberg/flowbite-svelte/commit/0276b517fc828e77bfd383be122b514bb0793da0))
|
|
45
|
+
|
|
5
46
|
### [0.26.9](https://github.com/themesberg/flowbite-svelte/compare/v0.26.8...v0.26.9) (2022-09-04)
|
|
6
47
|
|
|
7
48
|
|
package/drawer/Drawer.svelte
CHANGED
|
@@ -5,6 +5,8 @@ export let hidden = true;
|
|
|
5
5
|
export let position = 'fixed';
|
|
6
6
|
export let width = 'w-80';
|
|
7
7
|
export let backdrop = true;
|
|
8
|
+
export let bgColor = 'bg-gray-900';
|
|
9
|
+
export let bgOpacity = 'bg-opacity-75';
|
|
8
10
|
export let placement = 'left';
|
|
9
11
|
export let id = 'drawer-example';
|
|
10
12
|
export let divClass = 'overflow-y-auto z-50 p-4 bg-white dark:bg-gray-800';
|
|
@@ -32,13 +34,12 @@ const handleDrawer = () => {
|
|
|
32
34
|
hidden = !hidden;
|
|
33
35
|
console.log('clicked');
|
|
34
36
|
};
|
|
37
|
+
let backdropDivClass = classNames('fixed top-0 left-0 z-50 w-full h-full', backdrop && bgColor, backdrop && bgOpacity);
|
|
35
38
|
</script>
|
|
36
39
|
|
|
37
40
|
{#if !hidden}
|
|
38
41
|
{#if backdrop}
|
|
39
|
-
<div
|
|
40
|
-
class="fixed top-0 left-0 z-50 w-full h-full bg-gray-900/70"
|
|
41
|
-
on:click={() => !hidden && handleDrawer()} />
|
|
42
|
+
<div class={backdropDivClass} on:click={() => !hidden && handleDrawer()} />
|
|
42
43
|
{/if}
|
|
43
44
|
<div
|
|
44
45
|
use:clickOutside={() => !hidden && handleDrawer()}
|
|
@@ -8,6 +8,7 @@ export let arrowIcon = true;
|
|
|
8
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';
|
|
9
9
|
export let placement = 'bottom';
|
|
10
10
|
export let open = false;
|
|
11
|
+
export let color = 'dropdown';
|
|
11
12
|
let popoverClass;
|
|
12
13
|
$: popoverClass = classNames('outline-none', $$props.class);
|
|
13
14
|
</script>
|
|
@@ -36,9 +37,9 @@ $: popoverClass = classNames('outline-none', $$props.class);
|
|
|
36
37
|
|
|
37
38
|
<Popper
|
|
38
39
|
rounded
|
|
39
|
-
border
|
|
40
40
|
shadow
|
|
41
41
|
activeContent
|
|
42
|
+
{color}
|
|
42
43
|
arrow={false}
|
|
43
44
|
{placement}
|
|
44
45
|
trigger="click"
|
|
@@ -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
|
|
4
|
+
export let href = undefined;
|
|
5
5
|
const colors = {
|
|
6
6
|
default: 'text-gray-700 dark:text-gray-200 dark:hover:text-white',
|
|
7
7
|
red: 'text-red-600 dark:text-red-500'
|
|
8
8
|
};
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
|
-
<li
|
|
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/forms/Range.svelte
CHANGED
|
@@ -1,34 +1,22 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
export let min;
|
|
3
|
-
export let max;
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
4
2
|
export let value;
|
|
5
|
-
export let
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
inputClass += 'h-2 mb-6';
|
|
16
|
-
}
|
|
3
|
+
export let size = 'md';
|
|
4
|
+
const sizes = {
|
|
5
|
+
sm: 'h-1 range-sm',
|
|
6
|
+
md: 'h-2',
|
|
7
|
+
lg: 'h-3 range-lg'
|
|
8
|
+
};
|
|
9
|
+
let inputClass;
|
|
10
|
+
$: inputClass = classNames('w-full bg-gray-200 rounded-lg appearance-none cursor-pointer dark:bg-gray-700', sizes[size] ?? sizes.md, $$props.class);
|
|
17
11
|
</script>
|
|
18
12
|
|
|
19
13
|
<input
|
|
20
|
-
{...$$restProps}
|
|
21
|
-
{id}
|
|
22
|
-
name={id}
|
|
23
14
|
type="range"
|
|
24
|
-
{min}
|
|
25
|
-
{max}
|
|
26
15
|
bind:value
|
|
27
|
-
{
|
|
16
|
+
{...$$restProps}
|
|
28
17
|
class={inputClass}
|
|
29
18
|
on:change
|
|
30
19
|
on:click
|
|
31
20
|
on:keydown
|
|
32
21
|
on:keypress
|
|
33
|
-
on:keyup
|
|
34
|
-
/>
|
|
22
|
+
on:keyup />
|
package/forms/Range.svelte.d.ts
CHANGED
|
@@ -2,12 +2,8 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
id?: string;
|
|
6
|
-
min: number;
|
|
7
|
-
max: number;
|
|
8
5
|
value: number;
|
|
9
|
-
|
|
10
|
-
size: 'small' | 'large';
|
|
6
|
+
size?: 'sm' | 'md' | 'lg';
|
|
11
7
|
};
|
|
12
8
|
events: {
|
|
13
9
|
change: Event;
|
package/index.d.ts
CHANGED
|
@@ -50,7 +50,6 @@ export { default as Modal } from './modals/Modal.svelte';
|
|
|
50
50
|
export { default as MegaMenu } from './megamenu/MegaMenu.svelte';
|
|
51
51
|
export { default as Navbar } from './navbar/Navbar.svelte';
|
|
52
52
|
export { default as NavBrand } from './navbar/NavBrand.svelte';
|
|
53
|
-
export { default as NavDropdown } from './navbar/NavDropdown.svelte';
|
|
54
53
|
export { default as NavHamburger } from './navbar/NavHamburger.svelte';
|
|
55
54
|
export { default as NavLi } from './navbar/NavLi.svelte';
|
|
56
55
|
export { default as NavUl } from './navbar/NavUl.svelte';
|
|
@@ -125,5 +124,7 @@ export { default as ChevronDown } from './utils/ChevronDown.svelte';
|
|
|
125
124
|
export { default as ChevronLeft } from './utils/ChevronLeft.svelte';
|
|
126
125
|
export { default as ChevronRight } from './utils/ChevronRight.svelte';
|
|
127
126
|
export { default as ChevronUp } from './utils/ChevronUp.svelte';
|
|
127
|
+
export { default as Chevron } from './utils/Chevron.svelte';
|
|
128
128
|
export { default as InformationCircle } from './utils/InformationCircle.svelte';
|
|
129
129
|
export { default as UserCircle } from './utils/UserCircle.svelte';
|
|
130
|
+
export { default as Video } from './video/Video.svelte';
|
package/index.js
CHANGED
|
@@ -70,7 +70,6 @@ export { default as MegaMenu } from './megamenu/MegaMenu.svelte';
|
|
|
70
70
|
// Navbar
|
|
71
71
|
export { default as Navbar } from './navbar/Navbar.svelte';
|
|
72
72
|
export { default as NavBrand } from './navbar/NavBrand.svelte';
|
|
73
|
-
export { default as NavDropdown } from './navbar/NavDropdown.svelte';
|
|
74
73
|
export { default as NavHamburger } from './navbar/NavHamburger.svelte';
|
|
75
74
|
export { default as NavLi } from './navbar/NavLi.svelte';
|
|
76
75
|
export { default as NavUl } from './navbar/NavUl.svelte';
|
|
@@ -160,5 +159,8 @@ export { default as ChevronDown } from './utils/ChevronDown.svelte';
|
|
|
160
159
|
export { default as ChevronLeft } from './utils/ChevronLeft.svelte';
|
|
161
160
|
export { default as ChevronRight } from './utils/ChevronRight.svelte';
|
|
162
161
|
export { default as ChevronUp } from './utils/ChevronUp.svelte';
|
|
162
|
+
export { default as Chevron } from './utils/Chevron.svelte';
|
|
163
163
|
export { default as InformationCircle } from './utils/InformationCircle.svelte';
|
|
164
164
|
export { default as UserCircle } from './utils/UserCircle.svelte';
|
|
165
|
+
// video
|
|
166
|
+
export { default as Video } from './video/Video.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,9 +1,10 @@
|
|
|
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>
|
|
@@ -21,7 +22,7 @@ $: aClass = active ? activeClass : nonActiveClass;
|
|
|
21
22
|
on:mouseenter
|
|
22
23
|
on:mouseleave
|
|
23
24
|
on:mouseover
|
|
24
|
-
class={
|
|
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.12",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -248,7 +248,8 @@
|
|
|
248
248
|
"./utils/clickOutside": "./utils/clickOutside.js",
|
|
249
249
|
"./utils/createEventDispatcher": "./utils/createEventDispatcher.js",
|
|
250
250
|
"./utils/focusTrap": "./utils/focusTrap.js",
|
|
251
|
-
"./utils/generateId": "./utils/generateId.js"
|
|
251
|
+
"./utils/generateId": "./utils/generateId.js",
|
|
252
|
+
"./video/Video.svelte": "./video/Video.svelte"
|
|
252
253
|
},
|
|
253
254
|
"svelte": "./index.js"
|
|
254
255
|
}
|
|
@@ -4,6 +4,7 @@ export let size = 'h-2.5';
|
|
|
4
4
|
export let labelInside = false;
|
|
5
5
|
export let labelOutside = '';
|
|
6
6
|
export let color = 'blue';
|
|
7
|
+
export let labelInsideClass = 'text-blue-100 text-xs font-medium text-center p-0.5 leading-none rounded-full';
|
|
7
8
|
// let barColor: string;
|
|
8
9
|
const barColors = {
|
|
9
10
|
blue: 'bg-blue-600',
|
|
@@ -17,20 +18,17 @@ const barColors = {
|
|
|
17
18
|
</script>
|
|
18
19
|
|
|
19
20
|
{#if labelOutside}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
<div {...$$restProps} class={classNames('flex justify-between mb-1', $$props.class)}>
|
|
22
|
+
<span class="text-base font-medium text-blue-700 dark:text-white">{labelOutside}</span>
|
|
23
|
+
<span class="text-sm font-medium text-blue-700 dark:text-white">{progress}%</span>
|
|
24
|
+
</div>
|
|
24
25
|
{/if}
|
|
25
|
-
<div class=
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
{:else}
|
|
34
|
-
<div class={classNames(barColors[color], size, 'rounded-full')} style="width: {progress}%" />
|
|
35
|
-
{/if}
|
|
26
|
+
<div class={classNames('w-full bg-gray-200 rounded-full dark:bg-gray-700', size, $$props.class)}>
|
|
27
|
+
{#if labelInside}
|
|
28
|
+
<div class={classNames(labelInsideClass, barColors[color])} style="width: {progress}%">
|
|
29
|
+
{progress}%
|
|
30
|
+
</div>
|
|
31
|
+
{:else}
|
|
32
|
+
<div class={classNames(barColors[color], size, 'rounded-full')} style="width: {progress}%" />
|
|
33
|
+
{/if}
|
|
36
34
|
</div>
|
|
@@ -2,11 +2,13 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
import type { Colors } from '../types';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
|
+
[x: string]: any;
|
|
5
6
|
progress?: string;
|
|
6
7
|
size?: string;
|
|
7
8
|
labelInside?: boolean;
|
|
8
9
|
labelOutside?: string;
|
|
9
10
|
color?: Colors;
|
|
11
|
+
labelInsideClass?: string;
|
|
10
12
|
};
|
|
11
13
|
events: {
|
|
12
14
|
[evt: string]: CustomEvent<any>;
|
|
@@ -23,9 +23,7 @@ const sizing = {
|
|
|
23
23
|
};
|
|
24
24
|
let buttonClass;
|
|
25
25
|
$: buttonClass = classNames('focus:outline-none whitespace-normal', sizing[size], colors[color], color === 'default' &&
|
|
26
|
-
(background
|
|
27
|
-
? 'hover:bg-gray-100 dark:hover:bg-gray-600'
|
|
28
|
-
: 'hover:bg-gray-100 dark:hover:bg-gray-700'), $$props.class);
|
|
26
|
+
(background ? 'hover:bg-gray-100 dark:hover:bg-gray-600' : 'hover:bg-gray-100 dark:hover:bg-gray-700'), $$props.class);
|
|
29
27
|
const svgSizes = {
|
|
30
28
|
xs: 'w-3 h-3',
|
|
31
29
|
sm: 'w-3.5 h-3.5',
|
|
@@ -33,20 +31,14 @@ const svgSizes = {
|
|
|
33
31
|
};
|
|
34
32
|
</script>
|
|
35
33
|
|
|
36
|
-
<button on:click type="button" class={buttonClass} aria-label={ariaLabel ?? name}>
|
|
34
|
+
<button on:click type="button" {...$$restProps} class={buttonClass} aria-label={ariaLabel ?? name}>
|
|
37
35
|
{#if name}<span class="sr-only">{name}</span>{/if}
|
|
38
36
|
<slot>
|
|
39
|
-
<svg
|
|
40
|
-
class={svgSizes[size]}
|
|
41
|
-
fill="currentColor"
|
|
42
|
-
viewBox="0 0 20 20"
|
|
43
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
44
|
-
>
|
|
37
|
+
<svg class={svgSizes[size]} fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
|
|
45
38
|
<path
|
|
46
39
|
fill-rule="evenodd"
|
|
47
40
|
d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z"
|
|
48
|
-
clip-rule="evenodd"
|
|
49
|
-
/>
|
|
41
|
+
clip-rule="evenodd" />
|
|
50
42
|
</svg>
|
|
51
43
|
</slot>
|
|
52
44
|
</button>
|
package/typography/A.svelte
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let id;
|
|
3
2
|
export let href = '#';
|
|
4
3
|
export let color = 'text-blue-600 dark:text-blue-500';
|
|
5
4
|
export let aClass = 'inline-flex items-center hover:underline';
|
|
6
5
|
</script>
|
|
7
6
|
|
|
8
|
-
<a {
|
|
7
|
+
<a {...$$restProps} {href} class={classNames(aClass, color, $$props.class)}>
|
|
9
8
|
<slot />
|
|
10
9
|
</a>
|
package/typography/A.svelte.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let id;
|
|
3
2
|
export let border = false;
|
|
4
3
|
export let italic = true;
|
|
5
4
|
export let borderClass = 'border-l-4 border-gray-300 dark:border-gray-500';
|
|
@@ -31,7 +30,7 @@ const sizes = {
|
|
|
31
30
|
</script>
|
|
32
31
|
|
|
33
32
|
<blockquote
|
|
34
|
-
{
|
|
33
|
+
{...$$restProps}
|
|
35
34
|
class={classNames(
|
|
36
35
|
baseClass,
|
|
37
36
|
alignmentClasses[alignment],
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let id;
|
|
3
2
|
export let tag;
|
|
4
3
|
export let dtClass = 'text-gray-500 md:text-lg dark:text-gray-400';
|
|
5
4
|
export let ddClass = 'text-lg font-semibold';
|
|
6
5
|
let classDesc = classNames(tag === 'dt' ? dtClass : ddClass, $$props.class);
|
|
7
6
|
</script>
|
|
8
7
|
|
|
9
|
-
<svelte:element this={tag} {
|
|
8
|
+
<svelte:element this={tag} {...$$restProps} class={classDesc}>
|
|
10
9
|
<slot />
|
|
11
10
|
</svelte:element>
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
export let tag = 'h1';
|
|
3
3
|
export let color = 'text-gray-900 dark:text-white';
|
|
4
4
|
export let customSize;
|
|
5
|
-
export let id;
|
|
6
5
|
const textSizes = {
|
|
7
6
|
h1: 'text-5xl font-extrabold',
|
|
8
7
|
h2: 'text-4xl font-bold',
|
|
@@ -15,7 +14,7 @@ const textSizes = {
|
|
|
15
14
|
|
|
16
15
|
<svelte:element
|
|
17
16
|
this={tag}
|
|
18
|
-
{
|
|
17
|
+
{...$$restProps}
|
|
19
18
|
class={classNames(customSize ? customSize : textSizes[tag], color, 'w-full', $$props.class)}>
|
|
20
19
|
<slot />
|
|
21
20
|
</svelte:element>
|
package/typography/Hr.svelte
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let id;
|
|
3
2
|
export let icon = false;
|
|
4
3
|
export let width = 'w-full';
|
|
5
4
|
export let height = 'h-px';
|
|
@@ -14,7 +13,7 @@ let middleClass = classNames(middleBgColor, icon ? iconDivClass : textSpanClass)
|
|
|
14
13
|
</script>
|
|
15
14
|
|
|
16
15
|
{#if $$slots}
|
|
17
|
-
<div class={classDiv}
|
|
16
|
+
<div {...$$restProps} class={classDiv}>
|
|
18
17
|
<hr class={horizontalClass} />
|
|
19
18
|
<div class={middleClass}>
|
|
20
19
|
<slot />
|
package/typography/Img.svelte
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let id;
|
|
3
2
|
export let caption = undefined;
|
|
4
3
|
export let src = undefined;
|
|
5
4
|
export let srcset = undefined;
|
|
@@ -23,7 +22,7 @@ export let captionClass = 'mt-2 text-sm text-center text-gray-500 dark:text-gray
|
|
|
23
22
|
</figure>
|
|
24
23
|
{:else}
|
|
25
24
|
<img
|
|
26
|
-
{
|
|
25
|
+
{...$$restProps}
|
|
27
26
|
class={classNames(imgClass, size, alignment, effect, $$props.class)}
|
|
28
27
|
{src}
|
|
29
28
|
{srcset}
|
package/typography/Layout.svelte
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let id;
|
|
3
2
|
export let divClass = 'grid';
|
|
4
3
|
export let cols = 'grid-cols-1 sm:grid-cols-2';
|
|
5
4
|
export let gap;
|
|
6
5
|
let classDiv = classNames(divClass, 'gap-' + String(gap), cols);
|
|
7
6
|
</script>
|
|
8
7
|
|
|
9
|
-
<div {
|
|
8
|
+
<div {...$$restProps} class={classDiv}>
|
|
10
9
|
<slot />
|
|
11
10
|
</div>
|
package/typography/Li.svelte
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let id;
|
|
3
2
|
export let icon = false;
|
|
4
3
|
export let liClass = '';
|
|
5
4
|
let classLi = classNames(liClass, icon && 'flex items-center', $$props.class);
|
|
6
5
|
</script>
|
|
7
6
|
|
|
8
|
-
<li {
|
|
7
|
+
<li {...$$restProps} class={classLi}>
|
|
9
8
|
<slot />
|
|
10
9
|
</li>
|
package/typography/List.svelte
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let id;
|
|
3
2
|
export let tag = 'ul';
|
|
4
3
|
export let list = 'disc';
|
|
5
4
|
export let position = 'inside';
|
|
@@ -19,6 +18,6 @@ let positions = {
|
|
|
19
18
|
let classList = classNames(color, tag === 'ul' ? ulClass : 'ol' ? olClass : dlClass, lists[list], positions[position], $$props.class);
|
|
20
19
|
</script>
|
|
21
20
|
|
|
22
|
-
<svelte:element this={tag} {
|
|
21
|
+
<svelte:element this={tag} {...$$restProps} class={classList}>
|
|
23
22
|
<slot />
|
|
24
23
|
</svelte:element>
|
package/typography/Mark.svelte
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let id;
|
|
3
2
|
export let color = 'text-white dark:bg-blue-500';
|
|
4
3
|
export let bgColor = 'bg-blue-600';
|
|
5
4
|
export let markClass = 'px-2 rounded';
|
|
6
5
|
</script>
|
|
7
6
|
|
|
8
|
-
<mark {
|
|
7
|
+
<mark {...$$restProps} class={classNames(markClass, bgColor, color, $$props.class)}>
|
|
9
8
|
<slot />
|
|
10
9
|
</mark>
|
package/typography/P.svelte
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let id;
|
|
3
2
|
export let color = 'text-gray-900 dark:text-white';
|
|
4
3
|
export let height = 'normal';
|
|
5
4
|
export let align = 'left';
|
|
@@ -73,6 +72,6 @@ let colorAndopacity = color
|
|
|
73
72
|
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);
|
|
74
73
|
</script>
|
|
75
74
|
|
|
76
|
-
<p {
|
|
75
|
+
<p {...$$restProps} class={classP}>
|
|
77
76
|
<slot />
|
|
78
77
|
</p>
|
package/typography/P.svelte.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let id;
|
|
3
2
|
export let color = 'text-gray-500 dark:text-gray-400';
|
|
4
3
|
export let secondaryClass = 'font-semibold';
|
|
5
4
|
</script>
|
|
6
5
|
|
|
7
|
-
<small {
|
|
6
|
+
<small {...$$restProps} class={classNames(color, secondaryClass, $$props.class)}>
|
|
8
7
|
<slot />
|
|
9
8
|
</small>
|
package/typography/Span.svelte
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let id;
|
|
3
2
|
export let italic = false;
|
|
4
3
|
export let underline = false;
|
|
5
4
|
export let linethrough = false;
|
|
@@ -13,6 +12,6 @@ let underlineClass = classNames('underline', decorationClass);
|
|
|
13
12
|
let classSpan = classNames(italic && 'italic', underline && underlineClass, linethrough && 'line-through', uppercase && 'uppercase', gradient ? gradientClass : 'font-semibold text-gray-900 dark:text-white', highlight && highlightClass, $$props.class);
|
|
14
13
|
</script>
|
|
15
14
|
|
|
16
|
-
<span {
|
|
15
|
+
<span {...$$restProps} class={classSpan}>
|
|
17
16
|
<slot />
|
|
18
17
|
</span>
|
package/typography/Ul.svelte
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let id;
|
|
3
2
|
export let list = 'disc';
|
|
4
3
|
export let position = 'inside';
|
|
5
4
|
export let ulClass = 'max-w-md text-gray-500 dark:text-gray-400';
|
|
@@ -16,6 +15,6 @@ let classUl = classNames(ulClass, lists[list], positions[position], $$props.clas
|
|
|
16
15
|
console.log('list', list);
|
|
17
16
|
</script>
|
|
18
17
|
|
|
19
|
-
<ul {
|
|
18
|
+
<ul {...$$restProps} class={classUl} {list}>
|
|
20
19
|
<slot />
|
|
21
20
|
</ul>
|
package/utils/Chevron.svelte
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
import ChevronLeft from './ChevronLeft.svelte';
|
|
3
3
|
import ChevronUp from './ChevronUp.svelte';
|
|
4
4
|
import ChevronRight from './ChevronRight.svelte';
|
|
5
|
+
import Wrapper from './Wrapper.svelte';
|
|
5
6
|
export let placement = 'bottom';
|
|
7
|
+
export let aligned = false;
|
|
6
8
|
const icons = {
|
|
7
9
|
top: ChevronUp,
|
|
8
10
|
right: ChevronRight,
|
|
@@ -14,10 +16,12 @@ let icon;
|
|
|
14
16
|
$: icon = icons[placement.split('-')[0]] ?? ChevronDown;
|
|
15
17
|
</script>
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
{
|
|
19
|
+
<Wrapper class="flex items-center justify-between" show={aligned}>
|
|
20
|
+
{#if placement.split('-')[0] === 'left'}
|
|
21
|
+
<ChevronLeft class="h-4 w-4 mr-2" />
|
|
22
|
+
<slot />
|
|
23
|
+
{:else}
|
|
24
|
+
<slot />
|
|
25
|
+
<svelte:component this={icon} class="h-4 w-4 ml-2" />
|
|
26
|
+
{/if}
|
|
27
|
+
</Wrapper>
|
package/utils/Frame.svelte
CHANGED
|
@@ -29,6 +29,10 @@ const bgColors = {
|
|
|
29
29
|
light: 'bg-gray-50 dark:bg-gray-700',
|
|
30
30
|
dark: 'bg-gray-100 dark:bg-gray-700',
|
|
31
31
|
default: 'bg-white dark:bg-gray-800',
|
|
32
|
+
dropdown: 'bg-white dark:bg-gray-700',
|
|
33
|
+
navbar: 'bg-white dark:bg-gray-900',
|
|
34
|
+
navbarUl: 'bg-gray-50 dark:bg-gray-800',
|
|
35
|
+
form: 'bg-gray-50 dark:bg-gray-700',
|
|
32
36
|
none: ''
|
|
33
37
|
};
|
|
34
38
|
const textColors = {
|
|
@@ -43,6 +47,10 @@ const textColors = {
|
|
|
43
47
|
light: 'text-gray-700 dark:text-gray-300',
|
|
44
48
|
dark: 'text-gray-700 dark:text-gray-300',
|
|
45
49
|
default: 'text-gray-500 dark:text-gray-400',
|
|
50
|
+
dropdown: 'text-gray-500 dark:text-gray-400',
|
|
51
|
+
navbar: 'text-gray-700 dark:text-gray-200',
|
|
52
|
+
navbarUl: 'text-gray-700 dark:text-gray-400',
|
|
53
|
+
from: 'text-gray-900 dark:text-white',
|
|
46
54
|
none: ''
|
|
47
55
|
};
|
|
48
56
|
const borderColors = {
|
|
@@ -57,6 +65,10 @@ const borderColors = {
|
|
|
57
65
|
light: 'border-gray-500',
|
|
58
66
|
dark: 'border-gray-500',
|
|
59
67
|
default: 'border-gray-200 dark:border-gray-700',
|
|
68
|
+
dropdown: 'border-gray-100 dark:border-gray-700',
|
|
69
|
+
navbar: 'border-gray-100 dark:border-gray-700',
|
|
70
|
+
navbarUl: 'border-gray-100 dark:border-gray-700',
|
|
71
|
+
form: 'border-gray-300 dark:border-gray-700',
|
|
60
72
|
none: ''
|
|
61
73
|
};
|
|
62
74
|
// have a custom transition function that returns the desired transition
|
package/utils/Frame.svelte.d.ts
CHANGED
package/utils/Popper.svelte
CHANGED
|
@@ -9,7 +9,9 @@ export let offset = 8;
|
|
|
9
9
|
export let placement = 'top';
|
|
10
10
|
export let trigger = 'hover';
|
|
11
11
|
export let triggeredBy = undefined;
|
|
12
|
+
export let strategy = 'absolute';
|
|
12
13
|
export let open = false;
|
|
14
|
+
export let yOnly = false;
|
|
13
15
|
const dispatch = createEventDispatcher();
|
|
14
16
|
let clickable;
|
|
15
17
|
$: clickable = trigger === 'click';
|
|
@@ -53,8 +55,16 @@ const hideHandler = (ev) => {
|
|
|
53
55
|
function init(node, _triggerEl) {
|
|
54
56
|
popper = createPopper(_triggerEl, node, {
|
|
55
57
|
placement,
|
|
58
|
+
strategy,
|
|
56
59
|
modifiers: [
|
|
57
|
-
{
|
|
60
|
+
{
|
|
61
|
+
name: 'offset',
|
|
62
|
+
options: {
|
|
63
|
+
offset: ({ placement, reference, popper }) => {
|
|
64
|
+
return [yOnly ? popper.width / 2 - reference.width / 2 - reference.x : 0, offset];
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
58
68
|
{ name: 'eventListeners', enabled: open }
|
|
59
69
|
]
|
|
60
70
|
});
|
package/utils/Popper.svelte.d.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
// export let width;
|
|
3
|
+
// export let controls: boolean = true;
|
|
4
|
+
// export let autoplay: boolean = false;
|
|
5
|
+
export let src;
|
|
6
|
+
export let type = 'video/mp4';
|
|
7
|
+
// export let attribute = '';
|
|
8
|
+
let videoClass = classNames($$props.class);
|
|
9
|
+
// const setAttribute = (node, params) => {
|
|
10
|
+
// node.setAttribute(params, '');
|
|
11
|
+
// };
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<video {...$$restProps} class={videoClass}>
|
|
15
|
+
<source {src} {type} />
|
|
16
|
+
<slot />
|
|
17
|
+
Your browser does not support the video tag.
|
|
18
|
+
</video>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
src: string;
|
|
6
|
+
type?: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare type VideoProps = typeof __propDef.props;
|
|
16
|
+
export declare type VideoEvents = typeof __propDef.events;
|
|
17
|
+
export declare type VideoSlots = typeof __propDef.slots;
|
|
18
|
+
export default class Video extends SvelteComponentTyped<VideoProps, VideoEvents, VideoSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|