flowbite-svelte 0.6.0 → 0.7.0

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/index.d.ts CHANGED
@@ -33,7 +33,9 @@ import SignInModal from "./modals/SignInModal.svelte";
33
33
  import SmallModal from "./modals/SmallModal.svelte";
34
34
  import Navbar from "./navbar/Navbar.svelte";
35
35
  import DropdownNavbar from "./navbar/DropdownNavbar.svelte";
36
+ import Spin from "./spins/Spin.svelte";
37
+ import SpinButton from "./spins/SpinButton.svelte";
36
38
  import InteractiveTabs from "./tabs/InteractiveTabs.svelte";
37
39
  import DefaultTabs from "./tabs/DefaultTabs.svelte";
38
40
  import PillTabs from "./tabs/PillTabs.svelte";
39
- 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, InteractiveTabs, DefaultTabs, PillTabs };
41
+ 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, Spin, SpinButton, InteractiveTabs, DefaultTabs, PillTabs };
package/index.js CHANGED
@@ -56,6 +56,10 @@ import SmallModal from './modals/SmallModal.svelte'
56
56
  import Navbar from './navbar/Navbar.svelte'
57
57
  import DropdownNavbar from './navbar/DropdownNavbar.svelte'
58
58
 
59
+ // Spin
60
+ import Spin from './spins/Spin.svelte'
61
+ import SpinButton from './spins/SpinButton.svelte'
62
+
59
63
  // Tabs
60
64
  import InteractiveTabs from './tabs/InteractiveTabs.svelte'
61
65
  import DefaultTabs from './tabs/DefaultTabs.svelte'
@@ -109,6 +113,9 @@ export {
109
113
  // Navbar
110
114
  Navbar,
111
115
  DropdownNavbar,
116
+ // Spin
117
+ Spin,
118
+ SpinButton,
112
119
  // Tabs
113
120
  InteractiveTabs,
114
121
  DefaultTabs,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "author": {
6
6
  "name": "Shinichi Okada",
@@ -84,6 +84,8 @@
84
84
  "./modals/modalStores": "./modals/modalStores.js",
85
85
  "./navbar/DropdownNavbar.svelte": "./navbar/DropdownNavbar.svelte",
86
86
  "./navbar/Navbar.svelte": "./navbar/Navbar.svelte",
87
+ "./spins/Spin.svelte": "./spins/Spin.svelte",
88
+ "./spins/SpinButton.svelte": "./spins/SpinButton.svelte",
87
89
  "./tabs/DefaultTabs.svelte": "./tabs/DefaultTabs.svelte",
88
90
  "./tabs/InteractiveTabs.svelte": "./tabs/InteractiveTabs.svelte",
89
91
  "./tabs/PillTabs.svelte": "./tabs/PillTabs.svelte"
@@ -0,0 +1,43 @@
1
+ <script>
2
+ export let color = "blue"; // {blue|gray|green|red|yellow|pink|purple}
3
+ export let bg = "text-gray-200";
4
+ export let size = "w-8 h-8";
5
+ export let align; // text-{left|center|right}
6
+ let colorClass;
7
+ if (color === "blud") {
8
+ colorClass = "fill-blue-600";
9
+ } else if (color === "gray") {
10
+ colorClass = "fill-gray-600 dark:fill-gray-300";
11
+ } else if (color === "green") {
12
+ colorClass = "fill-green-500";
13
+ } else if (color === "red") {
14
+ colorClass = "fill-red-600";
15
+ } else if (color === "yellow") {
16
+ colorClass = "fill-yellow-400";
17
+ } else if (color === "pink") {
18
+ colorClass = "fill-pink-600";
19
+ } else if (color === "purple") {
20
+ colorClass = "fill-purple-600";
21
+ } else {
22
+ colorClass = "fill-blue-600";
23
+ }
24
+ </script>
25
+
26
+ <div class={align}>
27
+ <svg
28
+ role="status"
29
+ class="inline mr-2 {size} {bg} animate-spin dark:text-gray-600 {colorClass}"
30
+ viewBox="0 0 100 101"
31
+ fill="none"
32
+ xmlns="http://www.w3.org/2000/svg"
33
+ >
34
+ <path
35
+ d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
36
+ fill="currentColor"
37
+ />
38
+ <path
39
+ d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
40
+ fill="currentFill"
41
+ />
42
+ </svg>
43
+ </div>
@@ -0,0 +1,29 @@
1
+ /** @typedef {typeof __propDef.props} SpinProps */
2
+ /** @typedef {typeof __propDef.events} SpinEvents */
3
+ /** @typedef {typeof __propDef.slots} SpinSlots */
4
+ export default class Spin extends SvelteComponentTyped<{
5
+ align: any;
6
+ color?: string;
7
+ bg?: string;
8
+ size?: string;
9
+ }, {
10
+ [evt: string]: CustomEvent<any>;
11
+ }, {}> {
12
+ }
13
+ export type SpinProps = typeof __propDef.props;
14
+ export type SpinEvents = typeof __propDef.events;
15
+ export type SpinSlots = typeof __propDef.slots;
16
+ import { SvelteComponentTyped } from "svelte";
17
+ declare const __propDef: {
18
+ props: {
19
+ align: any;
20
+ color?: string;
21
+ bg?: string;
22
+ size?: string;
23
+ };
24
+ events: {
25
+ [evt: string]: CustomEvent<any>;
26
+ };
27
+ slots: {};
28
+ };
29
+ export {};
@@ -0,0 +1,37 @@
1
+ <script>
2
+ export let color; // {null|blue}
3
+ let colorClass;
4
+ let fillColor1;
5
+ let fillColor2;
6
+ if (color === "blue") {
7
+ colorClass =
8
+ "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 mr-2 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800 inline-flex items-center";
9
+ fillColor1 = "#E5E7EB";
10
+ fillColor2 = "currentColor";
11
+ } else {
12
+ colorClass =
13
+ "py-2.5 px-5 mr-2 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-2 focus:ring-blue-700 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 inline-flex items-center";
14
+ fillColor1 = "currentColor";
15
+ fillColor2 = "#1C64F2";
16
+ }
17
+ </script>
18
+
19
+ <button disabled type="button" class={colorClass}>
20
+ <svg
21
+ role="status"
22
+ class="inline mr-3 w-4 h-4 text-white animate-spin"
23
+ viewBox="0 0 100 101"
24
+ fill="none"
25
+ xmlns="http://www.w3.org/2000/svg"
26
+ >
27
+ <path
28
+ d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
29
+ fill={fillColor1}
30
+ />
31
+ <path
32
+ d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
33
+ fill={fillColor2}
34
+ />
35
+ </svg>
36
+ <slot>Loading ...</slot>
37
+ </button>
@@ -0,0 +1,27 @@
1
+ /** @typedef {typeof __propDef.props} SpinButtonProps */
2
+ /** @typedef {typeof __propDef.events} SpinButtonEvents */
3
+ /** @typedef {typeof __propDef.slots} SpinButtonSlots */
4
+ export default class SpinButton extends SvelteComponentTyped<{
5
+ color: any;
6
+ }, {
7
+ [evt: string]: CustomEvent<any>;
8
+ }, {
9
+ default: {};
10
+ }> {
11
+ }
12
+ export type SpinButtonProps = typeof __propDef.props;
13
+ export type SpinButtonEvents = typeof __propDef.events;
14
+ export type SpinButtonSlots = typeof __propDef.slots;
15
+ import { SvelteComponentTyped } from "svelte";
16
+ declare const __propDef: {
17
+ props: {
18
+ color: any;
19
+ };
20
+ events: {
21
+ [evt: string]: CustomEvent<any>;
22
+ };
23
+ slots: {
24
+ default: {};
25
+ };
26
+ };
27
+ export {};