flowbite-svelte 0.9.1 → 0.9.2

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 (43) hide show
  1. package/accordions/AccordionItem.svelte +31 -34
  2. package/accordions/AccordionItem.svelte.d.ts +6 -16
  3. package/buttongroups/ButtonGroup.svelte +1 -14
  4. package/buttongroups/ButtonGroup.svelte.d.ts +1 -1
  5. package/buttongroups/ButtonGroupOutline.svelte +1 -14
  6. package/buttongroups/ButtonGroupOutline.svelte.d.ts +1 -1
  7. package/cards/CtaCard.svelte +8 -19
  8. package/cards/CtaCard.svelte.d.ts +2 -2
  9. package/cards/EcommerceCard.svelte +1 -1
  10. package/cards/EcommerceCard.svelte.d.ts +2 -2
  11. package/cards/HorizontalCard.svelte +21 -24
  12. package/cards/HorizontalCard.svelte.d.ts +9 -22
  13. package/cards/InteractiveCard.svelte +96 -110
  14. package/cards/InteractiveCard.svelte.d.ts +10 -50
  15. package/darkmode/DarkMode.svelte +60 -69
  16. package/darkmode/DarkMode.svelte.d.ts +5 -12
  17. package/footer/LogoFooter.svelte +32 -48
  18. package/footer/LogoFooter.svelte.d.ts +11 -46
  19. package/footer/SimpleFooter.svelte +20 -33
  20. package/footer/SimpleFooter.svelte.d.ts +8 -36
  21. package/footer/SitemapFooter.svelte +43 -112
  22. package/footer/SitemapFooter.svelte.d.ts +13 -59
  23. package/footer/SocialMediaFooter.svelte.d.ts +14 -14
  24. package/navbar/DropdownNavbar.svelte +116 -201
  25. package/navbar/DropdownNavbar.svelte.d.ts +8 -52
  26. package/navbar/Navbar.svelte +68 -99
  27. package/navbar/Navbar.svelte.d.ts +8 -26
  28. package/package.json +1 -1
  29. package/spinners/Spinner.svelte +63 -57
  30. package/spinners/Spinner.svelte.d.ts +8 -17
  31. package/spinners/SpinnerButton.svelte +31 -31
  32. package/spinners/SpinnerButton.svelte.d.ts +6 -15
  33. package/tabs/DefaultTabs.svelte +13 -39
  34. package/tabs/DefaultTabs.svelte.d.ts +7 -23
  35. package/tabs/InteractiveTabs.svelte +33 -63
  36. package/tabs/InteractiveTabs.svelte.d.ts +7 -35
  37. package/tabs/PillTabs.svelte +12 -34
  38. package/tabs/PillTabs.svelte.d.ts +7 -21
  39. package/tooltips/LightTooltip.svelte +112 -114
  40. package/tooltips/LightTooltip.svelte.d.ts +6 -21
  41. package/tooltips/Tooltip.svelte +113 -114
  42. package/tooltips/Tooltip.svelte.d.ts +6 -21
  43. package/types.d.ts +48 -5
@@ -1,44 +1,41 @@
1
- <script>
2
- import { getContext } from "svelte";
3
- import collapse from "svelte-collapse";
4
- import {
5
- ChevronDownIconSolid,
6
- ChevronUpIconSolid,
7
- } from "@codewithshin/svelte-heroicons";
8
- export let id;
9
- const store = getContext("svelte-collapsible-accordion");
10
- $: params = {
1
+ <script >import { getContext } from 'svelte';
2
+ import collapse from 'svelte-collapse';
3
+ import { ChevronDownIconSolid, ChevronUpIconSolid } from '@codewithshin/svelte-heroicons';
4
+ export let id;
5
+ const store = getContext('svelte-collapsible-accordion');
6
+ $: params = {
11
7
  open: $store.id === id,
12
8
  duration: $store.duration,
13
- easing: $store.easing,
14
- };
15
- const handleToggle = () => {
9
+ easing: $store.easing
10
+ };
11
+ const handleToggle = () => {
16
12
  if (params.open) {
17
- store.update((s) => Object.assign(s, { id: null }));
18
- } else {
19
- store.update((s) => Object.assign(s, { id }));
13
+ store.update((s) => Object.assign(s, { id: null }));
20
14
  }
21
- };
15
+ else {
16
+ store.update((s) => Object.assign(s, { id }));
17
+ }
18
+ };
22
19
  </script>
23
20
 
24
21
  <h2 aria-expanded={params.open}>
25
- <button
26
- on:click={handleToggle}
27
- type="button"
28
- class:rounded-t-xl={id === "1"}
29
- class:border-t-0={id !== "1"}
30
- class="flex items-center focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 justify-between p-5 w-full font-medium border border-gray-200 dark:border-gray-700 text-left text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800"
31
- >
32
- <span><slot name="header" /></span>
33
- {#if params.open}
34
- <ChevronUpIconSolid />
35
- {:else}
36
- <ChevronDownIconSolid />
37
- {/if}
38
- </button>
22
+ <button
23
+ on:click={handleToggle}
24
+ type="button"
25
+ class:rounded-t-xl={id === '1'}
26
+ class:border-t-0={id !== '1'}
27
+ class="flex items-center focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 justify-between p-5 w-full font-medium border border-gray-200 dark:border-gray-700 text-left text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800"
28
+ >
29
+ <span><slot name="header" /></span>
30
+ {#if params.open}
31
+ <ChevronUpIconSolid />
32
+ {:else}
33
+ <ChevronDownIconSolid />
34
+ {/if}
35
+ </button>
39
36
  </h2>
40
37
  <div use:collapse={params}>
41
- <div class="p-5 border border-t-0 border-gray-200 dark:border-gray-700">
42
- <slot name="body" />
43
- </div>
38
+ <div class="p-5 border border-t-0 border-gray-200 dark:border-gray-700">
39
+ <slot name="body" />
40
+ </div>
44
41
  </div>
@@ -1,22 +1,7 @@
1
- /** @typedef {typeof __propDef.props} AccordionItemProps */
2
- /** @typedef {typeof __propDef.events} AccordionItemEvents */
3
- /** @typedef {typeof __propDef.slots} AccordionItemSlots */
4
- export default class AccordionItem extends SvelteComponentTyped<{
5
- id: any;
6
- }, {
7
- [evt: string]: CustomEvent<any>;
8
- }, {
9
- header: {};
10
- body: {};
11
- }> {
12
- }
13
- export type AccordionItemProps = typeof __propDef.props;
14
- export type AccordionItemEvents = typeof __propDef.events;
15
- export type AccordionItemSlots = typeof __propDef.slots;
16
1
  import { SvelteComponentTyped } from "svelte";
17
2
  declare const __propDef: {
18
3
  props: {
19
- id: any;
4
+ id: string;
20
5
  };
21
6
  events: {
22
7
  [evt: string]: CustomEvent<any>;
@@ -26,4 +11,9 @@ declare const __propDef: {
26
11
  body: {};
27
12
  };
28
13
  };
14
+ export declare type AccordionItemProps = typeof __propDef.props;
15
+ export declare type AccordionItemEvents = typeof __propDef.events;
16
+ export declare type AccordionItemSlots = typeof __propDef.slots;
17
+ export default class AccordionItem extends SvelteComponentTyped<AccordionItemProps, AccordionItemEvents, AccordionItemSlots> {
18
+ }
29
19
  export {};
@@ -1,17 +1,4 @@
1
- <script >export let buttons = [
2
- {
3
- name: 'Profile',
4
- link: '/'
5
- },
6
- {
7
- name: 'Settings',
8
- link: '/'
9
- },
10
- {
11
- name: 'Messages',
12
- link: '/'
13
- }
14
- ];
1
+ <script >export let buttons;
15
2
  let btnLength = buttons.length;
16
3
  let classFirst = 'inline-flex relative items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white rounded-l-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-700 dark:border-gray-600 dark:text-white dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-blue-500 dark:focus:text-white';
17
4
  let classMiddle = 'inline-flex relative items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white border-t border-b 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-700 dark:border-gray-600 dark:text-white dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-blue-500 dark:focus:text-white';
@@ -2,7 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  import type { ButtonGroupType } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
- buttons?: ButtonGroupType[];
5
+ buttons: ButtonGroupType[];
6
6
  };
7
7
  events: {
8
8
  [evt: string]: CustomEvent<any>;
@@ -1,17 +1,4 @@
1
- <script >export let buttons = [
2
- {
3
- name: 'Profile',
4
- link: '/'
5
- },
6
- {
7
- name: 'Settings',
8
- link: '/'
9
- },
10
- {
11
- name: 'Messages',
12
- link: '/'
13
- }
14
- ];
1
+ <script >export let buttons;
15
2
  let btnLength = buttons.length;
16
3
  let classFirst = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-transparent rounded-l-lg border border-gray-900 hover:bg-gray-900 hover:text-white focus:z-10 focus:ring-2 focus:ring-gray-500 focus:bg-gray-900 focus:text-white dark:border-white dark:text-white dark:hover:text-white dark:hover:bg-gray-700 dark:focus:bg-gray-700';
17
4
  let classMiddle = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-transparent border-t border-b border-gray-900 hover:bg-gray-900 hover:text-white focus:z-10 focus:ring-2 focus:ring-gray-500 focus:bg-gray-900 focus:text-white dark:border-white dark:text-white dark:hover:text-white dark:hover:bg-gray-700 dark:focus:bg-gray-700';
@@ -2,7 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  import type { ButtonGroupType } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
- buttons?: ButtonGroupType[];
5
+ buttons: ButtonGroupType[];
6
6
  };
7
7
  events: {
8
8
  [evt: string]: CustomEvent<any>;
@@ -1,20 +1,7 @@
1
1
  <script >import Button from '../buttons/Button.svelte';
2
2
  export let title = 'Work fast from anywhere';
3
3
  export let headColor = 'gray';
4
- export let btns = [
5
- {
6
- textSize: 'text-base',
7
- name: 'Download it',
8
- type: 'blue',
9
- link: '/about'
10
- },
11
- {
12
- textSize: 'text-base',
13
- name: 'Get in on',
14
- type: 'red-outline',
15
- link: '/'
16
- }
17
- ];
4
+ export let btns;
18
5
  let headClass;
19
6
  if (headColor === 'blue') {
20
7
  headClass = 'mb-2 text-3xl font-bold text-blue-900 dark:text-white';
@@ -55,10 +42,12 @@ else {
55
42
  <slot />
56
43
  </p>
57
44
  <div class="justify-center items-center space-y-4 sm:flex sm:space-y-0 sm:space-x-4">
58
- {#each btns as { name, textSize, type, link, rel, rounded }}
59
- <a href={link} {rel}>
60
- <Button {name} {rounded} {type} {textSize} />
61
- </a>
62
- {/each}
45
+ {#if btns}
46
+ {#each btns as { name, textSize, type, link, rel, rounded }}
47
+ <a href={link} {rel}>
48
+ <Button {name} {rounded} {type} {textSize} />
49
+ </a>
50
+ {/each}
51
+ {/if}
63
52
  </div>
64
53
  </div>
@@ -1,10 +1,10 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { CardButton, Colors } from '../types';
2
+ import type { CardButtonType, Colors } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
5
  title?: string;
6
6
  headColor?: Colors;
7
- btns?: CardButton[];
7
+ btns: CardButtonType[];
8
8
  };
9
9
  events: {
10
10
  [evt: string]: CustomEvent<any>;
@@ -2,7 +2,7 @@
2
2
  src: '/images/product-1.png',
3
3
  alt: 'product image'
4
4
  };
5
- export let link = '/#';
5
+ export let link = '/';
6
6
  export let btnColor = 'blue';
7
7
  export let rel;
8
8
  export let title = 'Apple Watch Series 7 GPS, Aluminium Case, Starlight Sport';
@@ -1,8 +1,8 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { CardImg, Colors } from '../types';
2
+ import type { ImgType, Colors } from '../types';
3
3
  declare const __propDef: {
4
4
  props: {
5
- img?: CardImg;
5
+ img?: ImgType;
6
6
  link?: string;
7
7
  btnColor?: Colors;
8
8
  rel: string;
@@ -1,29 +1,26 @@
1
- <script>
2
- export let link;
3
- export let rel;
4
- export let img = "/images/image-4.jpeg";
5
- export let alt;
6
- export let header = "Lorem ipsum dolor sit ametit.";
1
+ <script >export let link;
2
+ export let rel;
3
+ export let img = '/images/image-4.jpeg';
4
+ export let alt;
5
+ export let header = 'Lorem ipsum dolor sit ametit.';
7
6
  </script>
8
7
 
9
8
  <a
10
- href={link}
11
- {rel}
12
- class="flex flex-col items-center bg-white rounded-lg border shadow-md md:flex-row md:max-w-xl hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700"
9
+ href={link}
10
+ {rel}
11
+ class="flex flex-col items-center bg-white rounded-lg border shadow-md md:flex-row md:max-w-xl hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700"
13
12
  >
14
- <img
15
- class="object-cover w-full h-96 rounded-t-lg md:h-auto md:w-48 md:rounded-none md:rounded-l-lg"
16
- src={img}
17
- {alt}
18
- />
19
- <div class="flex flex-col justify-between p-4 leading-normal">
20
- <h5
21
- class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white"
22
- >
23
- {header}
24
- </h5>
25
- <p class="mb-3 font-normal text-gray-700 dark:text-gray-400">
26
- <slot />
27
- </p>
28
- </div>
13
+ <img
14
+ class="object-cover w-full h-96 rounded-t-lg md:h-auto md:w-48 md:rounded-none md:rounded-l-lg"
15
+ src={img}
16
+ {alt}
17
+ />
18
+ <div class="flex flex-col justify-between p-4 leading-normal">
19
+ <h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">
20
+ {header}
21
+ </h5>
22
+ <p class="mb-3 font-normal text-gray-700 dark:text-gray-400">
23
+ <slot />
24
+ </p>
25
+ </div>
29
26
  </a>
@@ -1,29 +1,11 @@
1
- /** @typedef {typeof __propDef.props} HorizontalCardProps */
2
- /** @typedef {typeof __propDef.events} HorizontalCardEvents */
3
- /** @typedef {typeof __propDef.slots} HorizontalCardSlots */
4
- export default class HorizontalCard extends SvelteComponentTyped<{
5
- link: any;
6
- rel: any;
7
- alt: any;
8
- header?: string;
9
- img?: string;
10
- }, {
11
- [evt: string]: CustomEvent<any>;
12
- }, {
13
- default: {};
14
- }> {
15
- }
16
- export type HorizontalCardProps = typeof __propDef.props;
17
- export type HorizontalCardEvents = typeof __propDef.events;
18
- export type HorizontalCardSlots = typeof __propDef.slots;
19
1
  import { SvelteComponentTyped } from "svelte";
20
2
  declare const __propDef: {
21
3
  props: {
22
- link: any;
23
- rel: any;
24
- alt: any;
25
- header?: string;
4
+ link: string;
5
+ rel: string;
26
6
  img?: string;
7
+ alt: string;
8
+ header?: string;
27
9
  };
28
10
  events: {
29
11
  [evt: string]: CustomEvent<any>;
@@ -32,4 +14,9 @@ declare const __propDef: {
32
14
  default: {};
33
15
  };
34
16
  };
17
+ export declare type HorizontalCardProps = typeof __propDef.props;
18
+ export declare type HorizontalCardEvents = typeof __propDef.events;
19
+ export declare type HorizontalCardSlots = typeof __propDef.slots;
20
+ export default class HorizontalCard extends SvelteComponentTyped<HorizontalCardProps, HorizontalCardEvents, HorizontalCardSlots> {
21
+ }
35
22
  export {};
@@ -1,127 +1,113 @@
1
- <script>
2
- let isOpen = true;
3
- const toggleDropdown = () => {
1
+ <script >let isOpen = true;
2
+ const toggleDropdown = () => {
4
3
  isOpen = !isOpen;
5
- };
6
-
7
- export let dropdownLinks = [
8
- {
9
- href: "/",
10
- label: "label 1",
11
- },
12
- {
13
- href: "about",
14
- label: "About",
15
- },
16
- {
17
- href: "profile",
18
- label: "Profile",
19
- },
20
- ];
21
- export let img = {
22
- src: "",
23
- alt: "",
24
- };
25
- export let header = "Lorem ipsum";
26
- export let content = "Proin efficitur purus felis.";
27
- export let buttonColor = "blue";
28
- export let link1 = { href: "", title: "", rel: "" };
29
- export let link2 = { href: "", title: "", rel: "" };
30
- let linkClass;
31
- if (buttonColor === "blue") {
4
+ };
5
+ export let dropdownLinks;
6
+ export let img;
7
+ export let header = 'Lorem ipsum';
8
+ export let content = 'Proin efficitur purus felis.';
9
+ export let buttonColor = 'blue';
10
+ export let link1;
11
+ export let link2;
12
+ let linkClass;
13
+ if (buttonColor === 'blue') {
32
14
  linkClass =
33
- "inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800";
34
- } else if (buttonColor === "gray") {
15
+ 'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
16
+ }
17
+ else if (buttonColor === 'gray') {
35
18
  linkClass =
36
- "inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-gray-700 rounded-lg hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800";
37
- } else if (buttonColor === "red") {
19
+ 'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-gray-700 rounded-lg hover:bg-gray-800 focus:ring-4 focus:ring-gray-300 dark:bg-gray-600 dark:hover:bg-gray-700 dark:focus:ring-gray-800';
20
+ }
21
+ else if (buttonColor === 'red') {
38
22
  linkClass =
39
- "inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-red-700 rounded-lg hover:bg-red-800 focus:ring-4 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800";
40
- } else if (buttonColor === "yellow") {
23
+ 'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-red-700 rounded-lg hover:bg-red-800 focus:ring-4 focus:ring-red-300 dark:bg-red-600 dark:hover:bg-red-700 dark:focus:ring-red-800';
24
+ }
25
+ else if (buttonColor === 'yellow') {
41
26
  linkClass =
42
- "inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-yellow-700 rounded-lg hover:bg-yellow-800 focus:ring-4 focus:ring-yellow-300 dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800";
43
- } else if (buttonColor === "green") {
27
+ 'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-yellow-700 rounded-lg hover:bg-yellow-800 focus:ring-4 focus:ring-yellow-300 dark:bg-yellow-600 dark:hover:bg-yellow-700 dark:focus:ring-yellow-800';
28
+ }
29
+ else if (buttonColor === 'green') {
44
30
  linkClass =
45
- "inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-green-700 rounded-lg hover:bg-green-800 focus:ring-4 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800";
46
- } else if (buttonColor === "indigo") {
31
+ 'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-green-700 rounded-lg hover:bg-green-800 focus:ring-4 focus:ring-green-300 dark:bg-green-600 dark:hover:bg-green-700 dark:focus:ring-green-800';
32
+ }
33
+ else if (buttonColor === 'indigo') {
47
34
  linkClass =
48
- "inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-indigo-700 rounded-lg hover:bg-indigo-800 focus:ring-4 focus:ring-indigo-300 dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800";
49
- } else if (buttonColor === "purple") {
35
+ 'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-indigo-700 rounded-lg hover:bg-indigo-800 focus:ring-4 focus:ring-indigo-300 dark:bg-indigo-600 dark:hover:bg-indigo-700 dark:focus:ring-indigo-800';
36
+ }
37
+ else if (buttonColor === 'purple') {
50
38
  linkClass =
51
- "inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-purple-700 rounded-lg hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800";
52
- } else if (buttonColor === "pink") {
39
+ 'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-purple-700 rounded-lg hover:bg-purple-800 focus:ring-4 focus:ring-purple-300 dark:bg-purple-600 dark:hover:bg-purple-700 dark:focus:ring-purple-800';
40
+ }
41
+ else if (buttonColor === 'pink') {
53
42
  linkClass =
54
- "inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-pink-700 rounded-lg hover:bg-pink-800 focus:ring-4 focus:ring-pink-300 dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800";
55
- } else {
43
+ 'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-pink-700 rounded-lg hover:bg-pink-800 focus:ring-4 focus:ring-pink-300 dark:bg-pink-600 dark:hover:bg-pink-700 dark:focus:ring-pink-800';
44
+ }
45
+ else {
56
46
  linkClass =
57
- "inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800";
58
- }
47
+ 'inline-flex items-center py-2 px-4 text-sm font-medium text-center text-white bg-blue-700 rounded-lg hover:bg-blue-800 focus:ring-4 focus:ring-blue-300 dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800';
48
+ }
59
49
  </script>
60
50
 
61
51
  <div
62
- class="max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700"
52
+ class="max-w-sm bg-white rounded-lg border border-gray-200 shadow-md dark:bg-gray-800 dark:border-gray-700"
63
53
  >
64
- <div class="flex justify-end px-4 pt-4">
65
- <button
66
- id="dropdownButton"
67
- on:click={toggleDropdown}
68
- class="sm:inline-block text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-1.5"
69
- type="button"
70
- >
71
- <svg
72
- class="w-6 h-6"
73
- fill="currentColor"
74
- viewBox="0 0 20 20"
75
- xmlns="http://www.w3.org/2000/svg"
76
- ><path
77
- d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"
78
- /></svg
79
- >
80
- </button>
54
+ <div class="flex justify-end px-4 pt-4">
55
+ <button
56
+ id="dropdownButton"
57
+ on:click={toggleDropdown}
58
+ class="sm:inline-block text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-700 focus:outline-none focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-700 rounded-lg text-sm p-1.5"
59
+ type="button"
60
+ >
61
+ <svg
62
+ class="w-6 h-6"
63
+ fill="currentColor"
64
+ viewBox="0 0 20 20"
65
+ xmlns="http://www.w3.org/2000/svg"
66
+ ><path
67
+ d="M10 6a2 2 0 110-4 2 2 0 010 4zM10 12a2 2 0 110-4 2 2 0 010 4zM10 18a2 2 0 110-4 2 2 0 010 4z"
68
+ /></svg
69
+ >
70
+ </button>
81
71
 
82
- <div
83
- id="dropdown"
84
- class:hidden={isOpen}
85
- class:block={!isOpen}
86
- class="hidden z-10 w-44 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 absolute"
87
- >
88
- <ul class="py-1" aria-labelledby="dropdownButton">
89
- {#each dropdownLinks as { href, label, rel }}
90
- <li>
91
- <a
92
- {href}
93
- {rel}
94
- class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white"
95
- >{label}</a
96
- >
97
- </li>
98
- {/each}
99
- </ul>
100
- </div>
101
- </div>
72
+ <div
73
+ id="dropdown"
74
+ class:hidden={isOpen}
75
+ class:block={!isOpen}
76
+ class="hidden z-10 w-44 text-base list-none bg-white rounded divide-y divide-gray-100 shadow dark:bg-gray-700 absolute"
77
+ >
78
+ <ul class="py-1" aria-labelledby="dropdownButton">
79
+ {#each dropdownLinks as { href, label, rel }}
80
+ <li>
81
+ <a
82
+ {href}
83
+ {rel}
84
+ class="block py-2 px-4 text-sm text-gray-700 hover:bg-gray-100 dark:hover:bg-gray-600 dark:text-gray-200 dark:hover:text-white"
85
+ >{label}</a
86
+ >
87
+ </li>
88
+ {/each}
89
+ </ul>
90
+ </div>
91
+ </div>
102
92
 
103
- <div class="flex flex-col items-center pb-10">
104
- <img
105
- class="mb-3 w-24 h-24 rounded-full shadow-lg"
106
- src={img.src}
107
- alt={img.alt}
108
- />
109
- <h3 class="mb-1 text-xl font-medium text-gray-900 dark:text-white">
110
- {header}
111
- </h3>
112
- <span class="text-sm text-gray-500 dark:text-gray-400">{content}</span>
113
- <div class="flex mt-4 space-x-3 lg:mt-6">
114
- {#if link1.href}
115
- <a href={link1.href} rel={link1.rel} class={linkClass}>{link1.title}</a>
116
- {/if}
117
- {#if link2.href}
118
- <a
119
- href={link2.href}
120
- rel={link2.rel}
121
- class="inline-flex items-center py-2 px-4 text-sm font-medium text-center text-gray-900 bg-white rounded-lg border border-gray-300 hover:bg-gray-100 focus:ring-4 focus:ring-blue-300 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-700 dark:focus:ring-gray-800"
122
- >{link2.title}</a
123
- >
124
- {/if}
125
- </div>
126
- </div>
93
+ <div class="flex flex-col items-center pb-10">
94
+ <img class="mb-3 w-24 h-24 rounded-full shadow-lg" src={img.src} alt={img.alt} />
95
+ <h3 class="mb-1 text-xl font-medium text-gray-900 dark:text-white">
96
+ {header}
97
+ </h3>
98
+ <span class="text-sm text-gray-500 dark:text-gray-400">{content}</span>
99
+ <div class="flex mt-4 space-x-3 lg:mt-6">
100
+ {#if link1.link}
101
+ <a href={link1.link} rel={link1.rel} class={linkClass}>{link1.name}</a>
102
+ {/if}
103
+ {#if link2.link}
104
+ <a
105
+ href={link2.link}
106
+ rel={link2.rel}
107
+ class="inline-flex items-center py-2 px-4 text-sm font-medium text-center text-gray-900 bg-white rounded-lg border border-gray-300 hover:bg-gray-100 focus:ring-4 focus:ring-blue-300 dark:bg-gray-800 dark:text-white dark:border-gray-600 dark:hover:bg-gray-700 dark:hover:border-gray-700 dark:focus:ring-gray-800"
108
+ >{link2.name}</a
109
+ >
110
+ {/if}
111
+ </div>
112
+ </div>
127
113
  </div>
@@ -1,63 +1,23 @@
1
- /** @typedef {typeof __propDef.props} InteractiveCardProps */
2
- /** @typedef {typeof __propDef.events} InteractiveCardEvents */
3
- /** @typedef {typeof __propDef.slots} InteractiveCardSlots */
4
- export default class InteractiveCard extends SvelteComponentTyped<{
5
- header?: string;
6
- img?: {
7
- src: string;
8
- alt: string;
9
- };
10
- dropdownLinks?: {
11
- href: string;
12
- label: string;
13
- }[];
14
- content?: string;
15
- buttonColor?: string;
16
- link1?: {
17
- href: string;
18
- title: string;
19
- rel: string;
20
- };
21
- link2?: {
22
- href: string;
23
- title: string;
24
- rel: string;
25
- };
26
- }, {
27
- [evt: string]: CustomEvent<any>;
28
- }, {}> {
29
- }
30
- export type InteractiveCardProps = typeof __propDef.props;
31
- export type InteractiveCardEvents = typeof __propDef.events;
32
- export type InteractiveCardSlots = typeof __propDef.slots;
33
1
  import { SvelteComponentTyped } from "svelte";
2
+ import type { DropdownLinkType, ImgType, LinkType } from '../types';
34
3
  declare const __propDef: {
35
4
  props: {
5
+ dropdownLinks: DropdownLinkType[];
6
+ img: ImgType;
36
7
  header?: string;
37
- img?: {
38
- src: string;
39
- alt: string;
40
- };
41
- dropdownLinks?: {
42
- href: string;
43
- label: string;
44
- }[];
45
8
  content?: string;
46
9
  buttonColor?: string;
47
- link1?: {
48
- href: string;
49
- title: string;
50
- rel: string;
51
- };
52
- link2?: {
53
- href: string;
54
- title: string;
55
- rel: string;
56
- };
10
+ link1: LinkType;
11
+ link2: LinkType;
57
12
  };
58
13
  events: {
59
14
  [evt: string]: CustomEvent<any>;
60
15
  };
61
16
  slots: {};
62
17
  };
18
+ export declare type InteractiveCardProps = typeof __propDef.props;
19
+ export declare type InteractiveCardEvents = typeof __propDef.events;
20
+ export declare type InteractiveCardSlots = typeof __propDef.slots;
21
+ export default class InteractiveCard extends SvelteComponentTyped<InteractiveCardProps, InteractiveCardEvents, InteractiveCardSlots> {
22
+ }
63
23
  export {};