flowbite-svelte 0.8.1 → 0.8.4
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/README.md +32 -2
- package/index.d.ts +3 -1
- package/index.js +8 -1
- package/package.json +4 -2
- package/tabs/InteractiveTabs.svelte +2 -1
- package/tooltips/LightTooltip.svelte +122 -0
- package/tooltips/LightTooltip.svelte.d.ts +39 -0
- package/tooltips/Tooltip.svelte +122 -0
- package/tooltips/Tooltip.svelte.d.ts +39 -0
package/README.md
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
1
|
# FLOWBITE-SVELTE
|
|
2
2
|
|
|
3
|
+
[Flowbite-Svelte](https://flowbite-svelte.vercel.app/) is an unofficial Flowbite component library for Svelte. All interactivities are handled by Svelte.
|
|
4
|
+
|
|
3
5
|
## Installation
|
|
4
6
|
|
|
5
7
|
[Getting started](https://flowbite-svelte.vercel.app/getting-started)
|
|
6
8
|
|
|
9
|
+
## Accordion components
|
|
10
|
+
|
|
11
|
+
[Accordions](https://flowbite-svelte.vercel.app/accordions)
|
|
12
|
+
|
|
7
13
|
## Alert components
|
|
8
14
|
|
|
9
15
|
[Alerts](https://flowbite-svelte.vercel.app/alerts)
|
|
10
16
|
|
|
17
|
+
## Badges components
|
|
18
|
+
|
|
19
|
+
[Badges](https://flowbite-svelte.vercel.app/badges)
|
|
20
|
+
|
|
11
21
|
## Button component
|
|
12
22
|
|
|
13
23
|
[Buttons](https://flowbite-svelte.vercel.app/buttons)
|
|
@@ -16,6 +26,18 @@
|
|
|
16
26
|
|
|
17
27
|
[Cards](https://flowbite-svelte.vercel.app/cards)
|
|
18
28
|
|
|
29
|
+
## Dark mode component
|
|
30
|
+
|
|
31
|
+
[Dark mode](https://flowbite-svelte.vercel.app/darkmode)
|
|
32
|
+
|
|
33
|
+
## Dropdown components
|
|
34
|
+
|
|
35
|
+
[Dropdowns](https://flowbite-svelte.vercel.app/dropdowns)
|
|
36
|
+
|
|
37
|
+
## Icons
|
|
38
|
+
|
|
39
|
+
[Icons](https://flowbite-svelte.vercel.app/icons)
|
|
40
|
+
|
|
19
41
|
## List group component
|
|
20
42
|
|
|
21
43
|
[List group](https://flowbite-svelte.vercel.app/list-group)
|
|
@@ -24,10 +46,18 @@
|
|
|
24
46
|
|
|
25
47
|
[Modals](https://flowbite-svelte.vercel.app/modals)
|
|
26
48
|
|
|
27
|
-
## Navbar
|
|
49
|
+
## Navbar components
|
|
28
50
|
|
|
29
51
|
[Navbars](https://flowbite-svelte.vercel.app/navbar)
|
|
30
52
|
|
|
53
|
+
## Spinner components
|
|
54
|
+
|
|
55
|
+
[Spinners](https://flowbite-svelte.vercel.app/spinners)
|
|
56
|
+
|
|
31
57
|
## Tab components
|
|
32
58
|
|
|
33
|
-
[Tabs](https://flowbite-svelte.vercel.app/tabs)
|
|
59
|
+
[Tabs](https://flowbite-svelte.vercel.app/tabs)
|
|
60
|
+
|
|
61
|
+
## Tooltip components
|
|
62
|
+
|
|
63
|
+
[Tooltips](https://flowbite-svelte.vercel.app/tooltips)
|
package/index.d.ts
CHANGED
|
@@ -38,4 +38,6 @@ import SpinnerButton from "./spinners/SpinnerButton.svelte";
|
|
|
38
38
|
import InteractiveTabs from "./tabs/InteractiveTabs.svelte";
|
|
39
39
|
import DefaultTabs from "./tabs/DefaultTabs.svelte";
|
|
40
40
|
import PillTabs from "./tabs/PillTabs.svelte";
|
|
41
|
-
|
|
41
|
+
import Tooltip from "./tooltips/Tooltip.svelte";
|
|
42
|
+
import LightTooltip from "./tooltips/LightTooltip.svelte";
|
|
43
|
+
export { Accordion, AccordionItem, Alert, BorderAlert, InfoAlert, Badge, BadgeIcon, BadgeLink, Button, ColorShadowButton, GradientDuotoneButton, GradientMonochromeButton, GradientOutlineButton, ButtonGroup, ButtonGroupOutline, Card, HorizontalCard, InteractiveCard, ListCard, CtaCard, EcommerceCard, SignInCard, DarkMode, Dropdown, SimpleFooter, List, modalIdStore, ExtraLargeModal, LargeModal, MediumModal, ModalButton, SignInModal, SmallModal, Navbar, DropdownNavbar, Spinner, SpinnerButton, InteractiveTabs, DefaultTabs, PillTabs, Tooltip, LightTooltip };
|
package/index.js
CHANGED
|
@@ -65,6 +65,10 @@ import InteractiveTabs from './tabs/InteractiveTabs.svelte'
|
|
|
65
65
|
import DefaultTabs from './tabs/DefaultTabs.svelte'
|
|
66
66
|
import PillTabs from './tabs/PillTabs.svelte'
|
|
67
67
|
|
|
68
|
+
// Tooltips
|
|
69
|
+
import Tooltip from './tooltips/Tooltip.svelte'
|
|
70
|
+
import LightTooltip from './tooltips/LightTooltip.svelte'
|
|
71
|
+
|
|
68
72
|
export {
|
|
69
73
|
// Accordions
|
|
70
74
|
Accordion,
|
|
@@ -119,5 +123,8 @@ export {
|
|
|
119
123
|
// Tabs
|
|
120
124
|
InteractiveTabs,
|
|
121
125
|
DefaultTabs,
|
|
122
|
-
PillTabs
|
|
126
|
+
PillTabs,
|
|
127
|
+
// Tooltips
|
|
128
|
+
Tooltip,
|
|
129
|
+
LightTooltip,
|
|
123
130
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.4",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Shinichi Okada",
|
|
@@ -88,7 +88,9 @@
|
|
|
88
88
|
"./tables/Table.svelte": "./tables/Table.svelte",
|
|
89
89
|
"./tabs/DefaultTabs.svelte": "./tabs/DefaultTabs.svelte",
|
|
90
90
|
"./tabs/InteractiveTabs.svelte": "./tabs/InteractiveTabs.svelte",
|
|
91
|
-
"./tabs/PillTabs.svelte": "./tabs/PillTabs.svelte"
|
|
91
|
+
"./tabs/PillTabs.svelte": "./tabs/PillTabs.svelte",
|
|
92
|
+
"./tooltips/LightTooltip.svelte": "./tooltips/LightTooltip.svelte",
|
|
93
|
+
"./tooltips/Tooltip.svelte": "./tooltips/Tooltip.svelte"
|
|
92
94
|
},
|
|
93
95
|
"svelte": "./index.js"
|
|
94
96
|
}
|
|
@@ -36,13 +36,14 @@
|
|
|
36
36
|
<div class="mb-4 border-b border-gray-200 dark:border-gray-700">
|
|
37
37
|
<ul class="flex flex-wrap -mb-px" id={tabId} role="tablist">
|
|
38
38
|
{#each tabs as { label, selected, id }}
|
|
39
|
-
<li class="mr-2" role="presentation"
|
|
39
|
+
<li class="mr-2" role="presentation">
|
|
40
40
|
<button
|
|
41
41
|
on:click={handleClick(id)}
|
|
42
42
|
class="inline-block py-4 px-4 text-sm font-medium text-center text-gray-500 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"
|
|
43
43
|
id="{label}-tab"
|
|
44
44
|
type="button"
|
|
45
45
|
role="tab"
|
|
46
|
+
class:active={activeTabValue === id}
|
|
46
47
|
aria-controls={label}
|
|
47
48
|
aria-selected={selected}>{label}</button
|
|
48
49
|
>
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let tip = "";
|
|
3
|
+
export let top = false;
|
|
4
|
+
export let right = false;
|
|
5
|
+
export let bottom = false;
|
|
6
|
+
export let left = false;
|
|
7
|
+
export let active = false;
|
|
8
|
+
// export let bgColor = "";
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div class="tooltip-wrapper">
|
|
12
|
+
<span class="tooltip-slot">
|
|
13
|
+
<slot />
|
|
14
|
+
</span>
|
|
15
|
+
<div
|
|
16
|
+
class="inline-block absolute invisible z-10 py-2 px-3 bg-white rounded-lg border border-gray-200 shadow-sm opacity-0 tooltip"
|
|
17
|
+
class:active
|
|
18
|
+
class:left
|
|
19
|
+
class:right
|
|
20
|
+
class:bottom
|
|
21
|
+
class:top
|
|
22
|
+
>
|
|
23
|
+
{#if tip}
|
|
24
|
+
<div class="text-sm font-medium text-gray-900">{tip}</div>
|
|
25
|
+
{:else}
|
|
26
|
+
<slot name="custom-tip" />
|
|
27
|
+
{/if}
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
.tooltip-wrapper {
|
|
33
|
+
position: relative;
|
|
34
|
+
display: inline-block;
|
|
35
|
+
}
|
|
36
|
+
.tooltip {
|
|
37
|
+
position: absolute;
|
|
38
|
+
font-family: inherit;
|
|
39
|
+
display: inline-block;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
color: inherit;
|
|
42
|
+
opacity: 0;
|
|
43
|
+
visibility: hidden;
|
|
44
|
+
transition: opacity 150ms, visibility 150ms;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.tooltip.top:after {
|
|
48
|
+
content: "";
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: 100%;
|
|
51
|
+
left: 50%;
|
|
52
|
+
margin-left: -10px;
|
|
53
|
+
border-width: 5px;
|
|
54
|
+
border-style: solid;
|
|
55
|
+
border-color: #ddd transparent transparent transparent;
|
|
56
|
+
}
|
|
57
|
+
.tooltip.bottom::after {
|
|
58
|
+
content: "";
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: -30%;
|
|
61
|
+
left: 50%;
|
|
62
|
+
margin-left: -10px;
|
|
63
|
+
border-width: 5px;
|
|
64
|
+
border-style: solid;
|
|
65
|
+
border-color: transparent transparent #ddd transparent;
|
|
66
|
+
}
|
|
67
|
+
.tooltip.right::after {
|
|
68
|
+
content: "";
|
|
69
|
+
position: absolute;
|
|
70
|
+
/* vertically center */
|
|
71
|
+
top: 50%;
|
|
72
|
+
transform: translateY(-50%);
|
|
73
|
+
/* position tooltip correctly */
|
|
74
|
+
right: 100%;
|
|
75
|
+
margin-left: -5px;
|
|
76
|
+
|
|
77
|
+
border-width: 5px;
|
|
78
|
+
border-style: solid;
|
|
79
|
+
border-color: transparent #ddd transparent transparent;
|
|
80
|
+
}
|
|
81
|
+
.tooltip.left::after {
|
|
82
|
+
content: "";
|
|
83
|
+
position: absolute;
|
|
84
|
+
/* vertically center */
|
|
85
|
+
top: 50%;
|
|
86
|
+
transform: translateY(-50%);
|
|
87
|
+
/* position tooltip correctly */
|
|
88
|
+
left: 100%;
|
|
89
|
+
/* margin-left: -5px; */
|
|
90
|
+
border-width: 5px;
|
|
91
|
+
border-style: solid;
|
|
92
|
+
border-color: transparent transparent transparent #ddd;
|
|
93
|
+
}
|
|
94
|
+
.tooltip.top {
|
|
95
|
+
left: 50%;
|
|
96
|
+
transform: translate(-50%, -100%);
|
|
97
|
+
margin-top: -8px;
|
|
98
|
+
}
|
|
99
|
+
.tooltip.bottom {
|
|
100
|
+
left: 50%;
|
|
101
|
+
bottom: 0px;
|
|
102
|
+
transform: translate(-50%, 100%);
|
|
103
|
+
/* margin-bottom: -px; */
|
|
104
|
+
}
|
|
105
|
+
.tooltip.left {
|
|
106
|
+
left: 0;
|
|
107
|
+
transform: translateX(-100%);
|
|
108
|
+
margin-left: -8px;
|
|
109
|
+
}
|
|
110
|
+
.tooltip.right {
|
|
111
|
+
right: 0;
|
|
112
|
+
transform: translateX(100%);
|
|
113
|
+
margin-right: 0px;
|
|
114
|
+
}
|
|
115
|
+
.tooltip.active {
|
|
116
|
+
opacity: 1;
|
|
117
|
+
visibility: initial;
|
|
118
|
+
}
|
|
119
|
+
.tooltip-slot:hover + .tooltip {
|
|
120
|
+
opacity: 1;
|
|
121
|
+
visibility: initial;
|
|
122
|
+
}</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} LightTooltipProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} LightTooltipEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} LightTooltipSlots */
|
|
4
|
+
export default class LightTooltip extends SvelteComponentTyped<{
|
|
5
|
+
tip?: string;
|
|
6
|
+
top?: boolean;
|
|
7
|
+
right?: boolean;
|
|
8
|
+
bottom?: boolean;
|
|
9
|
+
left?: boolean;
|
|
10
|
+
active?: boolean;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {
|
|
14
|
+
default: {};
|
|
15
|
+
'custom-tip': {};
|
|
16
|
+
}> {
|
|
17
|
+
}
|
|
18
|
+
export type LightTooltipProps = typeof __propDef.props;
|
|
19
|
+
export type LightTooltipEvents = typeof __propDef.events;
|
|
20
|
+
export type LightTooltipSlots = typeof __propDef.slots;
|
|
21
|
+
import { SvelteComponentTyped } from "svelte";
|
|
22
|
+
declare const __propDef: {
|
|
23
|
+
props: {
|
|
24
|
+
tip?: string;
|
|
25
|
+
top?: boolean;
|
|
26
|
+
right?: boolean;
|
|
27
|
+
bottom?: boolean;
|
|
28
|
+
left?: boolean;
|
|
29
|
+
active?: boolean;
|
|
30
|
+
};
|
|
31
|
+
events: {
|
|
32
|
+
[evt: string]: CustomEvent<any>;
|
|
33
|
+
};
|
|
34
|
+
slots: {
|
|
35
|
+
default: {};
|
|
36
|
+
'custom-tip': {};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export {};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
export let tip = "";
|
|
3
|
+
export let top = false;
|
|
4
|
+
export let right = false;
|
|
5
|
+
export let bottom = false;
|
|
6
|
+
export let left = false;
|
|
7
|
+
export let active = false;
|
|
8
|
+
// export let bgColor = "";
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<div class="tooltip-wrapper">
|
|
12
|
+
<span class="tooltip-slot">
|
|
13
|
+
<slot />
|
|
14
|
+
</span>
|
|
15
|
+
<div
|
|
16
|
+
class="inline-block absolute invisible z-10 py-2 px-3 bg-gray-900 rounded-lg shadow-sm opacity-0 transition-opacity duration-300 tooltip dark:bg-gray-700"
|
|
17
|
+
class:active
|
|
18
|
+
class:left
|
|
19
|
+
class:right
|
|
20
|
+
class:bottom
|
|
21
|
+
class:top
|
|
22
|
+
>
|
|
23
|
+
{#if tip}
|
|
24
|
+
<div class="text-sm font-medium text-white ">{tip}</div>
|
|
25
|
+
{:else}
|
|
26
|
+
<slot name="custom-tip" />
|
|
27
|
+
{/if}
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<style>
|
|
32
|
+
.tooltip-wrapper {
|
|
33
|
+
position: relative;
|
|
34
|
+
display: inline-block;
|
|
35
|
+
}
|
|
36
|
+
.tooltip {
|
|
37
|
+
position: absolute;
|
|
38
|
+
font-family: inherit;
|
|
39
|
+
display: inline-block;
|
|
40
|
+
white-space: nowrap;
|
|
41
|
+
color: inherit;
|
|
42
|
+
opacity: 0;
|
|
43
|
+
visibility: hidden;
|
|
44
|
+
transition: opacity 150ms, visibility 150ms;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.tooltip.top:after {
|
|
48
|
+
content: "";
|
|
49
|
+
position: absolute;
|
|
50
|
+
top: 100%;
|
|
51
|
+
left: 50%;
|
|
52
|
+
margin-left: -10px;
|
|
53
|
+
border-width: 5px;
|
|
54
|
+
border-style: solid;
|
|
55
|
+
border-color: rgb(55 65 81) transparent transparent transparent;
|
|
56
|
+
}
|
|
57
|
+
.tooltip.bottom::after {
|
|
58
|
+
content: "";
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: -30%;
|
|
61
|
+
left: 50%;
|
|
62
|
+
margin-left: -10px;
|
|
63
|
+
border-width: 5px;
|
|
64
|
+
border-style: solid;
|
|
65
|
+
border-color: transparent transparent rgb(55 65 81) transparent;
|
|
66
|
+
}
|
|
67
|
+
.tooltip.right::after {
|
|
68
|
+
content: "";
|
|
69
|
+
position: absolute;
|
|
70
|
+
/* vertically center */
|
|
71
|
+
top: 50%;
|
|
72
|
+
transform: translateY(-50%);
|
|
73
|
+
/* position tooltip correctly */
|
|
74
|
+
right: 100%;
|
|
75
|
+
margin-left: -5px;
|
|
76
|
+
|
|
77
|
+
border-width: 5px;
|
|
78
|
+
border-style: solid;
|
|
79
|
+
border-color: transparent rgb(55 65 81) transparent transparent;
|
|
80
|
+
}
|
|
81
|
+
.tooltip.left::after {
|
|
82
|
+
content: "";
|
|
83
|
+
position: absolute;
|
|
84
|
+
/* vertically center */
|
|
85
|
+
top: 50%;
|
|
86
|
+
transform: translateY(-50%);
|
|
87
|
+
/* position tooltip correctly */
|
|
88
|
+
left: 100%;
|
|
89
|
+
/* margin-left: -5px; */
|
|
90
|
+
border-width: 5px;
|
|
91
|
+
border-style: solid;
|
|
92
|
+
border-color: transparent transparent transparent rgb(55 65 81);
|
|
93
|
+
}
|
|
94
|
+
.tooltip.top {
|
|
95
|
+
left: 50%;
|
|
96
|
+
transform: translate(-50%, -100%);
|
|
97
|
+
margin-top: -8px;
|
|
98
|
+
}
|
|
99
|
+
.tooltip.bottom {
|
|
100
|
+
left: 50%;
|
|
101
|
+
bottom: 0px;
|
|
102
|
+
transform: translate(-50%, 100%);
|
|
103
|
+
/* margin-bottom: -px; */
|
|
104
|
+
}
|
|
105
|
+
.tooltip.left {
|
|
106
|
+
left: 0;
|
|
107
|
+
transform: translateX(-100%);
|
|
108
|
+
margin-left: -8px;
|
|
109
|
+
}
|
|
110
|
+
.tooltip.right {
|
|
111
|
+
right: 0;
|
|
112
|
+
transform: translateX(100%);
|
|
113
|
+
margin-right: 0px;
|
|
114
|
+
}
|
|
115
|
+
.tooltip.active {
|
|
116
|
+
opacity: 1;
|
|
117
|
+
visibility: initial;
|
|
118
|
+
}
|
|
119
|
+
.tooltip-slot:hover + .tooltip {
|
|
120
|
+
opacity: 1;
|
|
121
|
+
visibility: initial;
|
|
122
|
+
}</style>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** @typedef {typeof __propDef.props} TooltipProps */
|
|
2
|
+
/** @typedef {typeof __propDef.events} TooltipEvents */
|
|
3
|
+
/** @typedef {typeof __propDef.slots} TooltipSlots */
|
|
4
|
+
export default class Tooltip extends SvelteComponentTyped<{
|
|
5
|
+
tip?: string;
|
|
6
|
+
top?: boolean;
|
|
7
|
+
right?: boolean;
|
|
8
|
+
bottom?: boolean;
|
|
9
|
+
left?: boolean;
|
|
10
|
+
active?: boolean;
|
|
11
|
+
}, {
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
13
|
+
}, {
|
|
14
|
+
default: {};
|
|
15
|
+
'custom-tip': {};
|
|
16
|
+
}> {
|
|
17
|
+
}
|
|
18
|
+
export type TooltipProps = typeof __propDef.props;
|
|
19
|
+
export type TooltipEvents = typeof __propDef.events;
|
|
20
|
+
export type TooltipSlots = typeof __propDef.slots;
|
|
21
|
+
import { SvelteComponentTyped } from "svelte";
|
|
22
|
+
declare const __propDef: {
|
|
23
|
+
props: {
|
|
24
|
+
tip?: string;
|
|
25
|
+
top?: boolean;
|
|
26
|
+
right?: boolean;
|
|
27
|
+
bottom?: boolean;
|
|
28
|
+
left?: boolean;
|
|
29
|
+
active?: boolean;
|
|
30
|
+
};
|
|
31
|
+
events: {
|
|
32
|
+
[evt: string]: CustomEvent<any>;
|
|
33
|
+
};
|
|
34
|
+
slots: {
|
|
35
|
+
default: {};
|
|
36
|
+
'custom-tip': {};
|
|
37
|
+
};
|
|
38
|
+
};
|
|
39
|
+
export {};
|