flowbite-svelte 0.15.38 → 0.15.39

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 CHANGED
@@ -2,6 +2,23 @@
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.15.39](https://github.com/themesberg/flowbite-svelte/compare/v0.15.38...v0.15.39) (2022-05-22)
6
+
7
+
8
+ ### Features
9
+
10
+ * add new Navbar with dropdown demo ([d48b42f](https://github.com/themesberg/flowbite-svelte/commit/d48b42f15da7155e396702011fe70e7cb5898eb5))
11
+ * change Navbar component structure ([81b83fb](https://github.com/themesberg/flowbite-svelte/commit/81b83fb6805412b85ecf23186ccf50b4c737bdd4))
12
+ * favicon and logo update ([6c317a9](https://github.com/themesberg/flowbite-svelte/commit/6c317a967d5a0b8acdf19e7d8a74fe059407c34f))
13
+ * update Navbar components ([66170da](https://github.com/themesberg/flowbite-svelte/commit/66170dab34128dbe510131f2cd75a9123e06bdfe))
14
+
15
+
16
+ ### Bug Fixes
17
+
18
+ * add engines node version >=16.0.0 to package.json ([5f859be](https://github.com/themesberg/flowbite-svelte/commit/5f859be127ee5d541a9a49535f71eedbc5ea5137))
19
+ * restucturing Navbar components ([3f4fa07](https://github.com/themesberg/flowbite-svelte/commit/3f4fa076fe3cb5c0ca2a0a3e3b88e47aba7078af))
20
+ * update Navbar components ([57a7205](https://github.com/themesberg/flowbite-svelte/commit/57a7205e3c5db1dcec4f677878b2001fde749c67))
21
+
5
22
  ### [0.15.38](https://github.com/themesberg/flowbite-svelte/compare/v0.15.37...v0.15.38) (2022-05-19)
6
23
 
7
24
 
package/README.md CHANGED
@@ -141,7 +141,7 @@ For full documentation, visit [flowbite-svelte.com](https://flowbite-svelte.com/
141
141
  </tr>
142
142
  <tr>
143
143
  <td width="33.3333%">Modals</td>
144
- <td width="33.3333%">Navbars</td>
144
+ <td width="33.3333%">Navbar</td>
145
145
  <td width="33.3333%">Pagination</td>
146
146
  </tr>
147
147
  <tr>
@@ -151,7 +151,7 @@ For full documentation, visit [flowbite-svelte.com](https://flowbite-svelte.com/
151
151
  </a>
152
152
  </td>
153
153
  <td width="33.3333%">
154
- <a href="https://flowbite-svelte.com/navbars/">
154
+ <a href="https://flowbite-svelte.com/navbar/">
155
155
  <img alt="Tailwind CSS Navbar" src="https://flowbite.s3.amazonaws.com/github/navbar.jpg">
156
156
  </a>
157
157
  </td>
package/index.d.ts CHANGED
@@ -52,6 +52,10 @@ export { default as ModalButton } from './modals/ModalButton.svelte';
52
52
  export { default as SignInModal } from './modals/SignInModal.svelte';
53
53
  export { default as SmallModal } from './modals/SmallModal.svelte';
54
54
  export { default as Navbar } from './navbar/Navbar.svelte';
55
+ export { default as NavBrand } from './navbar/NavBrand.svelte';
56
+ export { default as NavHamburger } from './navbar/NavHamburger.svelte';
57
+ export { default as NavLi } from './navbar/NavLi.svelte';
58
+ export { default as NavUl } from './navbar/NavUl.svelte';
55
59
  export { default as DropdownNavbar } from './navbar/DropdownNavbar.svelte';
56
60
  export { default as Pagination } from './paginations/Pagination.svelte';
57
61
  export { default as Previous } from './paginations/Previous.svelte';
package/index.js CHANGED
@@ -68,6 +68,10 @@ export { default as SignInModal } from './modals/SignInModal.svelte';
68
68
  export { default as SmallModal } from './modals/SmallModal.svelte';
69
69
  // Navbar
70
70
  export { default as Navbar } from './navbar/Navbar.svelte';
71
+ export { default as NavBrand } from './navbar/NavBrand.svelte';
72
+ export { default as NavHamburger } from './navbar/NavHamburger.svelte';
73
+ export { default as NavLi } from './navbar/NavLi.svelte';
74
+ export { default as NavUl } from './navbar/NavUl.svelte';
71
75
  export { default as DropdownNavbar } from './navbar/DropdownNavbar.svelte';
72
76
  // Pagination
73
77
  export { default as Pagination } from './paginations/Pagination.svelte';
@@ -26,36 +26,71 @@ export let liButtonClass = `flex justify-between items-center py-2 pr-4 pl-3 w-f
26
26
  </script>
27
27
 
28
28
  <nav class={navClass}>
29
- <div class={navDivClass}>
30
- <a href="/" class="flex">
31
- <img src={logo} {alt} />
32
- <span class={spanClass}>{sitename}</span>
33
- </a>
34
- <button on:click={handleClickbtn} type="button" class={buttonClass} aria-controls="mobile-menu-2" aria-expanded="false">
35
- <span class="sr-only">Open main menu</span>
36
- <svg class="w-6 h-6" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" 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" clip-rule="evenodd" /></svg>
37
- <svg class="hidden w-6 h-6" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" 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" clip-rule="evenodd" /></svg>
38
- </button>
39
- <div class="w-full md:block md:w-auto" class:hidden={barHidden} id="mobile-menu">
40
- <ul class="flex flex-col mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium">
41
- {#each menus as { name, href, rel, child }}
42
- {#if child}
43
- <NavDropdown {liButtonClass} {dropdownDiv} {name} {child} {rel} {dropdownLinkClassWithChild} />
44
- {:else}
45
- <li>
46
- <a class:active={pathname === href} {href} {rel} class={dropdownLinkClassWithoutChild}>{name}</a>
47
- </li>
48
- {/if}
49
- {/each}
50
- </ul>
51
- {#if user}
52
- <slot name="user" />
53
- {/if}
54
- </div>
55
- </div>
29
+ <div class={navDivClass}>
30
+ <a href="/" class="flex">
31
+ <img src={logo} {alt} />
32
+ <span class={spanClass}>{sitename}</span>
33
+ </a>
34
+ <button
35
+ on:click={handleClickbtn}
36
+ type="button"
37
+ class={buttonClass}
38
+ aria-controls="mobile-menu-2"
39
+ aria-expanded="false"
40
+ >
41
+ <span class="sr-only">Open main menu</span>
42
+ <svg
43
+ class="w-6 h-6"
44
+ fill="currentColor"
45
+ viewBox="0 0 20 20"
46
+ xmlns="http://www.w3.org/2000/svg"
47
+ ><path
48
+ fill-rule="evenodd"
49
+ 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"
50
+ clip-rule="evenodd"
51
+ /></svg
52
+ >
53
+ <svg
54
+ class="hidden w-6 h-6"
55
+ fill="currentColor"
56
+ viewBox="0 0 20 20"
57
+ xmlns="http://www.w3.org/2000/svg"
58
+ ><path
59
+ fill-rule="evenodd"
60
+ 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"
61
+ clip-rule="evenodd"
62
+ /></svg
63
+ >
64
+ </button>
65
+ <div class="w-full md:block md:w-auto" class:hidden={barHidden} id="mobile-menu">
66
+ <ul class="flex flex-col mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium">
67
+ {#each menus as { name, href, rel, child }}
68
+ {#if child}
69
+ <NavDropdown
70
+ {liButtonClass}
71
+ {dropdownDiv}
72
+ {name}
73
+ {child}
74
+ {rel}
75
+ {dropdownLinkClassWithChild}
76
+ />
77
+ {:else}
78
+ <li>
79
+ <a class:active={pathname === href} {href} {rel} class={dropdownLinkClassWithoutChild}
80
+ >{name}</a
81
+ >
82
+ </li>
83
+ {/if}
84
+ {/each}
85
+ </ul>
86
+ {#if user}
87
+ <slot name="user" />
88
+ {/if}
89
+ </div>
90
+ </div>
56
91
  </nav>
57
92
 
58
93
  <style>
59
- #mobile-menu .active {
60
- color: #fab534;
61
- }</style>
94
+ #mobile-menu .active {
95
+ color: #fab534;
96
+ }</style>
@@ -0,0 +1,6 @@
1
+ <script>export let href = '';
2
+ </script>
3
+
4
+ <a {href} class="flex items-center {$$props.class || ''}">
5
+ <slot />
6
+ </a>
@@ -0,0 +1,19 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ href?: string;
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {
11
+ default: {};
12
+ };
13
+ };
14
+ export declare type NavBrandProps = typeof __propDef.props;
15
+ export declare type NavBrandEvents = typeof __propDef.events;
16
+ export declare type NavBrandSlots = typeof __propDef.slots;
17
+ export default class NavBrand extends SvelteComponentTyped<NavBrandProps, NavBrandEvents, NavBrandSlots> {
18
+ }
19
+ export {};
@@ -0,0 +1,11 @@
1
+ <script>import { MenuOutline } from 'svelte-heros';
2
+ </script>
3
+
4
+ <button
5
+ class="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"
6
+ data-testid="navbar-toggle"
7
+ on:click
8
+ >
9
+ <span class="sr-only">Open main menu</span>
10
+ <MenuOutline class="h-6 w-6 shrink-0" />
11
+ </button>
@@ -0,0 +1,16 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {};
4
+ events: {
5
+ click: MouseEvent;
6
+ } & {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {};
10
+ };
11
+ export declare type NavHamburgerProps = typeof __propDef.props;
12
+ export declare type NavHamburgerEvents = typeof __propDef.events;
13
+ export declare type NavHamburgerSlots = typeof __propDef.slots;
14
+ export default class NavHamburger extends SvelteComponentTyped<NavHamburgerProps, NavHamburgerEvents, NavHamburgerSlots> {
15
+ }
16
+ export {};
@@ -0,0 +1,12 @@
1
+ <script>export let href = '';
2
+ export let active = false;
3
+ export let activeClass = 'block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white';
4
+ export let nonActiveClass = 'block py-2 pr-4 pl-3 text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 dark:text-gray-400 md:dark:hover:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700';
5
+ let aClass = active ? activeClass : nonActiveClass;
6
+ </script>
7
+
8
+ <li>
9
+ <a {href} class="{aClass} {$$props.class || ''}">
10
+ <slot />
11
+ </a>
12
+ </li>
@@ -0,0 +1,22 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ href?: string;
6
+ active?: boolean;
7
+ activeClass?: string;
8
+ nonActiveClass?: string;
9
+ };
10
+ events: {
11
+ [evt: string]: CustomEvent<any>;
12
+ };
13
+ slots: {
14
+ default: {};
15
+ };
16
+ };
17
+ export declare type NavLiProps = typeof __propDef.props;
18
+ export declare type NavLiEvents = typeof __propDef.events;
19
+ export declare type NavLiSlots = typeof __propDef.slots;
20
+ export default class NavLi extends SvelteComponentTyped<NavLiProps, NavLiEvents, NavLiSlots> {
21
+ }
22
+ export {};
@@ -0,0 +1,14 @@
1
+ <script>import { slide } from 'svelte/transition';
2
+ import { quintOut } from 'svelte/easing';
3
+ export let divClass = 'hidden justify-between items-center w-full md:flex md:w-auto md:order-1';
4
+ export let ulClass = 'flex flex-col mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium';
5
+ export let hidden = true;
6
+ // $: hidden;
7
+ // $: console.log('hidden: ', hidden);
8
+ </script>
9
+
10
+ <div class={divClass} class:hidden id="mobile-menu">
11
+ <ul class="{ulClass} {$$props.class || ''}">
12
+ <slot />
13
+ </ul>
14
+ </div>
@@ -0,0 +1,21 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ divClass?: string;
6
+ ulClass?: string;
7
+ hidden?: boolean;
8
+ };
9
+ events: {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {
13
+ default: {};
14
+ };
15
+ };
16
+ export declare type NavUlProps = typeof __propDef.props;
17
+ export declare type NavUlEvents = typeof __propDef.events;
18
+ export declare type NavUlSlots = typeof __propDef.slots;
19
+ export default class NavUl extends SvelteComponentTyped<NavUlProps, NavUlEvents, NavUlSlots> {
20
+ }
21
+ export {};
@@ -1,79 +1,14 @@
1
- <script>import { onMount } from 'svelte';
2
- export let user = '';
3
- let pathname = '';
4
- onMount(() => {
5
- pathname = window.location.pathname;
6
- // console.log('pathname', pathname);
7
- });
8
- export let siteName = 'Svelte Flow';
9
- export let logo = '/images/flowbite-svelte-logo-30.png';
10
- export let alt = 'Svelte Flow';
11
- export let textsize = 'text-sm';
12
- let barHidden = true;
13
- const handleClickbtn = () => {
14
- barHidden = !barHidden;
15
- };
16
- export let menus;
17
- export let navClass = 'px-2 bg-white border-gray-200 dark:bg-gray-800 dark:border-gray-700';
1
+ <script>export let navClass = 'bg-white border-gray-200 px-2 sm:px-4 py-2.5 rounded dark:bg-gray-800';
18
2
  const navDivClass = 'container flex flex-wrap justify-between items-center mx-auto';
19
- export let spanClass = 'self-center text-lg font-semibold text-gray-900 whitespace-nowrap dark:text-white';
20
- export let buttonClass = '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';
21
- export let liLinkClass = `block py-2 pr-4 pl-3 text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 dark:text-gray-400 dark:hover:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent ${textsize}`;
3
+ let hidden = true;
4
+ let toggle = () => {
5
+ console.log('Toggled');
6
+ hidden = !hidden;
7
+ };
22
8
  </script>
23
9
 
24
10
  <nav class={navClass}>
25
11
  <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>
12
+ <slot {hidden} {toggle} />
73
13
  </div>
74
14
  </nav>
75
-
76
- <style>
77
- #mobile-menu .active {
78
- color: #fab534;
79
- }</style>
@@ -1,23 +1,16 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { LinkType } from '../types';
3
2
  declare const __propDef: {
4
3
  props: {
5
- user?: string;
6
- siteName?: string;
7
- logo?: string;
8
- alt?: string;
9
- textsize?: string;
10
- menus: LinkType[];
11
4
  navClass?: string;
12
- spanClass?: string;
13
- buttonClass?: string;
14
- liLinkClass?: string;
15
5
  };
16
6
  events: {
17
7
  [evt: string]: CustomEvent<any>;
18
8
  };
19
9
  slots: {
20
- user: {};
10
+ default: {
11
+ hidden: boolean;
12
+ toggle: () => void;
13
+ };
21
14
  };
22
15
  };
23
16
  export declare type NavbarProps = typeof __propDef.props;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.15.38",
3
+ "version": "0.15.39",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -79,6 +79,10 @@
79
79
  "flowbite": "^1.4.2",
80
80
  "svelte-heros": "^2.0.0"
81
81
  },
82
+ "engines": {
83
+ "npm": ">=7.0.0",
84
+ "node": ">=16.0.0"
85
+ },
82
86
  "exports": {
83
87
  "./package.json": "./package.json",
84
88
  "./.DS_Store": "./.DS_Store",
@@ -142,7 +146,11 @@
142
146
  "./modals/SmallModal.svelte": "./modals/SmallModal.svelte",
143
147
  "./modals/modalStores": "./modals/modalStores.js",
144
148
  "./navbar/DropdownNavbar.svelte": "./navbar/DropdownNavbar.svelte",
149
+ "./navbar/NavBrand.svelte": "./navbar/NavBrand.svelte",
145
150
  "./navbar/NavDropdown.svelte": "./navbar/NavDropdown.svelte",
151
+ "./navbar/NavHamburger.svelte": "./navbar/NavHamburger.svelte",
152
+ "./navbar/NavLi.svelte": "./navbar/NavLi.svelte",
153
+ "./navbar/NavUl.svelte": "./navbar/NavUl.svelte",
146
154
  "./navbar/Navbar.svelte": "./navbar/Navbar.svelte",
147
155
  "./paginations/Next.svelte": "./paginations/Next.svelte",
148
156
  "./paginations/Pagination.svelte": "./paginations/Pagination.svelte",