flowbite-svelte 0.13.7 → 0.14.0
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 +37 -0
- package/README.md +4 -0
- package/breadcrumbs/Breadcrumb.svelte +49 -0
- package/breadcrumbs/Breadcrumb.svelte.d.ts +22 -0
- package/cards/Card.svelte +41 -23
- package/cards/Card.svelte.d.ts +0 -1
- package/carousels/Caption.svelte +7 -0
- package/carousels/Caption.svelte.d.ts +17 -0
- package/carousels/Carousel.svelte +132 -0
- package/carousels/Carousel.svelte.d.ts +25 -0
- package/carousels/CarouselTransition.svelte +155 -0
- package/carousels/CarouselTransition.svelte.d.ts +27 -0
- package/carousels/Indicator.svelte +11 -0
- package/carousels/Indicator.svelte.d.ts +20 -0
- package/carousels/Slide.svelte +9 -0
- package/carousels/Slide.svelte.d.ts +19 -0
- package/carousels/Thumbnail.svelte +14 -0
- package/carousels/Thumbnail.svelte.d.ts +23 -0
- package/forms/Input.svelte +24 -2
- package/forms/Input.svelte.d.ts +1 -0
- package/forms/Textarea.svelte +2 -1
- package/forms/Textarea.svelte.d.ts +1 -0
- package/index.d.ts +3 -0
- package/index.js +8 -1
- package/navbar/Navbar.svelte +52 -26
- package/package.json +22 -15
- package/paginations/TableData.svelte +1 -1
- package/tables/TableSearch.svelte.d.ts +1 -1
- package/types.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,43 @@
|
|
|
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.13.10](https://github.com/shinokada/flowbite-svelte/compare/v0.13.9...v0.13.10) (2022-04-16)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* add a space in front of from /index ([32beb0e](https://github.com/shinokada/flowbite-svelte/commit/32beb0e9d3fd7c9c92e34ccc8d690a9f8361c780))
|
|
11
|
+
* add Breadcrumb to md files ([6ea1d24](https://github.com/shinokada/flowbite-svelte/commit/6ea1d246ef2ed47f87ec764634fad6729700d286))
|
|
12
|
+
* add btnLabel=Read more ([0730167](https://github.com/shinokada/flowbite-svelte/commit/073016733d50fddc70e78e38520eabf0a912236c))
|
|
13
|
+
* update h1 for breadcrumb ([8bfef6a](https://github.com/shinokada/flowbite-svelte/commit/8bfef6a93f69dbbf4fb667ba0d177059181b6cdb))
|
|
14
|
+
* update h1 in index pages ([e4d1a52](https://github.com/shinokada/flowbite-svelte/commit/e4d1a5284c5ce5f1d981e377263f97c2a2d00485))
|
|
15
|
+
* update layouts for breadcrumb ([1c07955](https://github.com/shinokada/flowbite-svelte/commit/1c07955215fe7a48e3e5573c5c657d59978b5fe4))
|
|
16
|
+
|
|
17
|
+
### [0.13.9](https://github.com/shinokada/flowbite-svelte/compare/v0.13.8...v0.13.9) (2022-04-16)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Features
|
|
21
|
+
|
|
22
|
+
* add focus on load to Input component ([5d0c7fb](https://github.com/shinokada/flowbite-svelte/commit/5d0c7fb7750aac2dc0df2ddd24a7c11cd66404c6))
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* add 100% to pre tag ([3c8eaf2](https://github.com/shinokada/flowbite-svelte/commit/3c8eaf257697c48121cc79496885e05309b302bc))
|
|
28
|
+
* Input padding uses p-4, p-2.5 and p-2 depends on the size ([632bd5d](https://github.com/shinokada/flowbite-svelte/commit/632bd5d550b0268a93eec91598b35a854a45c081))
|
|
29
|
+
* logo ([c28e9f3](https://github.com/shinokada/flowbite-svelte/commit/c28e9f3683140e1bb12f4667e26e5d7805d4ddb9))
|
|
30
|
+
* moved p-tag and h3 tag css to app.css ([cb3d08e](https://github.com/shinokada/flowbite-svelte/commit/cb3d08edb98d96cadad9975e20488af55f4fa344))
|
|
31
|
+
* refresh dev environment ([3a1b452](https://github.com/shinokada/flowbite-svelte/commit/3a1b452f925e14b2d159456c8f1f50b2972ae52b))
|
|
32
|
+
* update carousel page ([27c621b](https://github.com/shinokada/flowbite-svelte/commit/27c621b5f7a97896635ddbc2aa9cccf624275e80))
|
|
33
|
+
* update main nav. add transition to carousel ([3a9f572](https://github.com/shinokada/flowbite-svelte/commit/3a9f5723af8f54ef58c6902af5599114cc81fb86))
|
|
34
|
+
|
|
35
|
+
### [0.13.8](https://github.com/shinokada/flowbite-svelte/compare/v0.13.7...v0.13.8) (2022-04-14)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Features
|
|
39
|
+
|
|
40
|
+
* add carousel components ([846a99d](https://github.com/shinokada/flowbite-svelte/commit/846a99dde2f45246493fac99790c220da257eefd))
|
|
41
|
+
|
|
5
42
|
### [0.13.7](https://github.com/shinokada/flowbite-svelte/compare/v0.13.6...v0.13.7) (2022-04-13)
|
|
6
43
|
|
|
7
44
|
|
package/README.md
CHANGED
|
@@ -57,6 +57,10 @@
|
|
|
57
57
|
- [List Card](https://flowbite-svelte.vercel.app/cards/list)
|
|
58
58
|
- [Signin Card](https://flowbite-svelte.vercel.app/cards/signin)
|
|
59
59
|
|
|
60
|
+
## Carousel components
|
|
61
|
+
|
|
62
|
+
- [Carousel](https://flowbite-svelte.vercel.app/carousels)
|
|
63
|
+
|
|
60
64
|
## Dark mode components
|
|
61
65
|
|
|
62
66
|
- [Dark mode](https://flowbite-svelte.vercel.app/darkmode)
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
<script >export let crumbs = [];
|
|
2
|
+
export let homeClass = 'inline-flex items-center text-sm font-medium text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white';
|
|
3
|
+
export let crumbClass = 'ml-1 text-sm font-medium text-gray-700 hover:text-gray-900 md:ml-2 dark:text-gray-400 dark:hover:text-white';
|
|
4
|
+
export let solid = false;
|
|
5
|
+
let navClass = 'flex';
|
|
6
|
+
if (solid) {
|
|
7
|
+
navClass =
|
|
8
|
+
'flex py-3 px-5 text-gray-700 bg-gray-50 rounded-lg border border-gray-200 dark:bg-gray-800 dark:border-gray-700';
|
|
9
|
+
}
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<nav class={navClass} aria-label="Breadcrumb">
|
|
13
|
+
<ol class="inline-flex items-center space-x-1 md:space-x-3">
|
|
14
|
+
{#each crumbs as crumb}
|
|
15
|
+
{#if crumb.href === '/'}
|
|
16
|
+
<li class="inline-flex items-center">
|
|
17
|
+
<a href={crumb.href} class={homeClass}>
|
|
18
|
+
<svg
|
|
19
|
+
class="mr-2 w-4 h-4"
|
|
20
|
+
fill="currentColor"
|
|
21
|
+
viewBox="0 0 20 20"
|
|
22
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
23
|
+
><path
|
|
24
|
+
d="M10.707 2.293a1 1 0 00-1.414 0l-7 7a1 1 0 001.414 1.414L4 10.414V17a1 1 0 001 1h2a1 1 0 001-1v-2a1 1 0 011-1h2a1 1 0 011 1v2a1 1 0 001 1h2a1 1 0 001-1v-6.586l.293.293a1 1 0 001.414-1.414l-7-7z"
|
|
25
|
+
/></svg
|
|
26
|
+
>
|
|
27
|
+
{crumb.label}</a
|
|
28
|
+
>
|
|
29
|
+
</li>
|
|
30
|
+
{:else}
|
|
31
|
+
<li>
|
|
32
|
+
<div class="flex items-center">
|
|
33
|
+
<svg
|
|
34
|
+
class="w-6 h-6 text-gray-400"
|
|
35
|
+
fill="currentColor"
|
|
36
|
+
viewBox="0 0 20 20"
|
|
37
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
38
|
+
><path
|
|
39
|
+
fill-rule="evenodd"
|
|
40
|
+
d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
|
|
41
|
+
clip-rule="evenodd"
|
|
42
|
+
/></svg
|
|
43
|
+
><a href={crumb.href} class={crumbClass}>{crumb.label}</a>
|
|
44
|
+
</div>
|
|
45
|
+
</li>
|
|
46
|
+
{/if}
|
|
47
|
+
{/each}
|
|
48
|
+
</ol>
|
|
49
|
+
</nav>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
crumbs?: {
|
|
5
|
+
label: string;
|
|
6
|
+
href: string;
|
|
7
|
+
}[];
|
|
8
|
+
homeClass?: string;
|
|
9
|
+
crumbClass?: string;
|
|
10
|
+
solid?: boolean;
|
|
11
|
+
};
|
|
12
|
+
events: {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export declare type BreadcrumbProps = typeof __propDef.props;
|
|
18
|
+
export declare type BreadcrumbEvents = typeof __propDef.events;
|
|
19
|
+
export declare type BreadcrumbSlots = typeof __propDef.slots;
|
|
20
|
+
export default class Breadcrumb extends SvelteComponentTyped<BreadcrumbProps, BreadcrumbEvents, BreadcrumbSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
package/cards/Card.svelte
CHANGED
|
@@ -2,40 +2,48 @@
|
|
|
2
2
|
export let rel = '';
|
|
3
3
|
export let alt = '';
|
|
4
4
|
export let img = '';
|
|
5
|
-
export let btnLabel = '
|
|
5
|
+
export let btnLabel = '';
|
|
6
6
|
export let btnColor = 'blue';
|
|
7
7
|
export let textdivClass = 'p-5';
|
|
8
|
-
export let paragraphClass = 'mb-3 font-normal text-gray-700 dark:text-gray-400';
|
|
9
8
|
export let headerClass = 'mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white';
|
|
10
|
-
export let header = '
|
|
9
|
+
export let header = '';
|
|
11
10
|
export let divClass = 'max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700';
|
|
12
11
|
let buttonClass;
|
|
13
12
|
if (btnColor === 'blue') {
|
|
14
|
-
buttonClass =
|
|
13
|
+
buttonClass =
|
|
14
|
+
'inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
15
15
|
}
|
|
16
16
|
else if (btnColor === 'gray') {
|
|
17
|
-
buttonClass =
|
|
17
|
+
buttonClass =
|
|
18
|
+
'inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-gray-700 rounded-lg hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800';
|
|
18
19
|
}
|
|
19
20
|
else if (btnColor === 'red') {
|
|
20
|
-
buttonClass =
|
|
21
|
+
buttonClass =
|
|
22
|
+
'inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-red-700 rounded-lg hover:bg-red-800 focus:ring-4 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800';
|
|
21
23
|
}
|
|
22
24
|
else if (btnColor === 'yellow') {
|
|
23
|
-
buttonClass =
|
|
25
|
+
buttonClass =
|
|
26
|
+
'inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-yellow-700 rounded-lg hover:bg-yellow-800 focus:ring-4 focus:ring-yellow-300 dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800';
|
|
24
27
|
}
|
|
25
28
|
else if (btnColor === 'green') {
|
|
26
|
-
buttonClass =
|
|
29
|
+
buttonClass =
|
|
30
|
+
'inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-green-700 rounded-lg hover:bg-green-800 focus:ring-4 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800';
|
|
27
31
|
}
|
|
28
32
|
else if (btnColor === 'indigo') {
|
|
29
|
-
buttonClass =
|
|
33
|
+
buttonClass =
|
|
34
|
+
'inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-indigo-700 rounded-lg hover:bg-indigo-800 focus:ring-4 focus:ring-indigo-300 dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800';
|
|
30
35
|
}
|
|
31
36
|
else if (btnColor === 'purple') {
|
|
32
|
-
buttonClass =
|
|
37
|
+
buttonClass =
|
|
38
|
+
'inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-purple-700 rounded-lg hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800';
|
|
33
39
|
}
|
|
34
40
|
else if (btnColor === 'pink') {
|
|
35
|
-
buttonClass =
|
|
41
|
+
buttonClass =
|
|
42
|
+
'inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-pink-700 rounded-lg hover:bg-pink-800 focus:ring-4 focus:ring-pink-300 dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800';
|
|
36
43
|
}
|
|
37
44
|
else {
|
|
38
|
-
buttonClass =
|
|
45
|
+
buttonClass =
|
|
46
|
+
'inline-flex items-center py-2 px-3 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
|
|
39
47
|
}
|
|
40
48
|
</script>
|
|
41
49
|
|
|
@@ -50,26 +58,36 @@ else {
|
|
|
50
58
|
{/if}
|
|
51
59
|
{/if}
|
|
52
60
|
<div class={textdivClass}>
|
|
53
|
-
{#if
|
|
54
|
-
|
|
61
|
+
{#if header}
|
|
62
|
+
{#if link}
|
|
63
|
+
<a href={link} {rel}>
|
|
64
|
+
<h3 class={headerClass}>
|
|
65
|
+
{header}
|
|
66
|
+
</h3>
|
|
67
|
+
</a>
|
|
68
|
+
{:else}
|
|
55
69
|
<h3 class={headerClass}>
|
|
56
70
|
{header}
|
|
57
71
|
</h3>
|
|
58
|
-
|
|
59
|
-
{:else}
|
|
60
|
-
<h3 class={headerClass}>
|
|
61
|
-
{header}
|
|
62
|
-
</h3>
|
|
72
|
+
{/if}
|
|
63
73
|
{/if}
|
|
64
74
|
{#if $$slots.paragraph}
|
|
65
|
-
<
|
|
66
|
-
<slot name="paragraph" />
|
|
67
|
-
</p>
|
|
75
|
+
<slot name="paragraph" />
|
|
68
76
|
{/if}
|
|
69
77
|
{#if link}
|
|
70
78
|
<a href={link} {rel} class={buttonClass}>
|
|
71
79
|
{btnLabel}
|
|
72
|
-
<svg
|
|
80
|
+
<svg
|
|
81
|
+
class="ml-2 -mr-1 w-4 h-4"
|
|
82
|
+
fill="currentColor"
|
|
83
|
+
viewBox="0 0 20 20"
|
|
84
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
85
|
+
><path
|
|
86
|
+
fill-rule="evenodd"
|
|
87
|
+
d="M10.293 3.293a1 1 0 011.414 0l6 6a1 1 0 010 1.414l-6 6a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-4.293-4.293a1 1 0 010-1.414z"
|
|
88
|
+
clip-rule="evenodd"
|
|
89
|
+
/></svg
|
|
90
|
+
>
|
|
73
91
|
</a>
|
|
74
92
|
{/if}
|
|
75
93
|
</div>
|
package/cards/Card.svelte.d.ts
CHANGED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
caption?: string;
|
|
5
|
+
captionClass?: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {};
|
|
11
|
+
};
|
|
12
|
+
export declare type CaptionProps = typeof __propDef.props;
|
|
13
|
+
export declare type CaptionEvents = typeof __propDef.events;
|
|
14
|
+
export declare type CaptionSlots = typeof __propDef.slots;
|
|
15
|
+
export default class Caption extends SvelteComponentTyped<CaptionProps, CaptionEvents, CaptionSlots> {
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
<script >import Slide from './Slide.svelte';
|
|
2
|
+
import Thumbnail from './Thumbnail.svelte';
|
|
3
|
+
import Caption from './Caption.svelte';
|
|
4
|
+
import Indicator from './Indicator.svelte';
|
|
5
|
+
export let showIndicators = true;
|
|
6
|
+
export let showCaptions = true;
|
|
7
|
+
export let showThumbs = true;
|
|
8
|
+
export let images;
|
|
9
|
+
export let slideControls = true;
|
|
10
|
+
// Carousel
|
|
11
|
+
export let divClass = 'overflow-hidden relative h-56 rounded-lg sm:h-64 xl:h-80 2xl:h-96';
|
|
12
|
+
export let indicatorDivClass = 'flex absolute bottom-5 left-1/2 z-30 space-x-3 -translate-x-1/2';
|
|
13
|
+
// Caption
|
|
14
|
+
export let captionClass = 'h-10 bg-gray-300 dark:bg-gray-700 dark:text-white p-2 my-2 text-center';
|
|
15
|
+
// Indicator
|
|
16
|
+
export let indicatorClass = 'w-3 h-3 rounded-full bg-gray-100 hover:bg-gray-300 opacity-60';
|
|
17
|
+
// Slide
|
|
18
|
+
export let slideClass = '';
|
|
19
|
+
let imageShowingIndex = 0;
|
|
20
|
+
// $: console.log(imageShowingIndex);
|
|
21
|
+
$: image = images[imageShowingIndex];
|
|
22
|
+
const nextSlide = () => {
|
|
23
|
+
if (imageShowingIndex === images.length - 1) {
|
|
24
|
+
imageShowingIndex = 0;
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
imageShowingIndex += 1;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
const prevSlide = () => {
|
|
31
|
+
if (imageShowingIndex === 0) {
|
|
32
|
+
imageShowingIndex = images.length - 1;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
imageShowingIndex -= 1;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const goToSlide = (number) => (imageShowingIndex = number);
|
|
39
|
+
let thumbWidth = 100 / images.length;
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<div id="default-carousel" class="relative">
|
|
43
|
+
<div class={divClass}>
|
|
44
|
+
<Slide image={image.imgurl} altTag={image.name} attr={image.attribution} {slideClass} />
|
|
45
|
+
</div>
|
|
46
|
+
{#if showIndicators}
|
|
47
|
+
<!-- Slider indicators -->
|
|
48
|
+
<div class={indicatorDivClass}>
|
|
49
|
+
{#each images as { id, imgurl, name, attribution }}
|
|
50
|
+
<Indicator
|
|
51
|
+
{name}
|
|
52
|
+
selected={imageShowingIndex === id}
|
|
53
|
+
on:click={() => goToSlide(id)}
|
|
54
|
+
{indicatorClass}
|
|
55
|
+
/>
|
|
56
|
+
{/each}
|
|
57
|
+
</div>
|
|
58
|
+
{/if}
|
|
59
|
+
{#if slideControls}
|
|
60
|
+
<!-- Slider controls -->
|
|
61
|
+
<button
|
|
62
|
+
on:click={prevSlide}
|
|
63
|
+
type="button"
|
|
64
|
+
class="flex absolute top-0 left-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none"
|
|
65
|
+
data-carousel-prev
|
|
66
|
+
>
|
|
67
|
+
<span
|
|
68
|
+
class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none"
|
|
69
|
+
>
|
|
70
|
+
<svg
|
|
71
|
+
class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300"
|
|
72
|
+
fill="none"
|
|
73
|
+
stroke="currentColor"
|
|
74
|
+
viewBox="0 0 24 24"
|
|
75
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
76
|
+
><path
|
|
77
|
+
stroke-linecap="round"
|
|
78
|
+
stroke-linejoin="round"
|
|
79
|
+
stroke-width="2"
|
|
80
|
+
d="M15 19l-7-7 7-7"
|
|
81
|
+
/></svg
|
|
82
|
+
>
|
|
83
|
+
<span class="hidden">Previous</span>
|
|
84
|
+
</span>
|
|
85
|
+
</button>
|
|
86
|
+
<button
|
|
87
|
+
on:click={nextSlide}
|
|
88
|
+
type="button"
|
|
89
|
+
class="flex absolute top-0 right-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none"
|
|
90
|
+
data-carousel-next
|
|
91
|
+
>
|
|
92
|
+
<span
|
|
93
|
+
class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none"
|
|
94
|
+
>
|
|
95
|
+
<svg
|
|
96
|
+
class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300"
|
|
97
|
+
fill="none"
|
|
98
|
+
stroke="currentColor"
|
|
99
|
+
viewBox="0 0 24 24"
|
|
100
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
101
|
+
><path
|
|
102
|
+
stroke-linecap="round"
|
|
103
|
+
stroke-linejoin="round"
|
|
104
|
+
stroke-width="2"
|
|
105
|
+
d="M9 5l7 7-7 7"
|
|
106
|
+
/></svg
|
|
107
|
+
>
|
|
108
|
+
<span class="hidden">Next</span>
|
|
109
|
+
</span>
|
|
110
|
+
</button>
|
|
111
|
+
{/if}
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
{#if showCaptions}
|
|
115
|
+
<Caption caption={images[imageShowingIndex].name} {captionClass} />
|
|
116
|
+
{/if}
|
|
117
|
+
|
|
118
|
+
{#if showThumbs}
|
|
119
|
+
<div class="flex flex-row justify-center bg-gray-100">
|
|
120
|
+
{#each images as { id, imgurl, name, attribution }}
|
|
121
|
+
<Thumbnail
|
|
122
|
+
{thumbWidth}
|
|
123
|
+
thumbImg={imgurl}
|
|
124
|
+
altTag={name}
|
|
125
|
+
titleLink={attribution}
|
|
126
|
+
{id}
|
|
127
|
+
selected={imageShowingIndex === id}
|
|
128
|
+
on:click={() => goToSlide(id)}
|
|
129
|
+
/>
|
|
130
|
+
{/each}
|
|
131
|
+
</div>
|
|
132
|
+
{/if}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
showIndicators?: boolean;
|
|
5
|
+
showCaptions?: boolean;
|
|
6
|
+
showThumbs?: boolean;
|
|
7
|
+
images: any[];
|
|
8
|
+
slideControls?: boolean;
|
|
9
|
+
divClass?: string;
|
|
10
|
+
indicatorDivClass?: string;
|
|
11
|
+
captionClass?: string;
|
|
12
|
+
indicatorClass?: string;
|
|
13
|
+
slideClass?: string;
|
|
14
|
+
};
|
|
15
|
+
events: {
|
|
16
|
+
[evt: string]: CustomEvent<any>;
|
|
17
|
+
};
|
|
18
|
+
slots: {};
|
|
19
|
+
};
|
|
20
|
+
export declare type CarouselProps = typeof __propDef.props;
|
|
21
|
+
export declare type CarouselEvents = typeof __propDef.events;
|
|
22
|
+
export declare type CarouselSlots = typeof __propDef.slots;
|
|
23
|
+
export default class Carousel extends SvelteComponentTyped<CarouselProps, CarouselEvents, CarouselSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
<script >import { fade, blur, fly, slide } from 'svelte/transition';
|
|
2
|
+
import Slide from './Slide.svelte';
|
|
3
|
+
import Thumbnail from './Thumbnail.svelte';
|
|
4
|
+
import Caption from './Caption.svelte';
|
|
5
|
+
import Indicator from './Indicator.svelte';
|
|
6
|
+
export let showIndicators = true;
|
|
7
|
+
export let showCaptions = true;
|
|
8
|
+
export let showThumbs = true;
|
|
9
|
+
export let images;
|
|
10
|
+
export let slideControls = true;
|
|
11
|
+
export let transitionType;
|
|
12
|
+
export let transitionParams = {};
|
|
13
|
+
// have a custom transition function that returns the desired transition
|
|
14
|
+
function multiple(node, params) {
|
|
15
|
+
switch (transitionType) {
|
|
16
|
+
case 'slide':
|
|
17
|
+
return slide(node, params);
|
|
18
|
+
case 'blur':
|
|
19
|
+
return blur(node, params);
|
|
20
|
+
case 'fly':
|
|
21
|
+
return fly(node, params);
|
|
22
|
+
case 'fade':
|
|
23
|
+
return fade(node, params);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
// Carousel
|
|
27
|
+
export let divClass = 'overflow-hidden relative h-56 rounded-lg sm:h-64 xl:h-80 2xl:h-96';
|
|
28
|
+
export let indicatorDivClass = 'flex absolute bottom-5 left-1/2 z-30 space-x-3 -translate-x-1/2';
|
|
29
|
+
// Caption
|
|
30
|
+
export let captionClass = 'h-10 bg-gray-300 dark:bg-gray-700 dark:text-white p-2 my-2 text-center';
|
|
31
|
+
// Indicator
|
|
32
|
+
export let indicatorClass = 'w-3 h-3 rounded-full bg-gray-100 hover:bg-gray-300 opacity-60';
|
|
33
|
+
// Slide
|
|
34
|
+
// export let slideClass: string = 'hidden';
|
|
35
|
+
let imageShowingIndex = 1;
|
|
36
|
+
// $: console.log(imageShowingIndex);
|
|
37
|
+
// $: image = images[imageShowingIndex];
|
|
38
|
+
const nextSlide = () => {
|
|
39
|
+
if (imageShowingIndex === images.length - 1) {
|
|
40
|
+
imageShowingIndex = 0;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
imageShowingIndex += 1;
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
const prevSlide = () => {
|
|
47
|
+
if (imageShowingIndex === 0) {
|
|
48
|
+
imageShowingIndex = images.length - 1;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
imageShowingIndex -= 1;
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const goToSlide = (number) => (imageShowingIndex = number);
|
|
55
|
+
let thumbWidth = 100 / images.length;
|
|
56
|
+
</script>
|
|
57
|
+
|
|
58
|
+
<div id="default-carousel" class="relative">
|
|
59
|
+
<div class={divClass}>
|
|
60
|
+
{#each images as { id, imgurl, name, attribution }}
|
|
61
|
+
{#if imageShowingIndex === id}
|
|
62
|
+
<div transition:multiple={transitionParams}>
|
|
63
|
+
<Slide image={imgurl} altTag={name} attr={attribution} />
|
|
64
|
+
</div>
|
|
65
|
+
{/if}
|
|
66
|
+
{/each}
|
|
67
|
+
</div>
|
|
68
|
+
|
|
69
|
+
{#if showIndicators}
|
|
70
|
+
<!-- Slider indicators -->
|
|
71
|
+
<div class={indicatorDivClass}>
|
|
72
|
+
{#each images as { id, imgurl, name, attribution }}
|
|
73
|
+
<Indicator
|
|
74
|
+
{name}
|
|
75
|
+
selected={imageShowingIndex === id}
|
|
76
|
+
on:click={() => goToSlide(id)}
|
|
77
|
+
{indicatorClass}
|
|
78
|
+
/>
|
|
79
|
+
{/each}
|
|
80
|
+
</div>
|
|
81
|
+
{/if}
|
|
82
|
+
{#if slideControls}
|
|
83
|
+
<!-- Slider controls -->
|
|
84
|
+
<button
|
|
85
|
+
on:click={prevSlide}
|
|
86
|
+
type="button"
|
|
87
|
+
class="flex absolute top-0 left-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none"
|
|
88
|
+
data-carousel-prev
|
|
89
|
+
>
|
|
90
|
+
<span
|
|
91
|
+
class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none"
|
|
92
|
+
>
|
|
93
|
+
<svg
|
|
94
|
+
class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300"
|
|
95
|
+
fill="none"
|
|
96
|
+
stroke="currentColor"
|
|
97
|
+
viewBox="0 0 24 24"
|
|
98
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
99
|
+
><path
|
|
100
|
+
stroke-linecap="round"
|
|
101
|
+
stroke-linejoin="round"
|
|
102
|
+
stroke-width="2"
|
|
103
|
+
d="M15 19l-7-7 7-7"
|
|
104
|
+
/></svg
|
|
105
|
+
>
|
|
106
|
+
<span class="hidden">Previous</span>
|
|
107
|
+
</span>
|
|
108
|
+
</button>
|
|
109
|
+
<button
|
|
110
|
+
on:click={nextSlide}
|
|
111
|
+
type="button"
|
|
112
|
+
class="flex absolute top-0 right-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none"
|
|
113
|
+
data-carousel-next
|
|
114
|
+
>
|
|
115
|
+
<span
|
|
116
|
+
class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none"
|
|
117
|
+
>
|
|
118
|
+
<svg
|
|
119
|
+
class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300"
|
|
120
|
+
fill="none"
|
|
121
|
+
stroke="currentColor"
|
|
122
|
+
viewBox="0 0 24 24"
|
|
123
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
124
|
+
><path
|
|
125
|
+
stroke-linecap="round"
|
|
126
|
+
stroke-linejoin="round"
|
|
127
|
+
stroke-width="2"
|
|
128
|
+
d="M9 5l7 7-7 7"
|
|
129
|
+
/></svg
|
|
130
|
+
>
|
|
131
|
+
<span class="hidden">Next</span>
|
|
132
|
+
</span>
|
|
133
|
+
</button>
|
|
134
|
+
{/if}
|
|
135
|
+
</div>
|
|
136
|
+
|
|
137
|
+
{#if showCaptions}
|
|
138
|
+
<Caption caption={images[imageShowingIndex].name} {captionClass} />
|
|
139
|
+
{/if}
|
|
140
|
+
|
|
141
|
+
{#if showThumbs}
|
|
142
|
+
<div class="flex flex-row justify-center bg-gray-100">
|
|
143
|
+
{#each images as { id, imgurl, name, attribution }}
|
|
144
|
+
<Thumbnail
|
|
145
|
+
{thumbWidth}
|
|
146
|
+
thumbImg={imgurl}
|
|
147
|
+
altTag={name}
|
|
148
|
+
titleLink={attribution}
|
|
149
|
+
{id}
|
|
150
|
+
selected={imageShowingIndex === id}
|
|
151
|
+
on:click={() => goToSlide(id)}
|
|
152
|
+
/>
|
|
153
|
+
{/each}
|
|
154
|
+
</div>
|
|
155
|
+
{/if}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { TransitionTypes, TransitionParamTypes } from '../types';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
showIndicators?: boolean;
|
|
6
|
+
showCaptions?: boolean;
|
|
7
|
+
showThumbs?: boolean;
|
|
8
|
+
images: any[];
|
|
9
|
+
slideControls?: boolean;
|
|
10
|
+
transitionType: TransitionTypes;
|
|
11
|
+
transitionParams?: TransitionParamTypes;
|
|
12
|
+
divClass?: string;
|
|
13
|
+
indicatorDivClass?: string;
|
|
14
|
+
captionClass?: string;
|
|
15
|
+
indicatorClass?: string;
|
|
16
|
+
};
|
|
17
|
+
events: {
|
|
18
|
+
[evt: string]: CustomEvent<any>;
|
|
19
|
+
};
|
|
20
|
+
slots: {};
|
|
21
|
+
};
|
|
22
|
+
export declare type CarouselTransitionProps = typeof __propDef.props;
|
|
23
|
+
export declare type CarouselTransitionEvents = typeof __propDef.events;
|
|
24
|
+
export declare type CarouselTransitionSlots = typeof __propDef.slots;
|
|
25
|
+
export default class CarouselTransition extends SvelteComponentTyped<CarouselTransitionProps, CarouselTransitionEvents, CarouselTransitionSlots> {
|
|
26
|
+
}
|
|
27
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
<script >export let name = '';
|
|
2
|
+
export let selected = false;
|
|
3
|
+
export let indicatorClass = '';
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<button type="button" class={indicatorClass} class:active={selected} aria-label={name} on:click />
|
|
7
|
+
|
|
8
|
+
<style>
|
|
9
|
+
.active {
|
|
10
|
+
opacity: 1;
|
|
11
|
+
}</style>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
name?: string;
|
|
5
|
+
selected?: boolean;
|
|
6
|
+
indicatorClass?: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
click: MouseEvent;
|
|
10
|
+
} & {
|
|
11
|
+
[evt: string]: CustomEvent<any>;
|
|
12
|
+
};
|
|
13
|
+
slots: {};
|
|
14
|
+
};
|
|
15
|
+
export declare type IndicatorProps = typeof __propDef.props;
|
|
16
|
+
export declare type IndicatorEvents = typeof __propDef.events;
|
|
17
|
+
export declare type IndicatorSlots = typeof __propDef.slots;
|
|
18
|
+
export default class Indicator extends SvelteComponentTyped<IndicatorProps, IndicatorEvents, IndicatorSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
image?: string;
|
|
5
|
+
altTag?: string;
|
|
6
|
+
attr?: string;
|
|
7
|
+
slideClass?: string;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {};
|
|
13
|
+
};
|
|
14
|
+
export declare type SlideProps = typeof __propDef.props;
|
|
15
|
+
export declare type SlideEvents = typeof __propDef.events;
|
|
16
|
+
export declare type SlideSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Slide extends SvelteComponentTyped<SlideProps, SlideEvents, SlideSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script >export let thumbImg = '';
|
|
2
|
+
export let altTag = '';
|
|
3
|
+
export let titleLink = '';
|
|
4
|
+
export let id;
|
|
5
|
+
export let thumbWidth;
|
|
6
|
+
export let selected = false;
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<img class="opacity-40" class:active={selected} id={id.toString()} src={thumbImg} alt={altTag} title="Image from {titleLink}" on:click width="{thumbWidth}%" />
|
|
10
|
+
|
|
11
|
+
<style>
|
|
12
|
+
.active {
|
|
13
|
+
opacity: 1;
|
|
14
|
+
}</style>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
thumbImg?: string;
|
|
5
|
+
altTag?: string;
|
|
6
|
+
titleLink?: string;
|
|
7
|
+
id: number;
|
|
8
|
+
thumbWidth: number;
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
};
|
|
11
|
+
events: {
|
|
12
|
+
click: MouseEvent;
|
|
13
|
+
} & {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {};
|
|
17
|
+
};
|
|
18
|
+
export declare type ThumbnailProps = typeof __propDef.props;
|
|
19
|
+
export declare type ThumbnailEvents = typeof __propDef.events;
|
|
20
|
+
export declare type ThumbnailSlots = typeof __propDef.slots;
|
|
21
|
+
export default class Thumbnail extends SvelteComponentTyped<ThumbnailProps, ThumbnailEvents, ThumbnailSlots> {
|
|
22
|
+
}
|
|
23
|
+
export {};
|
package/forms/Input.svelte
CHANGED
|
@@ -7,12 +7,23 @@ export let label = '';
|
|
|
7
7
|
export let required = false;
|
|
8
8
|
export let placeholder = '';
|
|
9
9
|
export let size = 'text-sm';
|
|
10
|
-
|
|
10
|
+
let padding = '';
|
|
11
|
+
if (size === 'sm:text-md') {
|
|
12
|
+
padding = 'p-4';
|
|
13
|
+
}
|
|
14
|
+
else if (size === 'text-sm') {
|
|
15
|
+
padding = 'p-2.5';
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
padding = 'p-2';
|
|
19
|
+
}
|
|
20
|
+
export let inputClass = `bg-gray-50 border border-gray-300 text-gray-900 ${size} rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full ${padding} 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`;
|
|
11
21
|
export let labelClass = 'block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300';
|
|
12
22
|
export let disabled = false;
|
|
13
23
|
export let readonly = false;
|
|
14
24
|
export let helper = '';
|
|
15
25
|
export let helperClass = 'mt-2 text-sm text-gray-500 dark:text-gray-400';
|
|
26
|
+
export let ref = null;
|
|
16
27
|
// you need to this to avoid 2-way binding
|
|
17
28
|
function setType(node) {
|
|
18
29
|
node.type = type;
|
|
@@ -21,7 +32,18 @@ function setType(node) {
|
|
|
21
32
|
|
|
22
33
|
<div class={$$props.class}>
|
|
23
34
|
<label for={id} class={labelClass}>{label}</label>
|
|
24
|
-
<input
|
|
35
|
+
<input
|
|
36
|
+
bind:value
|
|
37
|
+
bind:this={ref}
|
|
38
|
+
{name}
|
|
39
|
+
use:setType
|
|
40
|
+
{id}
|
|
41
|
+
class={inputClass}
|
|
42
|
+
{placeholder}
|
|
43
|
+
{required}
|
|
44
|
+
{disabled}
|
|
45
|
+
{readonly}
|
|
46
|
+
/>
|
|
25
47
|
{#if helper}
|
|
26
48
|
<p class={helperClass}>{@html helper}</p>
|
|
27
49
|
{/if}
|
package/forms/Input.svelte.d.ts
CHANGED
package/forms/Textarea.svelte
CHANGED
|
@@ -4,6 +4,7 @@ export let id = generateId();
|
|
|
4
4
|
export let name = 'message';
|
|
5
5
|
export let label = 'Your message';
|
|
6
6
|
export let rows = 4;
|
|
7
|
+
export let ref = null;
|
|
7
8
|
export let placeholder = 'Leave a comment...';
|
|
8
9
|
export let labelClass = 'block mb-2 text-sm font-medium text-gray-900 dark:text-gray-400';
|
|
9
10
|
export let textareaClass = 'block p-2.5 w-full text-sm text-gray-900 bg-gray-50 rounded-lg border border-gray-300 focus:ring-blue-500 focus:border-blue-500 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';
|
|
@@ -12,7 +13,7 @@ export let helperClass = 'mt-2 text-sm text-gray-500 dark:text-gray-400';
|
|
|
12
13
|
</script>
|
|
13
14
|
|
|
14
15
|
<label for={id} class={labelClass}>{label}</label>
|
|
15
|
-
<textarea bind:value {id} {name} {rows} class={textareaClass} {placeholder} />
|
|
16
|
+
<textarea bind:value bind:this={ref} {id} {name} {rows} class={textareaClass} {placeholder} />
|
|
16
17
|
{#if helper}
|
|
17
18
|
<p class={helperClass}>{@html helper}</p>
|
|
18
19
|
{/if}
|
package/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { default as Avatar } from "./avatar/Avatar.svelte";
|
|
|
12
12
|
export { default as Badge } from "./badges/Badge.svelte";
|
|
13
13
|
export { default as BadgeIcon } from "./badges/BadgeIcon.svelte";
|
|
14
14
|
export { default as BadgeLink } from "./badges/BadgeLink.svelte";
|
|
15
|
+
export { default as Breadcrumb } from "./breadcrumbs/Breadcrumb.svelte";
|
|
15
16
|
export { default as Button } from "./buttons/Button.svelte";
|
|
16
17
|
export { default as ColorShadowButton } from "./buttons/ColorShadowButton.svelte";
|
|
17
18
|
export { default as GradientDuotoneButton } from "./buttons/GradientDuotoneButton.svelte";
|
|
@@ -26,6 +27,8 @@ export { default as ListCard } from "./cards/ListCard.svelte";
|
|
|
26
27
|
export { default as CtaCard } from "./cards/CtaCard.svelte";
|
|
27
28
|
export { default as EcommerceCard } from "./cards/EcommerceCard.svelte";
|
|
28
29
|
export { default as SignInCard } from "./cards/SignInCard.svelte";
|
|
30
|
+
export { default as Carousel } from "./carousels/Carousel.svelte";
|
|
31
|
+
export { default as CarouselTransition } from "./carousels/CarouselTransition.svelte";
|
|
29
32
|
export { default as DarkMode } from "./darkmode/DarkMode.svelte";
|
|
30
33
|
export { default as Dropdown } from "./dropdowns/DropdownDefault.svelte";
|
|
31
34
|
export { default as SimpleFooter } from "./footer/SimpleFooter.svelte";
|
package/index.js
CHANGED
|
@@ -20,7 +20,10 @@ export { default as Avatar } from './avatar/Avatar.svelte'
|
|
|
20
20
|
// Badges
|
|
21
21
|
export { default as Badge } from'./badges/Badge.svelte'
|
|
22
22
|
export { default as BadgeIcon } from'./badges/BadgeIcon.svelte'
|
|
23
|
-
export { default as BadgeLink } from'./badges/BadgeLink.svelte'
|
|
23
|
+
export { default as BadgeLink } from './badges/BadgeLink.svelte'
|
|
24
|
+
|
|
25
|
+
// Breadcrumbs
|
|
26
|
+
export { default as Breadcrumb } from'./breadcrumbs/Breadcrumb.svelte'
|
|
24
27
|
|
|
25
28
|
// Buttons
|
|
26
29
|
export { default as Button } from'./buttons/Button.svelte'
|
|
@@ -42,6 +45,10 @@ export { default as CtaCard } from'./cards/CtaCard.svelte'
|
|
|
42
45
|
export { default as EcommerceCard } from'./cards/EcommerceCard.svelte'
|
|
43
46
|
export { default as SignInCard } from'./cards/SignInCard.svelte'
|
|
44
47
|
|
|
48
|
+
// Carousels
|
|
49
|
+
export { default as Carousel } from './carousels/Carousel.svelte'
|
|
50
|
+
export { default as CarouselTransition } from './carousels/CarouselTransition.svelte'
|
|
51
|
+
|
|
45
52
|
// Dark mode
|
|
46
53
|
export { default as DarkMode } from'./darkmode/DarkMode.svelte'
|
|
47
54
|
|
package/navbar/Navbar.svelte
CHANGED
|
@@ -22,32 +22,58 @@ export let liLinkClass = `block py-2 pr-4 pl-3 text-gray-700 border-b border-gr
|
|
|
22
22
|
</script>
|
|
23
23
|
|
|
24
24
|
<nav class={navClass}>
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
25
|
+
<div class={navDivClass}>
|
|
26
|
+
<a href="/" class="flex">
|
|
27
|
+
<img src={logo} {alt} />
|
|
28
|
+
<span class={spanClass}>{siteName}</span>
|
|
29
|
+
</a>
|
|
30
|
+
<button
|
|
31
|
+
on:click={handleClickbtn}
|
|
32
|
+
type="button"
|
|
33
|
+
class={buttonClass}
|
|
34
|
+
aria-controls="mobile-menu-2"
|
|
35
|
+
aria-expanded="false"
|
|
36
|
+
>
|
|
37
|
+
<span class="sr-only">Open main menu</span>
|
|
38
|
+
<svg
|
|
39
|
+
class="w-6 h-6"
|
|
40
|
+
fill="currentColor"
|
|
41
|
+
viewBox="0 0 20 20"
|
|
42
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
43
|
+
><path
|
|
44
|
+
fill-rule="evenodd"
|
|
45
|
+
d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z"
|
|
46
|
+
clip-rule="evenodd"
|
|
47
|
+
/></svg
|
|
48
|
+
>
|
|
49
|
+
<svg
|
|
50
|
+
class="hidden w-6 h-6"
|
|
51
|
+
fill="currentColor"
|
|
52
|
+
viewBox="0 0 20 20"
|
|
53
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
54
|
+
><path
|
|
55
|
+
fill-rule="evenodd"
|
|
56
|
+
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"
|
|
57
|
+
clip-rule="evenodd"
|
|
58
|
+
/></svg
|
|
59
|
+
>
|
|
60
|
+
</button>
|
|
61
|
+
<div class:hidden={barHidden} class="hidden w-full md:block md:w-auto" id="mobile-menu">
|
|
62
|
+
<ul class="flex flex-col mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium">
|
|
63
|
+
{#each menus as { name, href, rel }}
|
|
64
|
+
<li>
|
|
65
|
+
<a class:active={pathname === href} {href} {rel} class={liLinkClass}>{name}</a>
|
|
66
|
+
</li>
|
|
67
|
+
{/each}
|
|
68
|
+
</ul>
|
|
69
|
+
{#if user}
|
|
70
|
+
<slot name="user" />
|
|
71
|
+
{/if}
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
48
74
|
</nav>
|
|
49
75
|
|
|
50
76
|
<style>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
77
|
+
#mobile-menu .active {
|
|
78
|
+
color: #fab534;
|
|
79
|
+
}</style>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.0",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "./package/index.js",
|
|
6
6
|
"author": {
|
|
@@ -12,29 +12,33 @@
|
|
|
12
12
|
"homepage": "https://github.com/shinokada/flowbite-svelte",
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@codewithshin/svelte-
|
|
15
|
+
"@codewithshin/svelte-heroicons": "^1.1.3",
|
|
16
|
+
"@codewithshin/svelte-sidebar": "^0.4.8",
|
|
16
17
|
"@codewithshin/svelte-simpleicons": "^0.2.2",
|
|
17
|
-
"@codewithshin/svelte-utterances": "^0.
|
|
18
|
-
"@playwright/test": "^1.
|
|
18
|
+
"@codewithshin/svelte-utterances": "^0.2.2",
|
|
19
|
+
"@playwright/test": "^1.21.0",
|
|
19
20
|
"@sveltejs/adapter-auto": "next",
|
|
20
21
|
"@sveltejs/kit": "next",
|
|
21
22
|
"@typescript-eslint/eslint-plugin": "^5.10.1",
|
|
22
23
|
"@typescript-eslint/parser": "^5.10.1",
|
|
23
|
-
"autoprefixer": "^10.4.
|
|
24
|
+
"autoprefixer": "^10.4.4",
|
|
24
25
|
"eslint": "^7.32.0",
|
|
25
26
|
"eslint-config-prettier": "^8.3.0",
|
|
26
27
|
"eslint-plugin-svelte3": "^3.2.1",
|
|
28
|
+
"flowbite": "^1.4.1",
|
|
29
|
+
"flowbite-svelte": "^0.13.8",
|
|
27
30
|
"mdsvex": "^0.10.5",
|
|
28
|
-
"postcss": "^8.4.
|
|
29
|
-
"postcss-load-config": "^3.1.
|
|
31
|
+
"postcss": "^8.4.12",
|
|
32
|
+
"postcss-load-config": "^3.1.4",
|
|
30
33
|
"prettier": "^2.5.1",
|
|
31
34
|
"prettier-plugin-svelte": "^2.5.0",
|
|
32
35
|
"prism-themes": "^1.9.0",
|
|
33
36
|
"svelte": "^3.44.0",
|
|
34
37
|
"svelte-check": "^2.2.6",
|
|
35
|
-
"svelte-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
+
"svelte-collapse": "^0.0.4",
|
|
39
|
+
"svelte-preprocess": "^4.10.5",
|
|
40
|
+
"svelte2tsx": "^0.5.9",
|
|
41
|
+
"tailwindcss": "^3.0.23",
|
|
38
42
|
"tslib": "^2.3.1",
|
|
39
43
|
"typescript": "~4.6.2"
|
|
40
44
|
},
|
|
@@ -72,13 +76,9 @@
|
|
|
72
76
|
"type": "git",
|
|
73
77
|
"url": "https://github.com/shinokada/flowbite-svelte"
|
|
74
78
|
},
|
|
75
|
-
"dependencies": {
|
|
76
|
-
"@codewithshin/svelte-heroicons": "^1.1.3",
|
|
77
|
-
"flowbite": "^1.3.4",
|
|
78
|
-
"svelte-collapse": "^0.0.4"
|
|
79
|
-
},
|
|
80
79
|
"exports": {
|
|
81
80
|
"./package.json": "./package.json",
|
|
81
|
+
"./.DS_Store": "./.DS_Store",
|
|
82
82
|
"./accordions/AccordionDefault.svelte": "./accordions/AccordionDefault.svelte",
|
|
83
83
|
"./accordions/AccordionItem.svelte": "./accordions/AccordionItem.svelte",
|
|
84
84
|
"./alerts/Alert.svelte": "./alerts/Alert.svelte",
|
|
@@ -94,6 +94,7 @@
|
|
|
94
94
|
"./badges/Badge.svelte": "./badges/Badge.svelte",
|
|
95
95
|
"./badges/BadgeIcon.svelte": "./badges/BadgeIcon.svelte",
|
|
96
96
|
"./badges/BadgeLink.svelte": "./badges/BadgeLink.svelte",
|
|
97
|
+
"./breadcrumbs/Breadcrumb.svelte": "./breadcrumbs/Breadcrumb.svelte",
|
|
97
98
|
"./buttongroups/ButtonGroup.svelte": "./buttongroups/ButtonGroup.svelte",
|
|
98
99
|
"./buttongroups/ButtonGroupOutline.svelte": "./buttongroups/ButtonGroupOutline.svelte",
|
|
99
100
|
"./buttons/Button.svelte": "./buttons/Button.svelte",
|
|
@@ -108,6 +109,12 @@
|
|
|
108
109
|
"./cards/InteractiveCard.svelte": "./cards/InteractiveCard.svelte",
|
|
109
110
|
"./cards/ListCard.svelte": "./cards/ListCard.svelte",
|
|
110
111
|
"./cards/SignInCard.svelte": "./cards/SignInCard.svelte",
|
|
112
|
+
"./carousels/Caption.svelte": "./carousels/Caption.svelte",
|
|
113
|
+
"./carousels/Carousel.svelte": "./carousels/Carousel.svelte",
|
|
114
|
+
"./carousels/CarouselTransition.svelte": "./carousels/CarouselTransition.svelte",
|
|
115
|
+
"./carousels/Indicator.svelte": "./carousels/Indicator.svelte",
|
|
116
|
+
"./carousels/Slide.svelte": "./carousels/Slide.svelte",
|
|
117
|
+
"./carousels/Thumbnail.svelte": "./carousels/Thumbnail.svelte",
|
|
111
118
|
"./darkmode/DarkMode.svelte": "./darkmode/DarkMode.svelte",
|
|
112
119
|
"./dropdowns/DropdownDefault.svelte": "./dropdowns/DropdownDefault.svelte",
|
|
113
120
|
"./footer/LogoFooter.svelte": "./footer/LogoFooter.svelte",
|
|
@@ -21,7 +21,7 @@ export let btnNextClass = 'py-2 px-4 text-sm font-medium text-white bg-gray-800
|
|
|
21
21
|
</span>
|
|
22
22
|
{/if}
|
|
23
23
|
<!-- Buttons -->
|
|
24
|
-
<div class="inline-flex mt-2
|
|
24
|
+
<div class="inline-flex mt-2">
|
|
25
25
|
<button on:click={previous} class={btnPreClass}> Prev </button>
|
|
26
26
|
<button on:click={next} class={btnNextClass}> Next </button>
|
|
27
27
|
</div>
|
package/types.d.ts
CHANGED
|
@@ -121,7 +121,7 @@ export interface AvatarType {
|
|
|
121
121
|
header?: string;
|
|
122
122
|
text?: string;
|
|
123
123
|
}
|
|
124
|
-
export declare type TransitionTypes = 'fade' | 'fly' | 'slide' | 'blur';
|
|
124
|
+
export declare type TransitionTypes = 'fade' | 'fly' | 'slide' | 'blur' | 'in:fly' | 'out:fly' | 'in:slide' | 'out:slide' | 'in:fade' | 'out:fade' | 'in:blur' | 'out:blur';
|
|
125
125
|
export interface TimelineItemType {
|
|
126
126
|
date: Date | string;
|
|
127
127
|
title: string;
|