flowbite-svelte 0.14.13 → 0.14.16

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 (110) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/LICENSE +22 -0
  3. package/README.md +11 -0
  4. package/accordions/AccordionDefault.svelte +1 -1
  5. package/accordions/AccordionItem.svelte +1 -1
  6. package/alerts/Alert.svelte +1 -1
  7. package/alerts/BorderAlert.svelte +1 -1
  8. package/alerts/InfoAlert.svelte +1 -1
  9. package/auth/Confirm.svelte +1 -1
  10. package/auth/ForgotPassword.svelte +1 -1
  11. package/auth/Login.svelte +1 -1
  12. package/auth/Register.svelte +1 -1
  13. package/auth/Reset.svelte +1 -1
  14. package/avatar/Avatar.svelte +1 -1
  15. package/badges/Badge.svelte +1 -1
  16. package/badges/BadgeIcon.svelte +1 -1
  17. package/badges/BadgeLink.svelte +1 -1
  18. package/breadcrumbs/Breadcrumb.svelte +1 -1
  19. package/buttongroups/ButtonGroup.svelte +1 -1
  20. package/buttongroups/ButtonGroupOutline.svelte +1 -1
  21. package/buttons/Button.svelte +1 -1
  22. package/buttons/ColorShadowButton.svelte +1 -1
  23. package/buttons/GradientDuotoneButton.svelte +1 -1
  24. package/buttons/GradientMonochromeButton.svelte +1 -1
  25. package/buttons/GradientOutlineButton.svelte +1 -1
  26. package/cards/Card.svelte +1 -1
  27. package/cards/CtaCard.svelte +1 -1
  28. package/cards/EcommerceCard.svelte +1 -1
  29. package/cards/HorizontalCard.svelte +1 -1
  30. package/cards/InteractiveCard.svelte +1 -1
  31. package/cards/ListCard.svelte +1 -1
  32. package/cards/SignInCard.svelte +1 -1
  33. package/carousels/Caption.svelte +1 -1
  34. package/carousels/Carousel.svelte +16 -60
  35. package/carousels/Carousel.svelte.d.ts +2 -0
  36. package/carousels/CarouselTransition.svelte +16 -60
  37. package/carousels/CarouselTransition.svelte.d.ts +2 -0
  38. package/carousels/Indicator.svelte +1 -1
  39. package/carousels/Slide.svelte +1 -1
  40. package/carousels/Thumbnail.svelte +1 -1
  41. package/darkmode/DarkMode.svelte +1 -1
  42. package/dropdowns/DropdownDefault.svelte +1 -1
  43. package/dropdowns/ImgDropdown.svelte +1 -1
  44. package/footer/LogoFooter.svelte +1 -1
  45. package/footer/SimpleFooter.svelte +1 -1
  46. package/footer/SitemapFooter.svelte +1 -1
  47. package/footer/SocialMediaFooter.svelte +1 -1
  48. package/forms/Checkbox.svelte +1 -1
  49. package/forms/Fileupload.svelte +1 -1
  50. package/forms/FloatingLabelInput.svelte +1 -1
  51. package/forms/Iconinput.svelte +1 -1
  52. package/forms/Input.svelte +1 -1
  53. package/forms/Radio.svelte +1 -1
  54. package/forms/Select.svelte +1 -1
  55. package/forms/SingleCheckbox.svelte +1 -1
  56. package/forms/Textarea.svelte +1 -1
  57. package/forms/Toggle.svelte +1 -1
  58. package/index.js +5 -0
  59. package/list-group/List.svelte +1 -1
  60. package/modals/ExtraLargeModal.svelte +1 -1
  61. package/modals/LargeModal.svelte +1 -1
  62. package/modals/MediumModal.svelte +1 -1
  63. package/modals/ModalButton.svelte +1 -1
  64. package/modals/SignInModal.svelte +1 -1
  65. package/modals/SmallModal.svelte +1 -1
  66. package/navbar/DropdownNavbar.svelte +1 -1
  67. package/navbar/NavDropdown.svelte +1 -1
  68. package/navbar/Navbar.svelte +1 -1
  69. package/package.json +7 -2
  70. package/paginations/Next.svelte +1 -1
  71. package/paginations/Pagination.svelte +1 -1
  72. package/paginations/Previous.svelte +1 -1
  73. package/paginations/TableData.svelte +1 -1
  74. package/progressbars/Progressbar.svelte +1 -1
  75. package/ratings/AdvancedRating.svelte +24 -0
  76. package/ratings/AdvancedRating.svelte.d.ts +28 -0
  77. package/ratings/Rating.svelte +25 -0
  78. package/ratings/Rating.svelte.d.ts +23 -0
  79. package/ratings/RatingComment.svelte +30 -0
  80. package/ratings/RatingComment.svelte.d.ts +28 -0
  81. package/ratings/ScoreRating.svelte +52 -0
  82. package/ratings/ScoreRating.svelte.d.ts +36 -0
  83. package/sidebars/Sidebar.svelte +1 -1
  84. package/sidebars/SidebarDropdown.svelte +1 -1
  85. package/spinners/Spinner.svelte +1 -1
  86. package/spinners/SpinnerButton.svelte +1 -1
  87. package/tables/Table.svelte +1 -1
  88. package/tables/TableCheckbox.svelte +1 -1
  89. package/tables/TableDefaultRow.svelte +1 -1
  90. package/tables/TableSearch.svelte +1 -1
  91. package/tabs/DefaultTabs.svelte +1 -1
  92. package/tabs/FullWidthTabs.svelte +1 -1
  93. package/tabs/IconTabs.svelte +1 -1
  94. package/tabs/InteractiveTabHead.svelte +1 -1
  95. package/tabs/InteractiveTabs.svelte +1 -1
  96. package/tabs/PillTabs.svelte +1 -1
  97. package/tabs/TabContent.svelte +1 -1
  98. package/tabs/UnderlineTabs.svelte +1 -1
  99. package/timelines/Activity.svelte +1 -1
  100. package/timelines/ActivityItem.svelte +1 -1
  101. package/timelines/Group.svelte +1 -1
  102. package/timelines/GroupItem.svelte +1 -1
  103. package/timelines/Timeline.svelte +1 -1
  104. package/timelines/TimelineHorizontal.svelte +1 -1
  105. package/timelines/TimelineItem.svelte +1 -1
  106. package/timelines/TimelineItemHorizontal.svelte +1 -1
  107. package/timelines/TimelineItemVertical.svelte +1 -1
  108. package/toasts/Toast.svelte +1 -1
  109. package/tooltips/LightTooltip.svelte +1 -1
  110. package/tooltips/Tooltip.svelte +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,27 @@
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.14.16](https://github.com/themesberg/flowbite-svelte/compare/v0.14.15...v0.14.16) (2022-04-24)
6
+
7
+
8
+ ### Features
9
+
10
+ * update svelte to 3.47.0 ([2c51f1c](https://github.com/themesberg/flowbite-svelte/commit/2c51f1c21907f7a977249e3dfe7c2fe46dd85553))
11
+
12
+ ### [0.14.15](https://github.com/themesberg/flowbite-svelte/compare/v0.14.14...v0.14.15) (2022-04-23)
13
+
14
+
15
+ ### Features
16
+
17
+ * add loop to carousel components ([0ae0d66](https://github.com/themesberg/flowbite-svelte/commit/0ae0d66aaf74c7b588978ce88ab7c5117ee4a4e2))
18
+
19
+ ### [0.14.14](https://github.com/themesberg/flowbite-svelte/compare/v0.14.13...v0.14.14) (2022-04-21)
20
+
21
+
22
+ ### Features
23
+
24
+ * add Rating, AdvancedRating, and ScoreRating components ([8c91712](https://github.com/themesberg/flowbite-svelte/commit/8c91712d703364948b00c387a2b3f1d42be6159f))
25
+
5
26
  ### [0.14.13](https://github.com/themesberg/flowbite-svelte/compare/v0.14.12...v0.14.13) (2022-04-20)
6
27
 
7
28
 
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2022 Shinichi Okada
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+
package/README.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # FLOWBITE-SVELTE
2
2
 
3
+ [![npm version](https://badgen.net/npm/v/flowbite-svelte)](https://www.npmjs.com/package/flowbite-svelte)
4
+ [![npm downloads](https://badgen.net/npm/dw/flowbite-svelte)](https://www.npmjs.com/package/flowbite-svelte)
5
+ [![release](https://badgen.net/github/release/themesberg/flowbite-svelte)](https://github.com/themesberg/flowbite-svelte/releases)
6
+ [![release](https://badgen.net/github/release/themesberg/flowbite-svelte)](https://github.com/themesberg/flowbite-svelte/releases)
7
+ [![license](https://badgen.net/npm/license/themesberg/flowbite-svelte)](https://github.com/shinokada/svelte-feathericons/blob/main/LICENSE)
8
+
9
+
10
+
11
+
12
+
13
+
3
14
  [Flowbite-Svelte](https://flowbite-svelte.vercel.app/) is an official Flowbite component library for Svelte. All interactivities are handled by Svelte.
4
15
 
5
16
  ## Installation
@@ -1,4 +1,4 @@
1
- <script >import { onDestroy } from 'svelte';
1
+ <script>import { onDestroy } from 'svelte';
2
2
  import { setContext } from 'svelte';
3
3
  import { createEventDispatcher } from 'svelte';
4
4
  import { writable } from 'svelte/store';
@@ -1,4 +1,4 @@
1
- <script >import { getContext } from 'svelte';
1
+ <script>import { getContext } from 'svelte';
2
2
  import collapse from 'svelte-collapse';
3
3
  import { ChevronDownIconSolid, ChevronUpIconSolid } from '@codewithshin/svelte-heroicons';
4
4
  export let id = '';
@@ -1,4 +1,4 @@
1
- <script >import { createEventDispatcher } from 'svelte';
1
+ <script>import { createEventDispatcher } from 'svelte';
2
2
  const dispatch = createEventDispatcher();
3
3
  export let color = 'blue';
4
4
  export let alertId = 'alert-1';
@@ -1,4 +1,4 @@
1
- <script >export let color = 'blue';
1
+ <script>export let color = 'blue';
2
2
  export let alertId = 'alert-border-1';
3
3
  export let closeBtn = false;
4
4
  let hidden = false;
@@ -1,4 +1,4 @@
1
- <script >export let color = 'blue';
1
+ <script>export let color = 'blue';
2
2
  export let alertId = 'alert-additional-content-1';
3
3
  export let infoLink = undefined;
4
4
  export let closeBtn = false;
@@ -1,4 +1,4 @@
1
- <script >import { Button, Alert, Spinner } from '../index';
1
+ <script>import { Button, Alert, Spinner } from '../index';
2
2
  export let loginLink;
3
3
  export let success;
4
4
  export let error;
@@ -1,4 +1,4 @@
1
- <script >import { Alert } from '../index';
1
+ <script>import { Alert } from '../index';
2
2
  export let forgot = undefined;
3
3
  export let email = '';
4
4
  export let error = '';
package/auth/Login.svelte CHANGED
@@ -1,4 +1,4 @@
1
- <script >import { Alert } from '../index';
1
+ <script>import { Alert } from '../index';
2
2
  export let login = undefined;
3
3
  export let title = 'Sign in';
4
4
  export let btnSignInColor = 'blue';
@@ -1,4 +1,4 @@
1
- <script >import { Alert } from '../index';
1
+ <script>import { Alert } from '../index';
2
2
  import { createEventDispatcher } from 'svelte';
3
3
  const dispatch = createEventDispatcher();
4
4
  export let register = undefined;
package/auth/Reset.svelte CHANGED
@@ -1,4 +1,4 @@
1
- <script >import { Alert } from '../index';
1
+ <script>import { Alert } from '../index';
2
2
  export let resetpw = undefined;
3
3
  export let password = '';
4
4
  export let email = '';
@@ -1,4 +1,4 @@
1
- <script >export let avatar = {};
1
+ <script>export let avatar = {};
2
2
  let isCircle = avatar.round ? 'rounded-full' : 'rounded';
3
3
  let isBorder = avatar.border ? 'p-1 ring-2 ring-gray-300 dark:ring-gray-500' : '';
4
4
  export let avatarClass = `w-${avatar.size} h-${avatar.size} ${isCircle} ${isBorder}`;
@@ -1,4 +1,4 @@
1
- <script >export let textSize = 'text-xs';
1
+ <script>export let textSize = 'text-xs';
2
2
  export let name = 'Read more';
3
3
  export let color = 'blue';
4
4
  let badgeClass;
@@ -1,4 +1,4 @@
1
- <script >export let textSize = 'text-xs';
1
+ <script>export let textSize = 'text-xs';
2
2
  export let name = '';
3
3
  export let color = 'blue';
4
4
  let badgeClass;
@@ -1,4 +1,4 @@
1
- <script >export let textSize = 'text-xs';
1
+ <script>export let textSize = 'text-xs';
2
2
  export let name = 'Read more';
3
3
  export let color = 'blue';
4
4
  export let href = '/';
@@ -1,4 +1,4 @@
1
- <script >export let crumbs = [];
1
+ <script>export let crumbs = [];
2
2
  export let homeClass = 'inline-flex items-center text-sm font-medium text-gray-700 hover:text-gray-900 dark:text-gray-400 dark:hover:text-white';
3
3
  export let crumbClass = 'ml-1 text-sm font-medium text-gray-700 hover:text-gray-900 md:ml-2 dark:text-gray-400 dark:hover:text-white';
4
4
  export let solid = false;
@@ -1,4 +1,4 @@
1
- <script >export let buttons;
1
+ <script>export let buttons;
2
2
  let btnLength = buttons.length;
3
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';
4
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';
@@ -1,4 +1,4 @@
1
- <script >export let buttons;
1
+ <script>export let buttons;
2
2
  let btnLength = buttons.length;
3
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';
4
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';
@@ -1,4 +1,4 @@
1
- <script >export let rounded = false;
1
+ <script>export let rounded = false;
2
2
  export let textSize = 'text-sm';
3
3
  export let name = 'Read more';
4
4
  export let btnColor = 'blue';
@@ -1,4 +1,4 @@
1
- <script >export let textSize = 'text-sm';
1
+ <script>export let textSize = 'text-sm';
2
2
  export let color = 'blue';
3
3
  export let name = 'Read more';
4
4
  let btnClass;
@@ -1,4 +1,4 @@
1
- <script >export let textSize = 'text-sm';
1
+ <script>export let textSize = 'text-sm';
2
2
  export let color = 'purple2blue';
3
3
  export let name = 'Read more';
4
4
  let btnClass;
@@ -1,4 +1,4 @@
1
- <script >export let textSize = 'text-sm';
1
+ <script>export let textSize = 'text-sm';
2
2
  export let color = 'blue';
3
3
  export let name = 'Read more';
4
4
  let btnClass;
@@ -1,4 +1,4 @@
1
- <script >export let textSize = 'text-sm';
1
+ <script>export let textSize = 'text-sm';
2
2
  export let color = 'purple2blue';
3
3
  export let name = 'Read more';
4
4
  export let type = 'button';
package/cards/Card.svelte CHANGED
@@ -1,4 +1,4 @@
1
- <script >export let link = '';
1
+ <script>export let link = '';
2
2
  export let rel = '';
3
3
  export let alt = '';
4
4
  export let img = '';
@@ -1,4 +1,4 @@
1
- <script >import Button from '../buttons/Button.svelte';
1
+ <script>import Button from '../buttons/Button.svelte';
2
2
  export let title = 'Work fast from anywhere';
3
3
  export let headColor = 'gray';
4
4
  export let btns;
@@ -1,4 +1,4 @@
1
- <script >export let img;
1
+ <script>export let img;
2
2
  export let href = '/';
3
3
  export let btnColor = 'blue';
4
4
  export let rel = '';
@@ -1,4 +1,4 @@
1
- <script >export let link = '';
1
+ <script>export let link = '';
2
2
  export let rel = '';
3
3
  export let img = '/images/image-4.jpeg';
4
4
  export let alt = '';
@@ -1,4 +1,4 @@
1
- <script >let isOpen = true;
1
+ <script>let isOpen = true;
2
2
  const toggleDropdown = () => {
3
3
  isOpen = !isOpen;
4
4
  };
@@ -1,4 +1,4 @@
1
- <script >export let lists;
1
+ <script>export let lists;
2
2
  export let title = 'Latest Customers';
3
3
  export let action;
4
4
  export let divClass = 'p-4 max-w-md bg-white rounded-lg border shadow-md sm:p-8 dark:bg-gray-800 dark:border-gray-700';
@@ -1,4 +1,4 @@
1
- <script >import Alert from '../alerts/Alert.svelte';
1
+ <script>import Alert from '../alerts/Alert.svelte';
2
2
  export let login;
3
3
  export let title = 'Sign in';
4
4
  export let btnSignInColor = 'blue';
@@ -1,4 +1,4 @@
1
- <script >export let caption = '';
1
+ <script>export let caption = '';
2
2
  export let captionClass = '';
3
3
  </script>
4
4
 
@@ -1,4 +1,4 @@
1
- <script >import Slide from './Slide.svelte';
1
+ <script>import Slide from './Slide.svelte';
2
2
  import Thumbnail from './Thumbnail.svelte';
3
3
  import Caption from './Caption.svelte';
4
4
  import Indicator from './Indicator.svelte';
@@ -7,6 +7,8 @@ export let showCaptions = true;
7
7
  export let showThumbs = true;
8
8
  export let images;
9
9
  export let slideControls = true;
10
+ export let loop = false;
11
+ export let duration = 2000;
10
12
  // Carousel
11
13
  export let divClass = 'overflow-hidden relative h-56 rounded-lg sm:h-64 xl:h-80 2xl:h-96';
12
14
  export let indicatorDivClass = 'flex absolute bottom-5 left-1/2 z-30 space-x-3 -translate-x-1/2';
@@ -37,6 +39,11 @@ const prevSlide = () => {
37
39
  };
38
40
  const goToSlide = (number) => (imageShowingIndex = number);
39
41
  let thumbWidth = 100 / images.length;
42
+ if (loop) {
43
+ setInterval(() => {
44
+ nextSlide();
45
+ }, duration);
46
+ }
40
47
  </script>
41
48
 
42
49
  <div id="default-carousel" class="relative">
@@ -47,64 +54,21 @@ let thumbWidth = 100 / images.length;
47
54
  <!-- Slider indicators -->
48
55
  <div class={indicatorDivClass}>
49
56
  {#each images as { id, imgurl, name, attribution }}
50
- <Indicator
51
- {name}
52
- selected={imageShowingIndex === id}
53
- on:click={() => goToSlide(id)}
54
- {indicatorClass}
55
- />
57
+ <Indicator {name} selected={imageShowingIndex === id} on:click={() => goToSlide(id)} {indicatorClass} />
56
58
  {/each}
57
59
  </div>
58
60
  {/if}
59
61
  {#if slideControls}
60
62
  <!-- Slider controls -->
61
- <button
62
- on:click={prevSlide}
63
- type="button"
64
- class="flex absolute top-0 left-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none"
65
- data-carousel-prev
66
- >
67
- <span
68
- class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none"
69
- >
70
- <svg
71
- class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300"
72
- fill="none"
73
- stroke="currentColor"
74
- viewBox="0 0 24 24"
75
- xmlns="http://www.w3.org/2000/svg"
76
- ><path
77
- stroke-linecap="round"
78
- stroke-linejoin="round"
79
- stroke-width="2"
80
- d="M15 19l-7-7 7-7"
81
- /></svg
82
- >
63
+ <button on:click={prevSlide} type="button" class="flex absolute top-0 left-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none" data-carousel-prev>
64
+ <span class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none">
65
+ <svg class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" /></svg>
83
66
  <span class="hidden">Previous</span>
84
67
  </span>
85
68
  </button>
86
- <button
87
- on:click={nextSlide}
88
- type="button"
89
- class="flex absolute top-0 right-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none"
90
- data-carousel-next
91
- >
92
- <span
93
- class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none"
94
- >
95
- <svg
96
- class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300"
97
- fill="none"
98
- stroke="currentColor"
99
- viewBox="0 0 24 24"
100
- xmlns="http://www.w3.org/2000/svg"
101
- ><path
102
- stroke-linecap="round"
103
- stroke-linejoin="round"
104
- stroke-width="2"
105
- d="M9 5l7 7-7 7"
106
- /></svg
107
- >
69
+ <button on:click={nextSlide} type="button" class="flex absolute top-0 right-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none" data-carousel-next>
70
+ <span class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none">
71
+ <svg class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" /></svg>
108
72
  <span class="hidden">Next</span>
109
73
  </span>
110
74
  </button>
@@ -118,15 +82,7 @@ let thumbWidth = 100 / images.length;
118
82
  {#if showThumbs}
119
83
  <div class="flex flex-row justify-center bg-gray-100">
120
84
  {#each images as { id, imgurl, name, attribution }}
121
- <Thumbnail
122
- {thumbWidth}
123
- thumbImg={imgurl}
124
- altTag={name}
125
- titleLink={attribution}
126
- {id}
127
- selected={imageShowingIndex === id}
128
- on:click={() => goToSlide(id)}
129
- />
85
+ <Thumbnail {thumbWidth} thumbImg={imgurl} altTag={name} titleLink={attribution} {id} selected={imageShowingIndex === id} on:click={() => goToSlide(id)} />
130
86
  {/each}
131
87
  </div>
132
88
  {/if}
@@ -6,6 +6,8 @@ declare const __propDef: {
6
6
  showThumbs?: boolean;
7
7
  images: any[];
8
8
  slideControls?: boolean;
9
+ loop?: boolean;
10
+ duration?: number;
9
11
  divClass?: string;
10
12
  indicatorDivClass?: string;
11
13
  captionClass?: string;
@@ -1,4 +1,4 @@
1
- <script >import { fade, blur, fly, slide } from 'svelte/transition';
1
+ <script>import { fade, blur, fly, slide } from 'svelte/transition';
2
2
  import Slide from './Slide.svelte';
3
3
  import Thumbnail from './Thumbnail.svelte';
4
4
  import Caption from './Caption.svelte';
@@ -10,6 +10,8 @@ export let images;
10
10
  export let slideControls = true;
11
11
  export let transitionType;
12
12
  export let transitionParams = {};
13
+ export let loop = false;
14
+ export let duration = 2000;
13
15
  // have a custom transition function that returns the desired transition
14
16
  function multiple(node, params) {
15
17
  switch (transitionType) {
@@ -53,6 +55,11 @@ const prevSlide = () => {
53
55
  };
54
56
  const goToSlide = (number) => (imageShowingIndex = number);
55
57
  let thumbWidth = 100 / images.length;
58
+ if (loop) {
59
+ setInterval(() => {
60
+ nextSlide();
61
+ }, duration);
62
+ }
56
63
  </script>
57
64
 
58
65
  <div id="default-carousel" class="relative">
@@ -70,64 +77,21 @@ let thumbWidth = 100 / images.length;
70
77
  <!-- Slider indicators -->
71
78
  <div class={indicatorDivClass}>
72
79
  {#each images as { id, imgurl, name, attribution }}
73
- <Indicator
74
- {name}
75
- selected={imageShowingIndex === id}
76
- on:click={() => goToSlide(id)}
77
- {indicatorClass}
78
- />
80
+ <Indicator {name} selected={imageShowingIndex === id} on:click={() => goToSlide(id)} {indicatorClass} />
79
81
  {/each}
80
82
  </div>
81
83
  {/if}
82
84
  {#if slideControls}
83
85
  <!-- Slider controls -->
84
- <button
85
- on:click={prevSlide}
86
- type="button"
87
- class="flex absolute top-0 left-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none"
88
- data-carousel-prev
89
- >
90
- <span
91
- class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none"
92
- >
93
- <svg
94
- class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300"
95
- fill="none"
96
- stroke="currentColor"
97
- viewBox="0 0 24 24"
98
- xmlns="http://www.w3.org/2000/svg"
99
- ><path
100
- stroke-linecap="round"
101
- stroke-linejoin="round"
102
- stroke-width="2"
103
- d="M15 19l-7-7 7-7"
104
- /></svg
105
- >
86
+ <button on:click={prevSlide} type="button" class="flex absolute top-0 left-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none" data-carousel-prev>
87
+ <span class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none">
88
+ <svg class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" /></svg>
106
89
  <span class="hidden">Previous</span>
107
90
  </span>
108
91
  </button>
109
- <button
110
- on:click={nextSlide}
111
- type="button"
112
- class="flex absolute top-0 right-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none"
113
- data-carousel-next
114
- >
115
- <span
116
- class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none"
117
- >
118
- <svg
119
- class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300"
120
- fill="none"
121
- stroke="currentColor"
122
- viewBox="0 0 24 24"
123
- xmlns="http://www.w3.org/2000/svg"
124
- ><path
125
- stroke-linecap="round"
126
- stroke-linejoin="round"
127
- stroke-width="2"
128
- d="M9 5l7 7-7 7"
129
- /></svg
130
- >
92
+ <button on:click={nextSlide} type="button" class="flex absolute top-0 right-0 z-30 justify-center items-center px-4 h-full cursor-pointer group focus:outline-none" data-carousel-next>
93
+ <span class="inline-flex justify-center items-center w-8 h-8 rounded-full sm:w-10 sm:h-10 bg-white/30 dark:bg-gray-800/30 group-hover:bg-white/50 dark:group-hover:bg-gray-800/60 group-focus:ring-4 group-focus:ring-white dark:group-focus:ring-gray-800/70 group-focus:outline-none">
94
+ <svg class="w-5 h-5 text-white sm:w-6 sm:h-6 dark:text-gray-300" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5l7 7-7 7" /></svg>
131
95
  <span class="hidden">Next</span>
132
96
  </span>
133
97
  </button>
@@ -141,15 +105,7 @@ let thumbWidth = 100 / images.length;
141
105
  {#if showThumbs}
142
106
  <div class="flex flex-row justify-center bg-gray-100">
143
107
  {#each images as { id, imgurl, name, attribution }}
144
- <Thumbnail
145
- {thumbWidth}
146
- thumbImg={imgurl}
147
- altTag={name}
148
- titleLink={attribution}
149
- {id}
150
- selected={imageShowingIndex === id}
151
- on:click={() => goToSlide(id)}
152
- />
108
+ <Thumbnail {thumbWidth} thumbImg={imgurl} altTag={name} titleLink={attribution} {id} selected={imageShowingIndex === id} on:click={() => goToSlide(id)} />
153
109
  {/each}
154
110
  </div>
155
111
  {/if}
@@ -9,6 +9,8 @@ declare const __propDef: {
9
9
  slideControls?: boolean;
10
10
  transitionType: TransitionTypes;
11
11
  transitionParams?: TransitionParamTypes;
12
+ loop?: boolean;
13
+ duration?: number;
12
14
  divClass?: string;
13
15
  indicatorDivClass?: string;
14
16
  captionClass?: string;
@@ -1,4 +1,4 @@
1
- <script >export let name = '';
1
+ <script>export let name = '';
2
2
  export let selected = false;
3
3
  export let indicatorClass = '';
4
4
  </script>
@@ -1,4 +1,4 @@
1
- <script >export let image = '';
1
+ <script>export let image = '';
2
2
  export let altTag = '';
3
3
  export let attr = '';
4
4
  export let slideClass = '';
@@ -1,4 +1,4 @@
1
- <script >export let thumbImg = '';
1
+ <script>export let thumbImg = '';
2
2
  export let altTag = '';
3
3
  export let titleLink = '';
4
4
  export let id;
@@ -1,4 +1,4 @@
1
- <script >import { onMount } from 'svelte';
1
+ <script>import { onMount } from 'svelte';
2
2
  export let btnClass = '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-2.5 fixed left-0 top-8 z-50';
3
3
  let mode;
4
4
  const toggleTheme = () => {
@@ -1,4 +1,4 @@
1
- <script >import { dropdownIdStore } from './dropdownStores';
1
+ <script>import { dropdownIdStore } from './dropdownStores';
2
2
  import { get } from 'svelte/store';
3
3
  export let id = 'dropdown';
4
4
  export let label = 'Dropdown button';
@@ -1,4 +1,4 @@
1
- <script >let imgDropdownToggle = true;
1
+ <script>let imgDropdownToggle = true;
2
2
  const handleToggle = () => {
3
3
  console.log('toggle clicked.');
4
4
  imgDropdownToggle = !imgDropdownToggle;
@@ -1,4 +1,4 @@
1
- <script >export let site;
1
+ <script>export let site;
2
2
  export let links;
3
3
  export let footerClass = 'p-4 bg-white rounded-lg shadow md:px-6 md:py-8 dark:bg-gray-800';
4
4
  export let divClass = 'sm:flex sm:items-center sm:justify-between';
@@ -1,4 +1,4 @@
1
- <script >export let site;
1
+ <script>export let site;
2
2
  export let links;
3
3
  export let footerClass = 'p-4 bg-white rounded-lg shadow md:flex md:items-center md:justify-between md:p-6 dark:bg-gray-800';
4
4
  export let siteNameClass = 'text-sm text-gray-500 sm:text-center dark:text-gray-400';
@@ -1,4 +1,4 @@
1
- <script >export let site;
1
+ <script>export let site;
2
2
  export let links;
3
3
  export let socialMedia;
4
4
  export let footerClass = 'bg-white dark:bg-gray-800';
@@ -1,4 +1,4 @@
1
- <script >export let site;
1
+ <script>export let site;
2
2
  export let links;
3
3
  export let socialMedia;
4
4
  export let footerClass = 'p-4 bg-white sm:p-6 dark:bg-gray-800';
@@ -1,4 +1,4 @@
1
- <script >export let legend = 'Checkbox variants';
1
+ <script>export let legend = 'Checkbox variants';
2
2
  export let divClass = 'flex items-center mb-4';
3
3
  export let inputClass = 'w-4 h-4 text-blue-600 bg-gray-100 rounded border-gray-300 focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600';
4
4
  export let labelClass = 'ml-3 text-sm font-medium text-gray-900 dark:text-gray-300';
@@ -1,4 +1,4 @@
1
- <script >export let value = '';
1
+ <script>export let value = '';
2
2
  export let id = 'user_avatar';
3
3
  export let label = 'Upload file';
4
4
  export let labelClass = 'block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300" for="user_avatar';
@@ -1,4 +1,4 @@
1
- <script >import generateId from '../utils/generateId.js';
1
+ <script>import generateId from '../utils/generateId.js';
2
2
  export let id = generateId();
3
3
  export let type;
4
4
  export let value = '';