flowbite-svelte 0.8.2 → 0.8.5

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 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 component
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
@@ -39,4 +39,5 @@ 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
- 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 };
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
@@ -67,6 +67,7 @@ import PillTabs from './tabs/PillTabs.svelte'
67
67
 
68
68
  // Tooltips
69
69
  import Tooltip from './tooltips/Tooltip.svelte'
70
+ import LightTooltip from './tooltips/LightTooltip.svelte'
70
71
 
71
72
  export {
72
73
  // Accordions
@@ -125,4 +126,5 @@ export {
125
126
  PillTabs,
126
127
  // Tooltips
127
128
  Tooltip,
129
+ LightTooltip,
128
130
  }
@@ -5,6 +5,10 @@
5
5
  export let logo = "/images/mkdir-logo.png";
6
6
  export let alt = "Svelte Flow";
7
7
  export let textsize = "text-sm";
8
+ let barHidden = true;
9
+ const handleClickbtn = () => {
10
+ barHidden = !barHidden;
11
+ };
8
12
  export let menus = [
9
13
  {
10
14
  name: "Home",
@@ -41,6 +45,7 @@
41
45
  >
42
46
  </a>
43
47
  <button
48
+ on:click={handleClickbtn}
44
49
  type="button"
45
50
  class="inline-flex justify-center items-center ml-3 text-gray-400 rounded-lg md:hidden hover:text-gray-900 focus:outline-none focus:ring-2 focus:ring-blue-300 dark:text-gray-400 dark:hover:text-white dark:focus:ring-gray-500"
46
51
  aria-controls="mobile-menu-2"
@@ -70,7 +75,11 @@
70
75
  /></svg
71
76
  >
72
77
  </button>
73
- <div class="hidden w-full md:block md:w-auto" id="mobile-menu">
78
+ <div
79
+ class:hidden={barHidden}
80
+ class="hidden w-full md:block md:w-auto"
81
+ id="mobile-menu"
82
+ >
74
83
  <ul
75
84
  class="flex flex-col mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium"
76
85
  >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.8.2",
3
+ "version": "0.8.5",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "author": {
6
6
  "name": "Shinichi Okada",
@@ -14,6 +14,7 @@
14
14
  "@sveltejs/adapter-auto": "next",
15
15
  "@sveltejs/kit": "next",
16
16
  "autoprefixer": "^10.4.2",
17
+ "flowbite-svelte": "^0.8.4",
17
18
  "postcss": "^8.4.5",
18
19
  "postcss-load-config": "^3.1.1",
19
20
  "svelte": "^3.44.0",
@@ -89,6 +90,7 @@
89
90
  "./tabs/DefaultTabs.svelte": "./tabs/DefaultTabs.svelte",
90
91
  "./tabs/InteractiveTabs.svelte": "./tabs/InteractiveTabs.svelte",
91
92
  "./tabs/PillTabs.svelte": "./tabs/PillTabs.svelte",
93
+ "./tooltips/LightTooltip.svelte": "./tooltips/LightTooltip.svelte",
92
94
  "./tooltips/Tooltip.svelte": "./tooltips/Tooltip.svelte"
93
95
  },
94
96
  "svelte": "./index.js"
@@ -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 {};
@@ -5,9 +5,7 @@
5
5
  export let bottom = false;
6
6
  export let left = false;
7
7
  export let active = false;
8
- export let bgColor = "bg-gray-900";
9
-
10
- // let style = `background-color: ${color};`;
8
+ // export let bgColor = "";
11
9
  </script>
12
10
 
13
11
  <div class="tooltip-wrapper">
@@ -15,7 +13,7 @@
15
13
  <slot />
16
14
  </span>
17
15
  <div
18
- class="inline-block absolute invisible z-10 py-2 px-3 {bgColor} rounded-lg shadow-sm opacity-0 transition-opacity duration-300 tooltip"
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"
19
17
  class:active
20
18
  class:left
21
19
  class:right
@@ -23,8 +21,7 @@
23
21
  class:top
24
22
  >
25
23
  {#if tip}
26
- <div class="text-sm font-medium text-white dark:bg-gray-700">{tip}</div>
27
- <div class="tooltip-arrow" />
24
+ <div class="text-sm font-medium text-white ">{tip}</div>
28
25
  {:else}
29
26
  <slot name="custom-tip" />
30
27
  {/if}
@@ -46,45 +43,53 @@
46
43
  visibility: hidden;
47
44
  transition: opacity 150ms, visibility 150ms;
48
45
  }
46
+
49
47
  .tooltip.top:after {
50
48
  content: "";
51
49
  position: absolute;
52
50
  top: 100%;
53
51
  left: 50%;
54
52
  margin-left: -10px;
55
- border-width: 4px;
53
+ border-width: 5px;
56
54
  border-style: solid;
57
- border-color: blue transparent transparent transparent;
55
+ border-color: rgb(55 65 81) transparent transparent transparent;
58
56
  }
59
57
  .tooltip.bottom::after {
60
58
  content: "";
61
59
  position: absolute;
62
- top: -20%;
60
+ top: -30%;
63
61
  left: 50%;
64
62
  margin-left: -10px;
65
- border-width: 4px;
63
+ border-width: 5px;
66
64
  border-style: solid;
67
- border-color: transparent transparent blue transparent;
65
+ border-color: transparent transparent rgb(55 65 81) transparent;
68
66
  }
69
67
  .tooltip.right::after {
70
68
  content: "";
71
69
  position: absolute;
72
- top: 43%;
73
- left: 2%;
74
- margin-left: -10px;
75
- border-width: 4px;
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;
76
78
  border-style: solid;
77
- border-color: transparent blue transparent transparent;
79
+ border-color: transparent rgb(55 65 81) transparent transparent;
78
80
  }
79
81
  .tooltip.left::after {
80
82
  content: "";
81
83
  position: absolute;
82
- top: 43%;
83
- left: 104%;
84
- margin-left: -10px;
85
- border-width: 4px;
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;
86
91
  border-style: solid;
87
- border-color: transparent transparent transparent blue;
92
+ border-color: transparent transparent transparent rgb(55 65 81);
88
93
  }
89
94
  .tooltip.top {
90
95
  left: 50%;
@@ -8,7 +8,6 @@ export default class Tooltip extends SvelteComponentTyped<{
8
8
  bottom?: boolean;
9
9
  left?: boolean;
10
10
  active?: boolean;
11
- bgColor?: string;
12
11
  }, {
13
12
  [evt: string]: CustomEvent<any>;
14
13
  }, {
@@ -28,7 +27,6 @@ declare const __propDef: {
28
27
  bottom?: boolean;
29
28
  left?: boolean;
30
29
  active?: boolean;
31
- bgColor?: string;
32
30
  };
33
31
  events: {
34
32
  [evt: string]: CustomEvent<any>;