flowbite-svelte 0.10.10 → 0.11.1

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.
Files changed (36) hide show
  1. package/alerts/Alert.svelte +24 -1
  2. package/alerts/Alert.svelte.d.ts +3 -0
  3. package/avatar/Avatar.svelte +40 -0
  4. package/avatar/Avatar.svelte.d.ts +19 -0
  5. package/badges/BadgeIcon.svelte +1 -1
  6. package/buttons/GradientOutlineButton.svelte +1 -1
  7. package/footer/LogoFooter.svelte +1 -1
  8. package/footer/LogoFooter.svelte.d.ts +1 -0
  9. package/footer/SimpleFooter.svelte +1 -1
  10. package/footer/SimpleFooter.svelte.d.ts +1 -0
  11. package/footer/SitemapFooter.svelte +1 -1
  12. package/footer/SitemapFooter.svelte.d.ts +1 -0
  13. package/footer/SocialMediaFooter.svelte +1 -1
  14. package/footer/SocialMediaFooter.svelte.d.ts +1 -0
  15. package/index.d.ts +7 -0
  16. package/index.js +17 -2
  17. package/modals/SignInModal.svelte +2 -1
  18. package/modals/SignInModal.svelte.d.ts +1 -0
  19. package/package.json +10 -1
  20. package/sidebars/Sidebar.svelte +101 -0
  21. package/sidebars/Sidebar.svelte.d.ts +19 -0
  22. package/tabs/InteractiveTabs.svelte +7 -3
  23. package/timelines/Timeline.svelte +6 -0
  24. package/timelines/Timeline.svelte.d.ts +18 -0
  25. package/timelines/TimelineHorizontal.svelte +6 -0
  26. package/timelines/TimelineHorizontal.svelte.d.ts +18 -0
  27. package/timelines/TimelineItem.svelte +37 -0
  28. package/timelines/TimelineItem.svelte.d.ts +17 -0
  29. package/timelines/TimelineItemHorizontal.svelte +42 -0
  30. package/timelines/TimelineItemHorizontal.svelte.d.ts +17 -0
  31. package/timelines/TimelineItemVertical.svelte +40 -0
  32. package/timelines/TimelineItemVertical.svelte.d.ts +17 -0
  33. package/toasts/Toast.svelte +83 -0
  34. package/toasts/Toast.svelte.d.ts +25 -0
  35. package/types.d.ts +40 -1
  36. package/types.js +0 -7
@@ -1,7 +1,13 @@
1
- <script >export let color = 'blue';
1
+ <script >import { createEventDispatcher } from 'svelte';
2
+ const dispatch = createEventDispatcher();
3
+ export let color = 'blue';
2
4
  export let alertId = 'alert-1';
3
5
  export let closeBtn = false;
6
+ export let btn1 = false;
4
7
  let hidden = false;
8
+ const handlebtn1 = () => {
9
+ dispatch('handlebtn1');
10
+ };
5
11
  const handleHide = () => {
6
12
  hidden = !hidden;
7
13
  };
@@ -72,6 +78,7 @@ else {
72
78
  buttonClass =
73
79
  'ml-auto -mx-1.5 -my-1.5 bg-gray-100 text-gray-500 rounded-lg focus:ring-2 focus:ring-gray-400 p-1.5 hover:bg-gray-200 inline-flex h-8 w-8 dark:bg-gray-200 dark:text-gray-600 dark:hover:bg-gray-300';
74
80
  }
81
+ let button1Class = 'text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
75
82
  </script>
76
83
 
77
84
  <div id={alertId} class:hidden class={divClass} role="alert">
@@ -101,4 +108,20 @@ else {
101
108
  >
102
109
  </button>
103
110
  {/if}
111
+ {#if btn1}
112
+ <button on:click={handlebtn1} type="button" class={buttonClass} aria-label="Close">
113
+ <span class="sr-only">Close</span>
114
+ <svg
115
+ class="w-5 h-5"
116
+ fill="currentColor"
117
+ viewBox="0 0 20 20"
118
+ xmlns="http://www.w3.org/2000/svg"
119
+ ><path
120
+ fill-rule="evenodd"
121
+ 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"
122
+ clip-rule="evenodd"
123
+ /></svg
124
+ >
125
+ </button>
126
+ {/if}
104
127
  </div>
@@ -5,8 +5,11 @@ declare const __propDef: {
5
5
  color?: Colors;
6
6
  alertId?: string;
7
7
  closeBtn?: boolean;
8
+ btn1?: boolean;
8
9
  };
9
10
  events: {
11
+ handlebtn1: CustomEvent<any>;
12
+ } & {
10
13
  [evt: string]: CustomEvent<any>;
11
14
  };
12
15
  slots: {
@@ -0,0 +1,40 @@
1
+ <script >export let avatar = {
2
+ src: '/',
3
+ alt: '',
4
+ size: 8,
5
+ border: false,
6
+ round: false,
7
+ header: '',
8
+ text: ''
9
+ };
10
+ let isCircle = avatar.round ? 'rounded-full' : 'rounded';
11
+ let isBorder = avatar.border ? 'p-1 ring-2 ring-gray-300 dark:ring-gray-500' : '';
12
+ export let avatarClass = `w-${avatar.size} h-${avatar.size} ${isCircle} ${isBorder}`;
13
+ export let placehoder = false;
14
+ </script>
15
+
16
+ {#if placehoder}
17
+ <div class="relative w-10 h-10 overflow-hidden bg-gray-100 rounded-full dark:bg-gray-600">
18
+ <svg
19
+ class="absolute w-12 h-12 text-gray-400 -left-1"
20
+ fill="currentColor"
21
+ viewBox="0 0 20 20"
22
+ xmlns="http://www.w3.org/2000/svg"
23
+ ><path
24
+ fill-rule="evenodd"
25
+ d="M10 9a3 3 0 100-6 3 3 0 000 6zm-7 9a7 7 0 1114 0H3z"
26
+ clip-rule="evenodd"
27
+ /></svg
28
+ >
29
+ </div>
30
+ {:else if avatar.header && avatar.text}
31
+ <div class="flex items-center space-x-4">
32
+ <img class="class={avatarClass}" alt={avatar.alt} src={avatar.src} />
33
+ <div class="space-y-1 font-medium dark:text-white">
34
+ <div>{avatar.header}</div>
35
+ <div class="text-sm text-gray-500 dark:text-gray-400">{avatar.text}</div>
36
+ </div>
37
+ </div>
38
+ {:else}
39
+ <img class={avatarClass} alt={avatar.alt} src={avatar.src} />
40
+ {/if}
@@ -0,0 +1,19 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { AvatarType } from '../types';
3
+ declare const __propDef: {
4
+ props: {
5
+ avatar?: AvatarType;
6
+ avatarClass?: string;
7
+ placehoder?: boolean;
8
+ };
9
+ events: {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {};
13
+ };
14
+ export declare type AvatarProps = typeof __propDef.props;
15
+ export declare type AvatarEvents = typeof __propDef.events;
16
+ export declare type AvatarSlots = typeof __propDef.slots;
17
+ export default class Avatar extends SvelteComponentTyped<AvatarProps, AvatarEvents, AvatarSlots> {
18
+ }
19
+ export {};
@@ -1,5 +1,5 @@
1
1
  <script >export let textSize = 'text-xs';
2
- export let name = 'Read more';
2
+ export let name = '';
3
3
  export let color = 'blue';
4
4
  let badgeClass;
5
5
  if (color === 'blue') {
@@ -10,7 +10,7 @@ if (color === 'purple2blue') {
10
10
  'relative px-5 py-2.5 transition-all ease-in duration-75 bg-white dark:bg-gray-900 rounded-md group-hover:bg-opacity-0';
11
11
  }
12
12
  else if (color === 'cyan2blue') {
13
- btnClass = `relative inline-flex items-center justify-center p-0.5 mb-2 mr-2 overflow-hidden ${textSize} font-medium text-gray-900 rounded-lg group bg-gradient-to-br from-cyan-500 to-blue-500 group-hover:from-cyan-500 group-hover:to-blue-500 hover:text-white dark:text-white focus:ring-4 focus:ring-cyan-200 dark:focus:ring-cyan-800`;
13
+ btnClass = `relative inline-flex items-center justify-center p-0.5 mb-2 mr-2 overflow-hidden ${textSize} font-medium text-gray-900 rounded-lg group bg-gradient-to-br from-cyan-500 to-blue-500 group-hover:from-cyan-500 group-hover:to-blue-500 hover:text-white dark:text-white focus:ring-4 focus:outline-none focus:ring-cyan-200 dark:focus:ring-cyan-800`;
14
14
  spanClass =
15
15
  'relative px-5 py-2.5 transition-all ease-in duration-75 bg-white dark:bg-gray-900 rounded-md group-hover:bg-opacity-0';
16
16
  }
@@ -14,7 +14,7 @@ export let copyrightYear = '© 2022';
14
14
  export let allRightsReserved = 'All Rights Reserved.';
15
15
  </script>
16
16
 
17
- <footer class={footerClass}>
17
+ <footer class="{footerClass} {$$props.class}">
18
18
  <div class={divClass}>
19
19
  <a href={site.href} class={siteNameLinkClass}>
20
20
  <img src={site.img} class={imgClass} alt={site.name} />
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  import type { LinkType, SiteType } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
+ [x: string]: any;
5
6
  site: SiteType;
6
7
  links: LinkType[];
7
8
  footerClass?: string;
@@ -9,7 +9,7 @@ export let copyrightYear = '© 2022';
9
9
  export let allRightsReserved = 'All Rights Reserved.';
10
10
  </script>
11
11
 
12
- <footer class={footerClass}>
12
+ <footer class="{footerClass} {$$props.class}">
13
13
  <span class={siteNameClass}
14
14
  >{copyrightYear}
15
15
  <a href={site.href} class={siteNameLinkClass} target="_blank">{site.name}</a>. {allRightsReserved}
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  import type { LinkType, SiteType } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
+ [x: string]: any;
5
6
  site: SiteType;
6
7
  links: LinkType[];
7
8
  footerClass?: string;
@@ -15,7 +15,7 @@ export let copyrightYear = '© 2022';
15
15
  export let allRightsReserved = 'All Rights Reserved.';
16
16
  </script>
17
17
 
18
- <footer class={footerClass}>
18
+ <footer class="{footerClass} {$$props.class}">
19
19
  <div class={linksClass}>
20
20
  {#each links as { parent, children }}
21
21
  <div>
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  import type { SiteType, SocialMediaType, SocialMediaLinkType } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
+ [x: string]: any;
5
6
  site: SiteType;
6
7
  links: SocialMediaLinkType[];
7
8
  socialMedia: SocialMediaType[];
@@ -21,7 +21,7 @@ export let copyrightYear = '© 2022';
21
21
  export let allRightsReserved = 'All Rights Reserved.';
22
22
  </script>
23
23
 
24
- <footer class={footerClass}>
24
+ <footer class="{footerClass} {$$props.class}">
25
25
  <div class={divClass}>
26
26
  <div class={divClass2}>
27
27
  <a href={site.href} class={siteLinkClass}>
@@ -2,6 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  import type { SocialMediaLinkType, SocialMediaType, SiteType } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
+ [x: string]: any;
5
6
  site: SiteType;
6
7
  links: SocialMediaLinkType[];
7
8
  socialMedia: SocialMediaType[];
package/index.d.ts CHANGED
@@ -8,6 +8,7 @@ export { default as ForgotPassword } from "./auth/ForgotPassword.svelte";
8
8
  export { default as Login } from "./auth/Login.svelte";
9
9
  export { default as Register } from "./auth/Register.svelte";
10
10
  export { default as Reset } from "./auth/Reset.svelte";
11
+ export { default as Avatar } from "./avatar/Avatar.svelte";
11
12
  export { default as Badge } from "./badges/Badge.svelte";
12
13
  export { default as BadgeIcon } from "./badges/BadgeIcon.svelte";
13
14
  export { default as BadgeLink } from "./badges/BadgeLink.svelte";
@@ -51,10 +52,16 @@ export { default as SignInModal } from "./modals/SignInModal.svelte";
51
52
  export { default as SmallModal } from "./modals/SmallModal.svelte";
52
53
  export { default as Navbar } from "./navbar/Navbar.svelte";
53
54
  export { default as DropdownNavbar } from "./navbar/DropdownNavbar.svelte";
55
+ export { default as Sidebar } from "./sidebars/Sidebar.svelte";
54
56
  export { default as Spinner } from "./spinners/Spinner.svelte";
55
57
  export { default as SpinnerButton } from "./spinners/SpinnerButton.svelte";
56
58
  export { default as InteractiveTabs } from "./tabs/InteractiveTabs.svelte";
57
59
  export { default as DefaultTabs } from "./tabs/DefaultTabs.svelte";
58
60
  export { default as PillTabs } from "./tabs/PillTabs.svelte";
61
+ export { default as Timeline } from "./timelines/Timeline.svelte";
62
+ export { default as TimelineItem } from "./timelines/TimelineItem.svelte";
63
+ export { default as TimelineItemVertical } from "./timelines/TimelineItemVertical.svelte";
64
+ export { default as TimelineItemHorizontal } from "./timelines/TimelineItemHorizontal.svelte";
65
+ export { default as Toast } from "./toasts/Toast.svelte";
59
66
  export { default as Tooltip } from "./tooltips/Tooltip.svelte";
60
67
  export { default as LightTooltip } from "./tooltips/LightTooltip.svelte";
package/index.js CHANGED
@@ -12,7 +12,10 @@ export { default as Confirm } from'./auth/Confirm.svelte'
12
12
  export { default as ForgotPassword } from'./auth/ForgotPassword.svelte'
13
13
  export { default as Login } from'./auth/Login.svelte'
14
14
  export { default as Register } from'./auth/Register.svelte'
15
- export { default as Reset } from'./auth/Reset.svelte'
15
+ export { default as Reset } from './auth/Reset.svelte'
16
+
17
+ // Avatar
18
+ export { default as Avatar } from './avatar/Avatar.svelte'
16
19
 
17
20
  // Badges
18
21
  export { default as Badge } from'./badges/Badge.svelte'
@@ -79,6 +82,9 @@ export { default as SmallModal } from'./modals/SmallModal.svelte'
79
82
  export { default as Navbar } from'./navbar/Navbar.svelte'
80
83
  export { default as DropdownNavbar } from'./navbar/DropdownNavbar.svelte'
81
84
 
85
+ // Sidebar
86
+ export { default as Sidebar } from './sidebars/Sidebar.svelte'
87
+
82
88
  // Spin
83
89
  export { default as Spinner } from'./spinners/Spinner.svelte'
84
90
  export { default as SpinnerButton } from'./spinners/SpinnerButton.svelte'
@@ -86,7 +92,16 @@ export { default as SpinnerButton } from'./spinners/SpinnerButton.svelte'
86
92
  // Tabs
87
93
  export { default as InteractiveTabs } from'./tabs/InteractiveTabs.svelte'
88
94
  export { default as DefaultTabs } from'./tabs/DefaultTabs.svelte'
89
- export { default as PillTabs } from'./tabs/PillTabs.svelte'
95
+ export { default as PillTabs } from './tabs/PillTabs.svelte'
96
+
97
+ // Timeline
98
+ export { default as Timeline } from './timelines/Timeline.svelte'
99
+ export { default as TimelineItem } from './timelines/TimelineItem.svelte'
100
+ export { default as TimelineItemVertical } from './timelines/TimelineItemVertical.svelte'
101
+ export { default as TimelineItemHorizontal } from './timelines/TimelineItemHorizontal.svelte'
102
+
103
+ // Toast
104
+ export { default as Toast } from './toasts/Toast.svelte'
90
105
 
91
106
  // Tooltips
92
107
  export { default as Tooltip } from'./tooltips/Tooltip.svelte'
@@ -6,6 +6,7 @@ export let lostPasswordLink;
6
6
  export let rememberMe = false;
7
7
  export let signUp;
8
8
  export let action;
9
+ export let emailPlaceholder = 'name@company.com';
9
10
  const closeModal = () => {
10
11
  modalIdStore.update((value) => (value = null));
11
12
  };
@@ -95,7 +96,7 @@ else {
95
96
  name="email"
96
97
  id="email-{id}"
97
98
  class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-600 dark:border-gray-500 dark:placeholder-gray-400 dark:text-white"
98
- placeholder="name@company.com"
99
+ placeholder={emailPlaceholder}
99
100
  required
100
101
  />
101
102
  </div>
@@ -9,6 +9,7 @@ declare const __propDef: {
9
9
  rememberMe?: boolean;
10
10
  signUp: string;
11
11
  action: string;
12
+ emailPlaceholder?: string;
12
13
  showModalId: string;
13
14
  };
14
15
  events: {
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.10.10",
3
+ "version": "0.11.1",
4
4
  "description": "Flowbite components for Svelte",
5
+ "main": "./package/index.js",
5
6
  "author": {
6
7
  "name": "Shinichi Okada",
7
8
  "email": "connect@codewithshin.com",
@@ -80,6 +81,7 @@
80
81
  "./auth/Login.svelte": "./auth/Login.svelte",
81
82
  "./auth/Register.svelte": "./auth/Register.svelte",
82
83
  "./auth/Reset.svelte": "./auth/Reset.svelte",
84
+ "./avatar/Avatar.svelte": "./avatar/Avatar.svelte",
83
85
  "./badges/Badge.svelte": "./badges/Badge.svelte",
84
86
  "./badges/BadgeIcon.svelte": "./badges/BadgeIcon.svelte",
85
87
  "./badges/BadgeLink.svelte": "./badges/BadgeLink.svelte",
@@ -124,12 +126,19 @@
124
126
  "./modals/modalStores": "./modals/modalStores.js",
125
127
  "./navbar/DropdownNavbar.svelte": "./navbar/DropdownNavbar.svelte",
126
128
  "./navbar/Navbar.svelte": "./navbar/Navbar.svelte",
129
+ "./sidebars/Sidebar.svelte": "./sidebars/Sidebar.svelte",
127
130
  "./spinners/Spinner.svelte": "./spinners/Spinner.svelte",
128
131
  "./spinners/SpinnerButton.svelte": "./spinners/SpinnerButton.svelte",
129
132
  "./tables/Table.svelte": "./tables/Table.svelte",
130
133
  "./tabs/DefaultTabs.svelte": "./tabs/DefaultTabs.svelte",
131
134
  "./tabs/InteractiveTabs.svelte": "./tabs/InteractiveTabs.svelte",
132
135
  "./tabs/PillTabs.svelte": "./tabs/PillTabs.svelte",
136
+ "./timelines/Timeline.svelte": "./timelines/Timeline.svelte",
137
+ "./timelines/TimelineHorizontal.svelte": "./timelines/TimelineHorizontal.svelte",
138
+ "./timelines/TimelineItem.svelte": "./timelines/TimelineItem.svelte",
139
+ "./timelines/TimelineItemHorizontal.svelte": "./timelines/TimelineItemHorizontal.svelte",
140
+ "./timelines/TimelineItemVertical.svelte": "./timelines/TimelineItemVertical.svelte",
141
+ "./toasts/Toast.svelte": "./toasts/Toast.svelte",
133
142
  "./tooltips/LightTooltip.svelte": "./tooltips/LightTooltip.svelte",
134
143
  "./tooltips/Tooltip.svelte": "./tooltips/Tooltip.svelte",
135
144
  "./types": "./types.js"
@@ -0,0 +1,101 @@
1
+ <script >import { slide } from 'svelte/transition';
2
+ export let site;
3
+ export let links;
4
+ export let cta;
5
+ let isOpen = false;
6
+ let activeDropdown = undefined;
7
+ const handleDropdown = (id) => {
8
+ isOpen = !isOpen;
9
+ activeDropdown = id;
10
+ };
11
+ </script>
12
+
13
+ <aside class="w-64" aria-label="Sidebar">
14
+ <div class="overflow-y-auto py-4 px-3 bg-gray-50 rounded dark:bg-gray-800">
15
+ {#if site}
16
+ <a href={site.href} class="flex items-center pl-2.5 mb-5">
17
+ <img src={site.img} class="h-6 mr-3 sm:h-7" alt={site.name} />
18
+ <span class="self-center text-xl font-semibold whitespace-nowrap dark:text-white"
19
+ >{site.name}</span
20
+ >
21
+ </a>
22
+ {/if}
23
+ <ul class="space-y-2">
24
+ {#each links as link (link.id)}
25
+ {#if link.children}
26
+ <li>
27
+ <button
28
+ type="button"
29
+ on:click={() => handleDropdown(link.id)}
30
+ class="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"
31
+ aria-controls="dropdown"
32
+ data-collapse-toggle="dropdown"
33
+ >
34
+ {#if link.icon}
35
+ <svelte:component this={link.icon} className="h-4 w-4 mr-2" />
36
+ {/if}
37
+ <span class="flex-1 ml-3 text-left whitespace-nowrap" sidebar-toggle-item=""
38
+ >{link.name}</span
39
+ >
40
+ <svg
41
+ sidebar-toggle-item=""
42
+ class="w-6 h-6"
43
+ fill="currentColor"
44
+ viewBox="0 0 20 20"
45
+ xmlns="http://www.w3.org/2000/svg"
46
+ ><path
47
+ fill-rule="evenodd"
48
+ d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
49
+ clip-rule="evenodd"
50
+ /></svg
51
+ >
52
+ </button>
53
+ {#if isOpen && link.id == activeDropdown}
54
+ <ul id="dropdown" class="py-2 space-y-2" transition:slide={{ duration: 500 }}>
55
+ {#each link.children as child}
56
+ <li>
57
+ <a
58
+ href={child.href}
59
+ rel={child.rel}
60
+ class="flex items-center p-2 pl-11 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"
61
+ >{child.name}</a
62
+ >
63
+ </li>
64
+ {/each}
65
+ </ul>
66
+ {/if}
67
+ </li>
68
+ {:else}
69
+ <li>
70
+ <a
71
+ href={link.href}
72
+ rel={link.rel}
73
+ class="flex items-center p-2 text-base font-normal text-gray-900 rounded-lg dark:text-white hover:bg-gray-100 dark:hover:bg-gray-700"
74
+ >
75
+ {#if link.icon}
76
+ <svelte:component this={link.icon} className="h-4 w-4 mr-2" />
77
+ {/if}
78
+ <span class="ml-3">{link.name}</span>
79
+ {#if link.subtext}
80
+ {@html link.subtext}
81
+ {/if}
82
+ </a>
83
+ </li>
84
+ {/if}
85
+ {/each}
86
+ </ul>
87
+ {#if cta}
88
+ <div id="dropdown-cta" class="p-4 mt-6 bg-blue-50 rounded-lg dark:bg-blue-900" role="alert">
89
+ <div class="flex items-center mb-3">
90
+ <span
91
+ class="bg-orange-100 text-orange-800 text-sm font-semibold mr-2 px-2.5 py-0.5 rounded dark:bg-orange-200 dark:text-orange-900"
92
+ >{cta.label}</span
93
+ >
94
+ </div>
95
+ <p class="mb-3 text-sm text-blue-900 dark:text-blue-400">
96
+ {cta.text}
97
+ </p>
98
+ </div>
99
+ {/if}
100
+ </div>
101
+ </aside>
@@ -0,0 +1,19 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { SiteType, SidebarType, SidebarCtaType } from '../types';
3
+ declare const __propDef: {
4
+ props: {
5
+ site: SiteType;
6
+ links: SidebarType[];
7
+ cta: SidebarCtaType;
8
+ };
9
+ events: {
10
+ [evt: string]: CustomEvent<any>;
11
+ };
12
+ slots: {};
13
+ };
14
+ export declare type SidebarProps = typeof __propDef.props;
15
+ export declare type SidebarEvents = typeof __propDef.events;
16
+ export declare type SidebarSlots = typeof __propDef.slots;
17
+ export default class Sidebar extends SvelteComponentTyped<SidebarProps, SidebarEvents, SidebarSlots> {
18
+ }
19
+ export {};
@@ -30,9 +30,13 @@ export let tabs;
30
30
  role="tabpanel"
31
31
  aria-labelledby="{name}-tab"
32
32
  >
33
- <p class="text-sm text-gray-500 dark:text-gray-400">
34
- {content}
35
- </p>
33
+ {#if typeof content === 'string'}
34
+ <p class="text-sm text-gray-500 dark:text-gray-400">
35
+ {content}
36
+ </p>
37
+ {:else}
38
+ <svelte:component this={content} />
39
+ {/if}
36
40
  </div>
37
41
  {/if}
38
42
  {/each}
@@ -0,0 +1,6 @@
1
+ <script >export let olClass = 'relative border-l border-gray-200 dark:border-gray-700';
2
+ </script>
3
+
4
+ <ol class={olClass}>
5
+ <slot />
6
+ </ol>
@@ -0,0 +1,18 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ olClass?: string;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {
10
+ default: {};
11
+ };
12
+ };
13
+ export declare type TimelineProps = typeof __propDef.props;
14
+ export declare type TimelineEvents = typeof __propDef.events;
15
+ export declare type TimelineSlots = typeof __propDef.slots;
16
+ export default class Timeline extends SvelteComponentTyped<TimelineProps, TimelineEvents, TimelineSlots> {
17
+ }
18
+ export {};
@@ -0,0 +1,6 @@
1
+ <script >export let olClass = 'items-center sm:flex';
2
+ </script>
3
+
4
+ <ol class={olClass}>
5
+ <slot />
6
+ </ol>
@@ -0,0 +1,18 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ olClass?: string;
5
+ };
6
+ events: {
7
+ [evt: string]: CustomEvent<any>;
8
+ };
9
+ slots: {
10
+ default: {};
11
+ };
12
+ };
13
+ export declare type TimelineHorizontalProps = typeof __propDef.props;
14
+ export declare type TimelineHorizontalEvents = typeof __propDef.events;
15
+ export declare type TimelineHorizontalSlots = typeof __propDef.slots;
16
+ export default class TimelineHorizontal extends SvelteComponentTyped<TimelineHorizontalProps, TimelineHorizontalEvents, TimelineHorizontalSlots> {
17
+ }
18
+ export {};
@@ -0,0 +1,37 @@
1
+ <script >export let timelineItems;
2
+ </script>
3
+
4
+ {#each timelineItems as { date, title, text, href, linkname }}
5
+ <li class="mb-10 ml-4">
6
+ <div
7
+ class="absolute w-3 h-3 bg-gray-200 rounded-full mt-1.5 -left-1.5 border border-white dark:border-gray-900 dark:bg-gray-700"
8
+ />
9
+ <time class="mb-1 text-sm font-normal leading-none text-gray-400 dark:text-gray-500"
10
+ >{date}</time
11
+ >
12
+ <h3 class="text-lg font-semibold text-gray-900 dark:text-white">
13
+ {title}
14
+ </h3>
15
+ <p class="mb-4 text-base font-normal text-gray-500 dark:text-gray-400">
16
+ {text}
17
+ </p>
18
+ {#if href}
19
+ <a
20
+ {href}
21
+ class="inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:outline-none focus:ring-gray-200 focus:text-blue-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-700"
22
+ >{linkname}
23
+ <svg
24
+ class="ml-2 w-3 h-3"
25
+ fill="currentColor"
26
+ viewBox="0 0 20 20"
27
+ xmlns="http://www.w3.org/2000/svg"
28
+ ><path
29
+ fill-rule="evenodd"
30
+ d="M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z"
31
+ clip-rule="evenodd"
32
+ /></svg
33
+ ></a
34
+ >
35
+ {/if}
36
+ </li>
37
+ {/each}
@@ -0,0 +1,17 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { TimelineItemType } from '../types';
3
+ declare const __propDef: {
4
+ props: {
5
+ timelineItems: TimelineItemType[];
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {};
11
+ };
12
+ export declare type TimelineItemProps = typeof __propDef.props;
13
+ export declare type TimelineItemEvents = typeof __propDef.events;
14
+ export declare type TimelineItemSlots = typeof __propDef.slots;
15
+ export default class TimelineItem extends SvelteComponentTyped<TimelineItemProps, TimelineItemEvents, TimelineItemSlots> {
16
+ }
17
+ export {};
@@ -0,0 +1,42 @@
1
+ <script >export let timelineItems;
2
+ </script>
3
+
4
+ {#each timelineItems as { date, title, text, href, linkname, icon }}
5
+ <li class="relative mb-6 sm:mb-0">
6
+ <div class="flex items-center">
7
+ <div
8
+ class="flex z-10 justify-center items-center w-6 h-6 bg-blue-200 rounded-full ring-0 ring-white dark:bg-blue-900 sm:ring-8 dark:ring-gray-900 shrink-0"
9
+ >
10
+ {icon}
11
+ </div>
12
+ <div class="hidden sm:flex w-full bg-gray-200 h-0.5 dark:bg-gray-700" />
13
+ </div>
14
+ <div class="mt-3 sm:pr-8">
15
+ <h3 class="text-lg font-semibold text-gray-900 dark:text-white">{title}</h3>
16
+ <time class="block mb-2 text-sm font-normal leading-none text-gray-400 dark:text-gray-500"
17
+ >{date}</time
18
+ >
19
+ <p class="text-base font-normal text-gray-500 dark:text-gray-400">
20
+ {text}
21
+ </p>
22
+ {#if href}
23
+ <a
24
+ {href}
25
+ class="inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:outline-none focus:ring-gray-200 focus:text-blue-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-700"
26
+ >{linkname}
27
+ <svg
28
+ class="ml-2 w-3 h-3"
29
+ fill="currentColor"
30
+ viewBox="0 0 20 20"
31
+ xmlns="http://www.w3.org/2000/svg"
32
+ ><path
33
+ fill-rule="evenodd"
34
+ d="M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z"
35
+ clip-rule="evenodd"
36
+ /></svg
37
+ ></a
38
+ >
39
+ {/if}
40
+ </div>
41
+ </li>
42
+ {/each}
@@ -0,0 +1,17 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { TimelineItemType } from '../types';
3
+ declare const __propDef: {
4
+ props: {
5
+ timelineItems: TimelineItemType[];
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {};
11
+ };
12
+ export declare type TimelineItemHorizontalProps = typeof __propDef.props;
13
+ export declare type TimelineItemHorizontalEvents = typeof __propDef.events;
14
+ export declare type TimelineItemHorizontalSlots = typeof __propDef.slots;
15
+ export default class TimelineItemHorizontal extends SvelteComponentTyped<TimelineItemHorizontalProps, TimelineItemHorizontalEvents, TimelineItemHorizontalSlots> {
16
+ }
17
+ export {};
@@ -0,0 +1,40 @@
1
+ <script >export let timelineItems;
2
+ </script>
3
+
4
+ {#each timelineItems as { date, title, text, href, linkname, icon }}
5
+ <li class="mb-10 ml-6">
6
+ <span
7
+ class="flex absolute -left-3 justify-center items-center w-6 h-6 bg-blue-200 rounded-full ring-8 ring-white dark:ring-gray-900 dark:bg-blue-900"
8
+ >
9
+ <svelte:component this={icon} className="h-4 w-4" />
10
+ </span>
11
+
12
+ <h3 class="flex items-center mb-1 text-lg font-semibold text-gray-900 dark:text-white">
13
+ {title}
14
+ </h3>
15
+ <time class="block mb-2 text-sm font-normal leading-none text-gray-400 dark:text-gray-500"
16
+ >{date}</time
17
+ >
18
+ <p class="mb-4 text-base font-normal text-gray-500 dark:text-gray-400">
19
+ {text}
20
+ </p>
21
+ {#if href}
22
+ <a
23
+ {href}
24
+ class="inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:outline-none focus:ring-gray-200 focus:text-blue-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 dark:focus:ring-gray-700"
25
+ >{linkname}
26
+ <svg
27
+ class="ml-2 w-3 h-3"
28
+ fill="currentColor"
29
+ viewBox="0 0 20 20"
30
+ xmlns="http://www.w3.org/2000/svg"
31
+ ><path
32
+ fill-rule="evenodd"
33
+ d="M12.293 5.293a1 1 0 011.414 0l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414-1.414L14.586 11H3a1 1 0 110-2h11.586l-2.293-2.293a1 1 0 010-1.414z"
34
+ clip-rule="evenodd"
35
+ /></svg
36
+ ></a
37
+ >
38
+ {/if}
39
+ </li>
40
+ {/each}
@@ -0,0 +1,17 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { TimelineItemVerticalType } from '../types';
3
+ declare const __propDef: {
4
+ props: {
5
+ timelineItems: TimelineItemVerticalType[];
6
+ };
7
+ events: {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots: {};
11
+ };
12
+ export declare type TimelineItemVerticalProps = typeof __propDef.props;
13
+ export declare type TimelineItemVerticalEvents = typeof __propDef.events;
14
+ export declare type TimelineItemVerticalSlots = typeof __propDef.slots;
15
+ export default class TimelineItemVertical extends SvelteComponentTyped<TimelineItemVerticalProps, TimelineItemVerticalEvents, TimelineItemVerticalSlots> {
16
+ }
17
+ export {};
@@ -0,0 +1,83 @@
1
+ <script >import { fade, blur, fly, slide } from 'svelte/transition';
2
+ let visible = true;
3
+ const handleHide = () => {
4
+ visible = !visible;
5
+ };
6
+ export let iconColor = 'blue';
7
+ // Export a prop through which you can set a desired transition
8
+ export let transitionType = 'fade';
9
+ // Pass in params
10
+ export let transitionParams = {};
11
+ let iconDivClass;
12
+ export let divClass = 'flex items-center w-full max-w-xs p-4 text-gray-500 bg-white rounded-lg shadow dark:text-gray-400 dark:bg-gray-800';
13
+ export let textClass = 'ml-3 text-sm font-normal';
14
+ export let btnClass = 'ml-auto -mx-1.5 -my-1.5 bg-white text-gray-400 hover:text-gray-900 rounded-lg focus:ring-2 focus:ring-gray-300 p-1.5 hover:bg-gray-100 inline-flex h-8 w-8 dark:text-gray-500 dark:hover:text-white dark:bg-gray-800 dark:hover:bg-gray-700';
15
+ if (iconColor === 'blue') {
16
+ iconDivClass =
17
+ 'inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-blue-500 bg-blue-100 rounded-lg dark:bg-blue-800 dark:text-blue-200';
18
+ }
19
+ else if (iconColor === 'green') {
20
+ iconDivClass =
21
+ 'inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-green-500 bg-green-100 rounded-lg dark:bg-green-800 dark:text-green-200';
22
+ }
23
+ else if (iconColor === 'red') {
24
+ iconDivClass =
25
+ 'inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-red-500 bg-red-100 rounded-lg dark:bg-red-800 dark:text-red-200';
26
+ }
27
+ else if (iconColor === 'gray') {
28
+ iconDivClass =
29
+ 'inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-gray-500 bg-gray-100 rounded-lg dark:bg-gray-800 dark:text-gray-200';
30
+ }
31
+ else if (iconColor === 'purple') {
32
+ iconDivClass =
33
+ 'inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-purple-500 bg-purple-100 rounded-lg dark:bg-purple-800 dark:text-purple-200';
34
+ }
35
+ else if (iconColor === 'indigo') {
36
+ iconDivClass =
37
+ 'inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-indigo-500 bg-indigo-100 rounded-lg dark:bg-indigo-800 dark:text-indigo-200';
38
+ }
39
+ else if (iconColor === 'yellow') {
40
+ iconDivClass =
41
+ 'inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-yellow-500 bg-yellow-100 rounded-lg dark:bg-yellow-800 dark:text-yellow-200';
42
+ }
43
+ else {
44
+ iconDivClass =
45
+ 'inline-flex items-center justify-center flex-shrink-0 w-8 h-8 text-blue-500 bg-blue-100 rounded-lg dark:bg-blue-800 dark:text-blue-200';
46
+ }
47
+ // have a custom transition function that returns the desired transition
48
+ function multiple(node, params) {
49
+ switch (transitionType) {
50
+ case 'slide':
51
+ return slide(node, params);
52
+ case 'blur':
53
+ return blur(node, params);
54
+ case 'fly':
55
+ return fly(node, params);
56
+ case 'fade':
57
+ return fade(node, params);
58
+ }
59
+ }
60
+ </script>
61
+
62
+ {#if visible}
63
+ <div transition:multiple={transitionParams} class={divClass} role="alert">
64
+ <div class={iconDivClass}>
65
+ <slot name="icon" />
66
+ </div>
67
+ <div class={textClass}><slot name="text" /></div>
68
+ <button type="button" class={btnClass} on:click={handleHide} aria-label="Close">
69
+ <span class="sr-only">Close</span>
70
+ <svg
71
+ class="w-5 h-5"
72
+ fill="currentColor"
73
+ viewBox="0 0 20 20"
74
+ xmlns="http://www.w3.org/2000/svg"
75
+ ><path
76
+ fill-rule="evenodd"
77
+ 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"
78
+ clip-rule="evenodd"
79
+ /></svg
80
+ >
81
+ </button>
82
+ </div>
83
+ {/if}
@@ -0,0 +1,25 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ import type { Colors, TransitionTypes } from '../types';
3
+ declare const __propDef: {
4
+ props: {
5
+ iconColor?: Colors;
6
+ transitionType?: TransitionTypes;
7
+ transitionParams?: {};
8
+ divClass?: string;
9
+ textClass?: string;
10
+ btnClass?: string;
11
+ };
12
+ events: {
13
+ [evt: string]: CustomEvent<any>;
14
+ };
15
+ slots: {
16
+ icon: {};
17
+ text: {};
18
+ };
19
+ };
20
+ export declare type ToastProps = typeof __propDef.props;
21
+ export declare type ToastEvents = typeof __propDef.events;
22
+ export declare type ToastSlots = typeof __propDef.slots;
23
+ export default class Toast extends SvelteComponentTyped<ToastProps, ToastEvents, ToastSlots> {
24
+ }
25
+ export {};
package/types.d.ts CHANGED
@@ -46,7 +46,7 @@ export interface TabType {
46
46
  export interface InteractiveTabType {
47
47
  name: string;
48
48
  id: number;
49
- content: string;
49
+ content: string | typeof SvelteComponent;
50
50
  }
51
51
  export interface PillTabType {
52
52
  name: string;
@@ -83,7 +83,46 @@ export interface AuthFieldType {
83
83
  required?: boolean;
84
84
  placeholder?: string;
85
85
  }
86
+ export declare type SidebarType = {
87
+ id: number;
88
+ name: string;
89
+ href?: string;
90
+ icon?: typeof SvelteComponent;
91
+ rel?: string;
92
+ children?: SidebarType[];
93
+ subtext?: HTMLElement;
94
+ };
95
+ export declare type SidebarCtaType = {
96
+ label: string;
97
+ text: HTMLElement;
98
+ };
86
99
  export declare type SelectOptionType = {
87
100
  name: string;
88
101
  value: string;
89
102
  };
103
+ export interface AvatarType {
104
+ src?: string;
105
+ alt?: string;
106
+ size?: 6 | 8 | 12 | 16 | 24 | 48;
107
+ border?: boolean;
108
+ round?: boolean;
109
+ header?: string;
110
+ text?: string;
111
+ }
112
+ export declare type TransitionTypes = 'fade' | 'fly' | 'slide' | 'blur';
113
+ export interface TimelineItemType {
114
+ date: Date | string;
115
+ title: string;
116
+ icon?: typeof SvelteComponent;
117
+ href?: string;
118
+ linkname?: string;
119
+ text?: HTMLElement | string;
120
+ }
121
+ export interface TimelineItemVerticalType {
122
+ date: Date | string;
123
+ title: string;
124
+ icon: typeof SvelteComponent;
125
+ href?: string;
126
+ linkname?: string;
127
+ text?: HTMLElement | string;
128
+ }
package/types.js CHANGED
@@ -1,8 +1 @@
1
1
  export {};
2
- // export type ToggleType = {
3
- // name: string;
4
- // id: string;
5
- // label: string;
6
- // checked?: boolean;
7
- // disabled?: boolean;
8
- // }