flowbite-svelte 0.25.19 → 0.25.22
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 +26 -0
- package/alerts/Alert.svelte +3 -5
- package/alerts/Alert.svelte.d.ts +2 -4
- package/carousels/Carousel.svelte +39 -22
- package/carousels/Carousel.svelte.d.ts +4 -5
- package/carousels/CarouselTransition.svelte +39 -23
- package/carousels/CarouselTransition.svelte.d.ts +4 -5
- package/dropdowns/Dropdown.svelte +7 -7
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/navbar/Menu.svelte +36 -0
- package/navbar/Menu.svelte.d.ts +22 -0
- package/navbar/NavHamburger.svelte +2 -3
- package/package.json +7 -1
- package/ratings/Rating.svelte +1 -1
- package/ratings/RatingComment.svelte +4 -6
- package/ratings/Star.svelte +36 -0
- package/ratings/Star.svelte.d.ts +22 -0
- package/sidebars/SidebarDropdownWrapper.svelte +4 -7
- package/timelines/Timeline.svelte +13 -2
- package/timelines/Timeline.svelte.d.ts +2 -1
- package/timelines/TimelineItem.svelte +124 -35
- package/timelines/TimelineItem.svelte.d.ts +9 -3
- package/timelines/TimelineItemHorizontal.svelte +52 -21
- package/timelines/TimelineItemHorizontal.svelte.d.ts +6 -2
- package/timelines/TimelineItemVertical.svelte +52 -25
- package/timelines/TimelineItemVertical.svelte.d.ts +6 -2
- package/toasts/Toast.svelte +2 -1
- package/typography/Hr.svelte +9 -12
- package/typography/Hr.svelte.d.ts +1 -0
- package/utils/ChevronDown.svelte +36 -0
- package/utils/ChevronDown.svelte.d.ts +22 -0
- package/utils/ChevronLeft.svelte +36 -0
- package/utils/ChevronLeft.svelte.d.ts +22 -0
- package/utils/ChevronRight.svelte +36 -0
- package/utils/ChevronRight.svelte.d.ts +22 -0
- package/utils/ChevronUp.svelte +36 -0
- package/utils/ChevronUp.svelte.d.ts +22 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,32 @@
|
|
|
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.25.22](https://github.com/themesberg/flowbite-svelte/compare/v0.25.21...v0.25.22) (2022-08-28)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* create icon slot for Alert so that users can add svg or svelte component ([45244ec](https://github.com/themesberg/flowbite-svelte/commit/45244ec05f99298d150751209980dce519873163))
|
|
11
|
+
* remove heros from: ([57f6928](https://github.com/themesberg/flowbite-svelte/commit/57f69282190f5d33d7ac17c6adeab36b89184f47))
|
|
12
|
+
* update Alert color type ([fd819fb](https://github.com/themesberg/flowbite-svelte/commit/fd819fb59d2d01f900ad76449afabfa22de6d5b1))
|
|
13
|
+
* update Timeline components ([4b47d6b](https://github.com/themesberg/flowbite-svelte/commit/4b47d6b5d09abad3b2d8fc29c2b38287726c44d7))
|
|
14
|
+
|
|
15
|
+
### [0.25.21](https://github.com/themesberg/flowbite-svelte/compare/v0.25.20...v0.25.21) (2022-08-27)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* add relative class to Hr component ([d8c6fbf](https://github.com/themesberg/flowbite-svelte/commit/d8c6fbf367a43b7c13ea55a56ae9c9f0b94fa96e))
|
|
21
|
+
|
|
22
|
+
### [0.25.20](https://github.com/themesberg/flowbite-svelte/compare/v0.25.19...v0.25.20) (2022-08-27)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### Bug Fixes
|
|
26
|
+
|
|
27
|
+
* index page space ([6ab9a19](https://github.com/themesberg/flowbite-svelte/commit/6ab9a19e004fc19ba3bd696acedbc5bbc0ced966))
|
|
28
|
+
* remove heros from: ([7055f4c](https://github.com/themesberg/flowbite-svelte/commit/7055f4c5ddaa91e15cabaf7d1112a149cf81374d))
|
|
29
|
+
* remove heros icon from Carousel ([2c7d4c9](https://github.com/themesberg/flowbite-svelte/commit/2c7d4c9a6edc1a4dd4005e5dcf46fec8b5dc0a52))
|
|
30
|
+
|
|
5
31
|
### [0.25.19](https://github.com/themesberg/flowbite-svelte/compare/v0.25.18...v0.25.19) (2022-08-27)
|
|
6
32
|
|
|
7
33
|
|
package/alerts/Alert.svelte
CHANGED
|
@@ -5,7 +5,6 @@ import CloseButton from '../utils/CloseButton.svelte';
|
|
|
5
5
|
const dispatch = createEventDispatcher();
|
|
6
6
|
setContext('background', true);
|
|
7
7
|
export let color = 'blue';
|
|
8
|
-
export let icon = null;
|
|
9
8
|
export let dismissable = false;
|
|
10
9
|
export let rounded = true;
|
|
11
10
|
export let accent = false;
|
|
@@ -61,8 +60,8 @@ $: divClass = classNames('p-4 text-sm', bgClasses[color] ?? bgClasses.blue, acce
|
|
|
61
60
|
|
|
62
61
|
<div id={$$props.id} class:hidden class={divClass} role="alert">
|
|
63
62
|
<div class="flex items-center whitespace-pre-wrap">
|
|
64
|
-
{#if icon}
|
|
65
|
-
<
|
|
63
|
+
{#if $$slots.icon}
|
|
64
|
+
<slot name="icon" />
|
|
66
65
|
{/if}
|
|
67
66
|
|
|
68
67
|
<slot />
|
|
@@ -80,8 +79,7 @@ $: divClass = classNames('p-4 text-sm', bgClasses[color] ?? bgClasses.blue, acce
|
|
|
80
79
|
on:focus
|
|
81
80
|
on:blur
|
|
82
81
|
on:mouseenter
|
|
83
|
-
on:mouseleave
|
|
84
|
-
/>
|
|
82
|
+
on:mouseleave />
|
|
85
83
|
{/if}
|
|
86
84
|
</div>
|
|
87
85
|
<slot name="extra" />
|
package/alerts/Alert.svelte.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { SvelteComponent } from 'svelte';
|
|
3
|
-
import type { Colors } from '../types';
|
|
4
2
|
declare const __propDef: {
|
|
5
3
|
props: {
|
|
6
4
|
[x: string]: any;
|
|
7
|
-
color?:
|
|
8
|
-
icon?: typeof SvelteComponent | null;
|
|
5
|
+
color?: 'gray' | 'blue' | 'red' | 'green' | 'yellow' | 'indigo' | 'purple' | 'pink' | 'dark' | 'custom';
|
|
9
6
|
dismissable?: boolean;
|
|
10
7
|
rounded?: boolean;
|
|
11
8
|
accent?: boolean;
|
|
@@ -27,6 +24,7 @@ declare const __propDef: {
|
|
|
27
24
|
[evt: string]: CustomEvent<any>;
|
|
28
25
|
};
|
|
29
26
|
slots: {
|
|
27
|
+
icon: {};
|
|
30
28
|
default: {};
|
|
31
29
|
extra: {};
|
|
32
30
|
};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import Slide from './Slide.svelte';
|
|
1
|
+
<script>import Slide from './Slide.svelte';
|
|
3
2
|
import Thumbnail from './Thumbnail.svelte';
|
|
4
3
|
import Caption from './Caption.svelte';
|
|
5
4
|
import Indicator from './Indicator.svelte';
|
|
@@ -10,12 +9,6 @@ export let images;
|
|
|
10
9
|
export let slideControls = true;
|
|
11
10
|
export let loop = false;
|
|
12
11
|
export let duration = 2000;
|
|
13
|
-
export let icons = {
|
|
14
|
-
next: ChevronRight,
|
|
15
|
-
prev: ChevronLeft
|
|
16
|
-
};
|
|
17
|
-
export let iconSize = 24;
|
|
18
|
-
export let iconClass = 'text-white sm:w-6 sm:h-6 dark:text-gray-300';
|
|
19
12
|
// Carousel
|
|
20
13
|
export let divClass = 'overflow-hidden relative h-56 rounded-lg sm:h-64 xl:h-80 2xl:h-96';
|
|
21
14
|
export let indicatorDivClass = 'flex absolute bottom-5 left-1/2 z-30 space-x-3 -translate-x-1/2';
|
|
@@ -64,8 +57,7 @@ if (loop) {
|
|
|
64
57
|
{name}
|
|
65
58
|
selected={imageShowingIndex === id}
|
|
66
59
|
on:click={() => goToSlide(id)}
|
|
67
|
-
{indicatorClass}
|
|
68
|
-
/>
|
|
60
|
+
{indicatorClass} />
|
|
69
61
|
{/each}
|
|
70
62
|
</div>
|
|
71
63
|
{/if}
|
|
@@ -75,12 +67,25 @@ if (loop) {
|
|
|
75
67
|
on:click={prevSlide}
|
|
76
68
|
type="button"
|
|
77
69
|
class="flex absolute top-0 left-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none"
|
|
78
|
-
data-carousel-prev
|
|
79
|
-
>
|
|
70
|
+
data-carousel-prev>
|
|
80
71
|
<span
|
|
81
|
-
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"
|
|
82
|
-
|
|
83
|
-
|
|
72
|
+
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">
|
|
73
|
+
{#if $$slots.previous}
|
|
74
|
+
<slot name="previous" />
|
|
75
|
+
{:else}
|
|
76
|
+
<svg
|
|
77
|
+
aria-hidden="true"
|
|
78
|
+
class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300"
|
|
79
|
+
fill="none"
|
|
80
|
+
stroke="currentColor"
|
|
81
|
+
viewBox="0 0 24 24"
|
|
82
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
83
|
+
><path
|
|
84
|
+
stroke-linecap="round"
|
|
85
|
+
stroke-linejoin="round"
|
|
86
|
+
stroke-width="2"
|
|
87
|
+
d="M15 19l-7-7 7-7" /></svg>
|
|
88
|
+
{/if}
|
|
84
89
|
<span class="hidden">Previous</span>
|
|
85
90
|
</span>
|
|
86
91
|
</button>
|
|
@@ -88,12 +93,25 @@ if (loop) {
|
|
|
88
93
|
on:click={nextSlide}
|
|
89
94
|
type="button"
|
|
90
95
|
class="flex absolute top-0 right-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none"
|
|
91
|
-
data-carousel-next
|
|
92
|
-
>
|
|
96
|
+
data-carousel-next>
|
|
93
97
|
<span
|
|
94
|
-
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"
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
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">
|
|
99
|
+
{#if $$slots.next}
|
|
100
|
+
<slot name="next" />
|
|
101
|
+
{:else}
|
|
102
|
+
<svg
|
|
103
|
+
aria-hidden="true"
|
|
104
|
+
class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300"
|
|
105
|
+
fill="none"
|
|
106
|
+
stroke="currentColor"
|
|
107
|
+
viewBox="0 0 24 24"
|
|
108
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
109
|
+
><path
|
|
110
|
+
stroke-linecap="round"
|
|
111
|
+
stroke-linejoin="round"
|
|
112
|
+
stroke-width="2"
|
|
113
|
+
d="M9 5l7 7-7 7" /></svg>
|
|
114
|
+
{/if}
|
|
97
115
|
<span class="hidden">Next</span>
|
|
98
116
|
</span>
|
|
99
117
|
</button>
|
|
@@ -114,8 +132,7 @@ if (loop) {
|
|
|
114
132
|
titleLink={attribution}
|
|
115
133
|
{id}
|
|
116
134
|
selected={imageShowingIndex === id}
|
|
117
|
-
on:click={() => goToSlide(id)}
|
|
118
|
-
/>
|
|
135
|
+
on:click={() => goToSlide(id)} />
|
|
119
136
|
{/each}
|
|
120
137
|
</div>
|
|
121
138
|
{/if}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { CarouselIconType } from '../types';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: {
|
|
5
4
|
showIndicators?: boolean;
|
|
@@ -9,9 +8,6 @@ declare const __propDef: {
|
|
|
9
8
|
slideControls?: boolean;
|
|
10
9
|
loop?: boolean;
|
|
11
10
|
duration?: number;
|
|
12
|
-
icons?: CarouselIconType;
|
|
13
|
-
iconSize?: number;
|
|
14
|
-
iconClass?: string;
|
|
15
11
|
divClass?: string;
|
|
16
12
|
indicatorDivClass?: string;
|
|
17
13
|
captionClass?: string;
|
|
@@ -21,7 +17,10 @@ declare const __propDef: {
|
|
|
21
17
|
events: {
|
|
22
18
|
[evt: string]: CustomEvent<any>;
|
|
23
19
|
};
|
|
24
|
-
slots: {
|
|
20
|
+
slots: {
|
|
21
|
+
previous: {};
|
|
22
|
+
next: {};
|
|
23
|
+
};
|
|
25
24
|
};
|
|
26
25
|
export declare type CarouselProps = typeof __propDef.props;
|
|
27
26
|
export declare type CarouselEvents = typeof __propDef.events;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
<script>import {
|
|
2
|
-
import { fade, blur, fly, slide } from 'svelte/transition';
|
|
1
|
+
<script>import { fade, blur, fly, slide } from 'svelte/transition';
|
|
3
2
|
import Slide from './Slide.svelte';
|
|
4
3
|
import Thumbnail from './Thumbnail.svelte';
|
|
5
4
|
import Caption from './Caption.svelte';
|
|
@@ -16,13 +15,6 @@ export let duration = 2000;
|
|
|
16
15
|
// Carousel
|
|
17
16
|
export let divClass = 'overflow-hidden relative h-56 rounded-lg sm:h-64 xl:h-80 2xl:h-96';
|
|
18
17
|
export let indicatorDivClass = 'flex absolute bottom-5 left-1/2 z-30 space-x-3 -translate-x-1/2';
|
|
19
|
-
// Slide controllers
|
|
20
|
-
export let icons = {
|
|
21
|
-
next: ChevronRight,
|
|
22
|
-
prev: ChevronLeft
|
|
23
|
-
};
|
|
24
|
-
export let iconSize = 24;
|
|
25
|
-
export let iconClass = 'text-white sm:w-6 sm:h-6 dark:text-gray-300';
|
|
26
18
|
// Caption
|
|
27
19
|
export let captionClass = 'h-10 bg-gray-300 dark:bg-gray-700 dark:text-white p-2 my-2 text-center';
|
|
28
20
|
// Indicator
|
|
@@ -88,8 +80,7 @@ if (loop) {
|
|
|
88
80
|
{name}
|
|
89
81
|
selected={imageShowingIndex === id}
|
|
90
82
|
on:click={() => goToSlide(id)}
|
|
91
|
-
{indicatorClass}
|
|
92
|
-
/>
|
|
83
|
+
{indicatorClass} />
|
|
93
84
|
{/each}
|
|
94
85
|
</div>
|
|
95
86
|
{/if}
|
|
@@ -99,12 +90,25 @@ if (loop) {
|
|
|
99
90
|
on:click={prevSlide}
|
|
100
91
|
type="button"
|
|
101
92
|
class="flex absolute top-0 left-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none"
|
|
102
|
-
data-carousel-prev
|
|
103
|
-
>
|
|
93
|
+
data-carousel-prev>
|
|
104
94
|
<span
|
|
105
|
-
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"
|
|
106
|
-
|
|
107
|
-
|
|
95
|
+
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">
|
|
96
|
+
{#if $$slots.previous}
|
|
97
|
+
<slot name="previous" />
|
|
98
|
+
{:else}
|
|
99
|
+
<svg
|
|
100
|
+
aria-hidden="true"
|
|
101
|
+
class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300"
|
|
102
|
+
fill="none"
|
|
103
|
+
stroke="currentColor"
|
|
104
|
+
viewBox="0 0 24 24"
|
|
105
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
106
|
+
><path
|
|
107
|
+
stroke-linecap="round"
|
|
108
|
+
stroke-linejoin="round"
|
|
109
|
+
stroke-width="2"
|
|
110
|
+
d="M15 19l-7-7 7-7" /></svg>
|
|
111
|
+
{/if}
|
|
108
112
|
<span class="hidden">Previous</span>
|
|
109
113
|
</span>
|
|
110
114
|
</button>
|
|
@@ -112,12 +116,25 @@ if (loop) {
|
|
|
112
116
|
on:click={nextSlide}
|
|
113
117
|
type="button"
|
|
114
118
|
class="flex absolute top-0 right-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none"
|
|
115
|
-
data-carousel-next
|
|
116
|
-
>
|
|
119
|
+
data-carousel-next>
|
|
117
120
|
<span
|
|
118
|
-
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"
|
|
119
|
-
|
|
120
|
-
|
|
121
|
+
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">
|
|
122
|
+
{#if $$slots.next}
|
|
123
|
+
<slot name="next" />
|
|
124
|
+
{:else}
|
|
125
|
+
<svg
|
|
126
|
+
aria-hidden="true"
|
|
127
|
+
class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300"
|
|
128
|
+
fill="none"
|
|
129
|
+
stroke="currentColor"
|
|
130
|
+
viewBox="0 0 24 24"
|
|
131
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
132
|
+
><path
|
|
133
|
+
stroke-linecap="round"
|
|
134
|
+
stroke-linejoin="round"
|
|
135
|
+
stroke-width="2"
|
|
136
|
+
d="M9 5l7 7-7 7" /></svg>
|
|
137
|
+
{/if}
|
|
121
138
|
<span class="hidden">Next</span>
|
|
122
139
|
</span>
|
|
123
140
|
</button>
|
|
@@ -138,8 +155,7 @@ if (loop) {
|
|
|
138
155
|
titleLink={attribution}
|
|
139
156
|
{id}
|
|
140
157
|
selected={imageShowingIndex === id}
|
|
141
|
-
on:click={() => goToSlide(id)}
|
|
142
|
-
/>
|
|
158
|
+
on:click={() => goToSlide(id)} />
|
|
143
159
|
{/each}
|
|
144
160
|
</div>
|
|
145
161
|
{/if}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { CarouselIconType } from '../types';
|
|
3
2
|
import type { TransitionTypes, TransitionParamTypes } from '../types';
|
|
4
3
|
declare const __propDef: {
|
|
5
4
|
props: {
|
|
@@ -14,16 +13,16 @@ declare const __propDef: {
|
|
|
14
13
|
duration?: number;
|
|
15
14
|
divClass?: string;
|
|
16
15
|
indicatorDivClass?: string;
|
|
17
|
-
icons?: CarouselIconType;
|
|
18
|
-
iconSize?: number;
|
|
19
|
-
iconClass?: string;
|
|
20
16
|
captionClass?: string;
|
|
21
17
|
indicatorClass?: string;
|
|
22
18
|
};
|
|
23
19
|
events: {
|
|
24
20
|
[evt: string]: CustomEvent<any>;
|
|
25
21
|
};
|
|
26
|
-
slots: {
|
|
22
|
+
slots: {
|
|
23
|
+
previous: {};
|
|
24
|
+
next: {};
|
|
25
|
+
};
|
|
27
26
|
};
|
|
28
27
|
export declare type CarouselTransitionProps = typeof __propDef.props;
|
|
29
28
|
export declare type CarouselTransitionEvents = typeof __propDef.events;
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import Button from '../buttons/Button.svelte';
|
|
3
3
|
import Popper from '../utils/Popper.svelte';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
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';
|
|
6
9
|
export let label = '';
|
|
7
10
|
export let inline = false;
|
|
8
11
|
export let arrowIcon = true;
|
|
@@ -30,8 +33,7 @@ $: popoverClass = classNames('rounded-lg shadow-sm', 'bg-white dark:bg-gray-800'
|
|
|
30
33
|
class={popoverClass}
|
|
31
34
|
trigger="click"
|
|
32
35
|
on:show
|
|
33
|
-
bind:open
|
|
34
|
-
>
|
|
36
|
+
bind:open>
|
|
35
37
|
<slot name="trigger" slot="trigger">
|
|
36
38
|
{#if inline}
|
|
37
39
|
<button class={labelClass} class:flex-row-reverse={icon == ChevronLeft}>
|
|
@@ -39,8 +41,7 @@ $: popoverClass = classNames('rounded-lg shadow-sm', 'bg-white dark:bg-gray-800'
|
|
|
39
41
|
{#if arrowIcon}
|
|
40
42
|
<svelte:component
|
|
41
43
|
this={icon ?? ChevronDown}
|
|
42
|
-
class={classNames('h-4 w-4', icon == ChevronLeft ? 'mr-2' : 'ml-2')}
|
|
43
|
-
/>
|
|
44
|
+
class={classNames('h-4 w-4', icon == ChevronLeft ? 'mr-2' : 'ml-2')} />
|
|
44
45
|
{/if}
|
|
45
46
|
</button>
|
|
46
47
|
{:else}
|
|
@@ -49,8 +50,7 @@ $: popoverClass = classNames('rounded-lg shadow-sm', 'bg-white dark:bg-gray-800'
|
|
|
49
50
|
{#if arrowIcon}
|
|
50
51
|
<svelte:component
|
|
51
52
|
this={icon ?? ChevronDown}
|
|
52
|
-
class={classNames('h-4 w-4', icon == ChevronLeft ? 'mr-2' : 'ml-2')}
|
|
53
|
-
/>
|
|
53
|
+
class={classNames('h-4 w-4', icon == ChevronLeft ? 'mr-2' : 'ml-2')} />
|
|
54
54
|
{/if}
|
|
55
55
|
</Button>
|
|
56
56
|
{/if}
|
package/index.d.ts
CHANGED
|
@@ -124,3 +124,7 @@ export { default as Secondary } from './typography/Secondary.svelte';
|
|
|
124
124
|
export { default as TextGradient } from './typography/TextGradient.svelte';
|
|
125
125
|
export { default as Underline } from './typography/Underline.svelte';
|
|
126
126
|
export { default as CloseButton } from './utils/CloseButton.svelte';
|
|
127
|
+
export { default as ChevronDown } from './utils/ChevronDown.svelte';
|
|
128
|
+
export { default as ChevronLeft } from './utils/ChevronLeft.svelte';
|
|
129
|
+
export { default as ChevronRight } from './utils/ChevronRight.svelte';
|
|
130
|
+
export { default as ChevronUp } from './utils/ChevronUp.svelte';
|
package/index.js
CHANGED
|
@@ -158,3 +158,7 @@ export { default as TextGradient } from './typography/TextGradient.svelte';
|
|
|
158
158
|
export { default as Underline } from './typography/Underline.svelte';
|
|
159
159
|
// utils
|
|
160
160
|
export { default as CloseButton } from './utils/CloseButton.svelte';
|
|
161
|
+
export { default as ChevronDown } from './utils/ChevronDown.svelte';
|
|
162
|
+
export { default as ChevronLeft } from './utils/ChevronLeft.svelte';
|
|
163
|
+
export { default as ChevronRight } from './utils/ChevronRight.svelte';
|
|
164
|
+
export { default as ChevronUp } from './utils/ChevronUp.svelte';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script>export let size = '24';
|
|
2
|
+
export let color = 'currentColor';
|
|
3
|
+
export let variation = 'outline';
|
|
4
|
+
let viewBox;
|
|
5
|
+
let svgpath;
|
|
6
|
+
let svgoutline = `<path d="M3.75 6.75H20.25M3.75 12H20.25M3.75 17.25H20.25" stroke="${color}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> `;
|
|
7
|
+
let svgsolid = `<path fill-rule="evenodd" clip-rule="evenodd" d="M3 6.75C3 6.33579 3.33579 6 3.75 6H20.25C20.6642 6 21 6.33579 21 6.75C21 7.16421 20.6642 7.5 20.25 7.5H3.75C3.33579 7.5 3 7.16421 3 6.75ZM3 12C3 11.5858 3.33579 11.25 3.75 11.25H20.25C20.6642 11.25 21 11.5858 21 12C21 12.4142 20.6642 12.75 20.25 12.75H3.75C3.33579 12.75 3 12.4142 3 12ZM3 17.25C3 16.8358 3.33579 16.5 3.75 16.5H20.25C20.6642 16.5 21 16.8358 21 17.25C21 17.6642 20.6642 18 20.25 18H3.75C3.33579 18 3 17.6642 3 17.25Z" fill="${color}"/> `;
|
|
8
|
+
$: switch (variation) {
|
|
9
|
+
case 'outline':
|
|
10
|
+
svgpath = svgoutline;
|
|
11
|
+
viewBox = '0 0 24 24';
|
|
12
|
+
break;
|
|
13
|
+
case 'solid':
|
|
14
|
+
svgpath = svgsolid;
|
|
15
|
+
viewBox = '0 0 24 24';
|
|
16
|
+
break;
|
|
17
|
+
default:
|
|
18
|
+
svgpath = svgoutline;
|
|
19
|
+
viewBox = '0 0 24 24';
|
|
20
|
+
}
|
|
21
|
+
export let ariaLabel = 'bars 3';
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<svg
|
|
25
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
26
|
+
width={size}
|
|
27
|
+
height={size}
|
|
28
|
+
class={$$props.class}
|
|
29
|
+
{...$$restProps}
|
|
30
|
+
aria-label={ariaLabel}
|
|
31
|
+
fill="none"
|
|
32
|
+
{viewBox}
|
|
33
|
+
stroke-width="2"
|
|
34
|
+
on:click>
|
|
35
|
+
{@html svgpath}
|
|
36
|
+
</svg>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
size?: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
variation?: 'solid' | 'outline';
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
click: MouseEvent;
|
|
12
|
+
} & {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export declare type MenuProps = typeof __propDef.props;
|
|
18
|
+
export declare type MenuEvents = typeof __propDef.events;
|
|
19
|
+
export declare type MenuSlots = typeof __propDef.slots;
|
|
20
|
+
export default class Menu extends SvelteComponentTyped<MenuProps, MenuEvents, MenuSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import Menu from './Menu.svelte';
|
|
3
3
|
export let btnClass = 'ml-3 inline-flex items-center rounded-lg p-2 text-sm text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600 md:hidden';
|
|
4
4
|
</script>
|
|
5
5
|
|
|
@@ -7,8 +7,7 @@ export let btnClass = 'ml-3 inline-flex items-center rounded-lg p-2 text-sm text
|
|
|
7
7
|
{...$$restProps}
|
|
8
8
|
class={classNames(btnClass, $$props.class)}
|
|
9
9
|
data-testid="navbar-toggle"
|
|
10
|
-
on:click
|
|
11
|
-
>
|
|
10
|
+
on:click>
|
|
12
11
|
<span class="sr-only">Open main menu</span>
|
|
13
12
|
<Menu class="h-6 w-6 shrink-0" />
|
|
14
13
|
</button>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.22",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -157,6 +157,7 @@
|
|
|
157
157
|
"./list-group/ListItem.svelte": "./list-group/ListItem.svelte",
|
|
158
158
|
"./megamenu/MegaMenu.svelte": "./megamenu/MegaMenu.svelte",
|
|
159
159
|
"./modals/Modal.svelte": "./modals/Modal.svelte",
|
|
160
|
+
"./navbar/Menu.svelte": "./navbar/Menu.svelte",
|
|
160
161
|
"./navbar/NavBrand.svelte": "./navbar/NavBrand.svelte",
|
|
161
162
|
"./navbar/NavDropdown.svelte": "./navbar/NavDropdown.svelte",
|
|
162
163
|
"./navbar/NavHamburger.svelte": "./navbar/NavHamburger.svelte",
|
|
@@ -174,6 +175,7 @@
|
|
|
174
175
|
"./ratings/RatingComment.svelte": "./ratings/RatingComment.svelte",
|
|
175
176
|
"./ratings/Review.svelte": "./ratings/Review.svelte",
|
|
176
177
|
"./ratings/ScoreRating.svelte": "./ratings/ScoreRating.svelte",
|
|
178
|
+
"./ratings/Star.svelte": "./ratings/Star.svelte",
|
|
177
179
|
"./sidebars/Sidebar.svelte": "./sidebars/Sidebar.svelte",
|
|
178
180
|
"./sidebars/SidebarBrand.svelte": "./sidebars/SidebarBrand.svelte",
|
|
179
181
|
"./sidebars/SidebarCta.svelte": "./sidebars/SidebarCta.svelte",
|
|
@@ -234,6 +236,10 @@
|
|
|
234
236
|
"./typography/Secondary.svelte": "./typography/Secondary.svelte",
|
|
235
237
|
"./typography/TextGradient.svelte": "./typography/TextGradient.svelte",
|
|
236
238
|
"./typography/Underline.svelte": "./typography/Underline.svelte",
|
|
239
|
+
"./utils/ChevronDown.svelte": "./utils/ChevronDown.svelte",
|
|
240
|
+
"./utils/ChevronLeft.svelte": "./utils/ChevronLeft.svelte",
|
|
241
|
+
"./utils/ChevronRight.svelte": "./utils/ChevronRight.svelte",
|
|
242
|
+
"./utils/ChevronUp.svelte": "./utils/ChevronUp.svelte",
|
|
237
243
|
"./utils/CloseButton.svelte": "./utils/CloseButton.svelte",
|
|
238
244
|
"./utils/Popper.svelte": "./utils/Popper.svelte",
|
|
239
245
|
"./utils/Wrapper.svelte": "./utils/Wrapper.svelte",
|
package/ratings/Rating.svelte
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import Button from '../buttons/Button.svelte';
|
|
2
|
-
import
|
|
2
|
+
import Star from './Star.svelte';
|
|
3
3
|
// default is floor
|
|
4
4
|
export let ceil = false;
|
|
5
5
|
export let helpfullink = '';
|
|
@@ -16,8 +16,7 @@ let grayStars = comment.total - roundedRating;
|
|
|
16
16
|
<p>
|
|
17
17
|
{comment.user.name}
|
|
18
18
|
<time datetime="2014-08-16 19:00" class="block text-sm text-gray-500 dark:text-gray-400"
|
|
19
|
-
>{comment.user.joined}</time
|
|
20
|
-
>
|
|
19
|
+
>{comment.user.joined}</time>
|
|
21
20
|
</p>
|
|
22
21
|
</div>
|
|
23
22
|
</div>
|
|
@@ -29,7 +28,7 @@ let grayStars = comment.total - roundedRating;
|
|
|
29
28
|
{/each}
|
|
30
29
|
{#each Array(grayStars) as _, star}
|
|
31
30
|
<slot name="ratingDown">
|
|
32
|
-
<Star size="
|
|
31
|
+
<Star size="24" class="px-0.5 text-gray-300 dark:text-gray-500" />
|
|
33
32
|
</slot>
|
|
34
33
|
{/each}
|
|
35
34
|
{#if comment.heading}
|
|
@@ -57,8 +56,7 @@ let grayStars = comment.total - roundedRating;
|
|
|
57
56
|
<a
|
|
58
57
|
href={abuselink}
|
|
59
58
|
class="pl-4 text-sm font-medium text-blue-600 hover:underline dark:text-blue-500"
|
|
60
|
-
>Report abuse</a
|
|
61
|
-
>
|
|
59
|
+
>Report abuse</a>
|
|
62
60
|
{/if}
|
|
63
61
|
</div>
|
|
64
62
|
{/if}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script>export let size = '24';
|
|
2
|
+
export let color = 'currentColor';
|
|
3
|
+
export let variation = 'outline';
|
|
4
|
+
let viewBox;
|
|
5
|
+
let svgpath;
|
|
6
|
+
let svgoutline = `<path d="M11.4806 3.49883C11.6728 3.03685 12.3272 3.03685 12.5193 3.49883L14.6453 8.61028C14.7263 8.80504 14.9095 8.93811 15.1197 8.95497L20.638 9.39736C21.1367 9.43735 21.339 10.0598 20.959 10.3853L16.7546 13.9867C16.5945 14.1239 16.5245 14.3392 16.5734 14.5444L17.8579 19.9293C17.974 20.416 17.4446 20.8007 17.0176 20.5398L12.2932 17.6542C12.1132 17.5443 11.8868 17.5443 11.7068 17.6542L6.98238 20.5398C6.55539 20.8007 6.02594 20.416 6.14203 19.9293L7.42652 14.5444C7.47546 14.3392 7.4055 14.1239 7.24531 13.9867L3.04099 10.3853C2.661 10.0598 2.86323 9.43735 3.36197 9.39736L8.88022 8.95497C9.09048 8.93811 9.27363 8.80504 9.35464 8.61028L11.4806 3.49883Z" stroke="${color}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> `;
|
|
7
|
+
let svgsolid = `<path fill-rule="evenodd" clip-rule="evenodd" d="M10.7881 3.2108C11.2364 2.13286 12.7635 2.13286 13.2118 3.2108L15.2938 8.21652L20.6979 8.64976C21.8616 8.74306 22.3335 10.1953 21.4469 10.9549L17.3295 14.4818L18.5874 19.7553C18.8583 20.8909 17.6229 21.7884 16.6266 21.1799L11.9999 18.354L7.37329 21.1799C6.37697 21.7884 5.14158 20.8909 5.41246 19.7553L6.67038 14.4818L2.55303 10.9549C1.66639 10.1953 2.13826 8.74306 3.302 8.64976L8.70609 8.21652L10.7881 3.2108Z" fill="${color}"/> `;
|
|
8
|
+
$: switch (variation) {
|
|
9
|
+
case 'outline':
|
|
10
|
+
svgpath = svgoutline;
|
|
11
|
+
viewBox = '0 0 24 24';
|
|
12
|
+
break;
|
|
13
|
+
case 'solid':
|
|
14
|
+
svgpath = svgsolid;
|
|
15
|
+
viewBox = '0 0 24 24';
|
|
16
|
+
break;
|
|
17
|
+
default:
|
|
18
|
+
svgpath = svgoutline;
|
|
19
|
+
viewBox = '0 0 24 24';
|
|
20
|
+
}
|
|
21
|
+
export let ariaLabel = 'star';
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<svg
|
|
25
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
26
|
+
width={size}
|
|
27
|
+
height={size}
|
|
28
|
+
class={$$props.class}
|
|
29
|
+
{...$$restProps}
|
|
30
|
+
aria-label={ariaLabel}
|
|
31
|
+
fill="none"
|
|
32
|
+
{viewBox}
|
|
33
|
+
stroke-width="2"
|
|
34
|
+
on:click>
|
|
35
|
+
{@html svgpath}
|
|
36
|
+
</svg>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
size?: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
variation?: 'solid' | 'outline';
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
click: MouseEvent;
|
|
12
|
+
} & {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export declare type StarProps = typeof __propDef.props;
|
|
18
|
+
export declare type StarEvents = typeof __propDef.events;
|
|
19
|
+
export declare type StarSlots = typeof __propDef.slots;
|
|
20
|
+
export default class Star extends SvelteComponentTyped<StarProps, StarEvents, StarSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
2
|
import { slide } from 'svelte/transition';
|
|
3
3
|
import { quintOut } from 'svelte/easing';
|
|
4
|
-
import
|
|
4
|
+
import ChevronDown from '../utils/ChevronDown.svelte';
|
|
5
5
|
export let btnClass = 'flex items-center p-2 w-full text-base font-normal text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700';
|
|
6
6
|
export let label = '';
|
|
7
7
|
export let spanClass = 'flex-1 ml-3 text-left whitespace-nowrap';
|
|
@@ -19,14 +19,12 @@ const handleDropdown = () => {
|
|
|
19
19
|
on:click={() => handleDropdown()}
|
|
20
20
|
type="button"
|
|
21
21
|
class={classNames(btnClass, $$props.class)}
|
|
22
|
-
aria-controls="sidebar-dropdown"
|
|
23
|
-
>
|
|
22
|
+
aria-controls="sidebar-dropdown">
|
|
24
23
|
<svelte:component
|
|
25
24
|
this={icon.name}
|
|
26
25
|
size={icon.size}
|
|
27
26
|
color={icon.color}
|
|
28
|
-
class="mr-2 {icon.class}"
|
|
29
|
-
/>
|
|
27
|
+
class="mr-2 {icon.class}" />
|
|
30
28
|
<span class={spanClass} sidebar-toggle-item>{label}</span>
|
|
31
29
|
<ChevronDown />
|
|
32
30
|
</button>
|
|
@@ -34,8 +32,7 @@ const handleDropdown = () => {
|
|
|
34
32
|
<ul
|
|
35
33
|
id="dropdown"
|
|
36
34
|
class={ulClass}
|
|
37
|
-
transition:slide={{ delay: 250, duration: 300, easing: quintOut }}
|
|
38
|
-
>
|
|
35
|
+
transition:slide={{ delay: 250, duration: 300, easing: quintOut }}>
|
|
39
36
|
<slot />
|
|
40
37
|
</ul>
|
|
41
38
|
{/if}
|