flowbite-svelte 0.22.25 → 0.22.28

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 (73) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/avatar/Avatar.svelte +9 -8
  3. package/avatar/Placeholder.svelte +1 -1
  4. package/breadcrumbs/Breadcrumb.svelte +1 -1
  5. package/buttongroups/ButtonGroupItem.svelte +2 -2
  6. package/buttons/Button.svelte +1 -1
  7. package/cards/EcommerceCard.svelte +1 -1
  8. package/carousels/CarouselTransition.svelte +13 -13
  9. package/drawers/Drawer.svelte +44 -0
  10. package/drawers/Drawer.svelte.d.ts +26 -0
  11. package/forms/FloatingLabelInput.svelte +1 -1
  12. package/forms/Input.svelte +1 -1
  13. package/forms/Select.svelte +1 -1
  14. package/forms/SimpleSearch.svelte +2 -2
  15. package/forms/Toggle.svelte +10 -1
  16. package/index.d.ts +3 -14
  17. package/index.js +4 -14
  18. package/modals/Modal.svelte.d.ts +1 -1
  19. package/navbar/NavDropdown.svelte +3 -3
  20. package/navbar/NavUl.svelte +0 -1
  21. package/package.json +4 -20
  22. package/paginations/Next.svelte +12 -2
  23. package/paginations/Pagination.svelte +29 -9
  24. package/paginations/Previous.svelte +12 -2
  25. package/paginations/TableData.svelte +3 -3
  26. package/progressbars/Progressbar.svelte +17 -28
  27. package/ratings/Rating.svelte +2 -2
  28. package/skeleton/CardPlaceholder.svelte +6 -1
  29. package/skeleton/CardPlaceholder.svelte.d.ts +8 -11
  30. package/skeleton/ImagePlaceholder.svelte +6 -1
  31. package/skeleton/ImagePlaceholder.svelte.d.ts +8 -11
  32. package/skeleton/VideoPlaceholder.svelte +6 -1
  33. package/skeleton/VideoPlaceholder.svelte.d.ts +8 -11
  34. package/spinners/Spinner.svelte +1 -1
  35. package/tables/TableHeadCell.svelte +1 -1
  36. package/tabs/InteractiveTabHead.svelte +17 -2
  37. package/tabs/InteractiveTabs.svelte +16 -3
  38. package/tabs/UnderlineTabs.svelte +8 -1
  39. package/tooltips/Tooltip.svelte +23 -26
  40. package/types.d.ts +10 -0
  41. package/cards/CtaCard.svelte +0 -49
  42. package/cards/CtaCard.svelte.d.ts +0 -22
  43. package/cards/HorizontalCard.svelte +0 -23
  44. package/cards/HorizontalCard.svelte.d.ts +0 -27
  45. package/cards/InteractiveCard.svelte +0 -73
  46. package/cards/InteractiveCard.svelte.d.ts +0 -25
  47. package/cards/ListCard.svelte +0 -40
  48. package/cards/ListCard.svelte.d.ts +0 -20
  49. package/footer/LogoFooter.svelte +0 -34
  50. package/footer/LogoFooter.svelte.d.ts +0 -29
  51. package/footer/SimpleFooter.svelte +0 -22
  52. package/footer/SimpleFooter.svelte.d.ts +0 -24
  53. package/footer/SitemapFooter.svelte +0 -45
  54. package/footer/SitemapFooter.svelte.d.ts +0 -31
  55. package/footer/SocialMediaFooter.svelte +0 -63
  56. package/footer/SocialMediaFooter.svelte.d.ts +0 -39
  57. package/forms/SingleCheckbox.svelte +0 -18
  58. package/forms/SingleCheckbox.svelte.d.ts +0 -22
  59. package/modals/ExtraLargeModal.svelte +0 -182
  60. package/modals/ExtraLargeModal.svelte.d.ts +0 -29
  61. package/modals/LargeModal.svelte +0 -182
  62. package/modals/LargeModal.svelte.d.ts +0 -29
  63. package/modals/MediumModal.svelte +0 -185
  64. package/modals/MediumModal.svelte.d.ts +0 -29
  65. package/modals/ModalButton.svelte +0 -52
  66. package/modals/ModalButton.svelte.d.ts +0 -21
  67. package/modals/SignInModal.svelte +0 -102
  68. package/modals/SignInModal.svelte.d.ts +0 -26
  69. package/modals/SmallModal.svelte +0 -184
  70. package/modals/SmallModal.svelte.d.ts +0 -29
  71. package/modals/modalStores.js +0 -3
  72. package/navbar/DropdownNavbar.svelte +0 -95
  73. package/navbar/DropdownNavbar.svelte.d.ts +0 -31
@@ -1,12 +1,5 @@
1
1
  <script>import { createEventDispatcher } from 'svelte';
2
2
  export let icon = false;
3
- const dispatch = createEventDispatcher();
4
- const previous = () => {
5
- dispatch('previous');
6
- };
7
- const next = () => {
8
- dispatch('next');
9
- };
10
3
  export let pages;
11
4
  export let ulClass = 'inline-flex -space-x-px items-center';
12
5
  export let pageClass = 'py-2 px-3 leading-tight text-gray-500 bg-white border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
@@ -14,6 +7,13 @@ export let previousClass = 'py-2 px-3 ml-0 leading-tight text-gray-500 bg-white
14
7
  export let nextClass = 'py-2 px-3 leading-tight text-gray-500 bg-white rounded-r-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
15
8
  export let iconPreviousClass = 'block py-2 px-3 ml-0 leading-tight text-gray-500 bg-white rounded-l-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
16
9
  export let iconNextClass = 'block py-2 px-3 leading-tight text-gray-500 bg-white rounded-r-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
10
+ const dispatch = createEventDispatcher();
11
+ const previous = () => {
12
+ dispatch('previous');
13
+ };
14
+ const next = () => {
15
+ dispatch('next');
16
+ };
17
17
  </script>
18
18
 
19
19
  <nav aria-label="Page navigation">
@@ -22,7 +22,17 @@ export let iconNextClass = 'block py-2 px-3 leading-tight text-gray-500 bg-white
22
22
  {#if icon}
23
23
  <a href="/" on:click|preventDefault={previous} class={iconPreviousClass}>
24
24
  <span class="sr-only">Previous</span>
25
- <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z" clip-rule="evenodd" /></svg>
25
+ <svg
26
+ class="w-5 h-5"
27
+ fill="currentColor"
28
+ viewBox="0 0 20 20"
29
+ xmlns="http://www.w3.org/2000/svg"
30
+ ><path
31
+ fill-rule="evenodd"
32
+ d="M12.707 5.293a1 1 0 010 1.414L9.414 10l3.293 3.293a1 1 0 01-1.414 1.414l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 0z"
33
+ clip-rule="evenodd"
34
+ /></svg
35
+ >
26
36
  </a>
27
37
  {:else}
28
38
  <a href="/" on:click|preventDefault={previous} class={previousClass}>Previous</a>
@@ -37,7 +47,17 @@ export let iconNextClass = 'block py-2 px-3 leading-tight text-gray-500 bg-white
37
47
  {#if icon}
38
48
  <a href="/" on:click|preventDefault={next} class={iconNextClass}>
39
49
  <span class="sr-only">Next</span>
40
- <svg class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z" clip-rule="evenodd" /></svg>
50
+ <svg
51
+ class="w-5 h-5"
52
+ fill="currentColor"
53
+ viewBox="0 0 20 20"
54
+ xmlns="http://www.w3.org/2000/svg"
55
+ ><path
56
+ fill-rule="evenodd"
57
+ d="M7.293 14.707a1 1 0 010-1.414L10.586 10 7.293 6.707a1 1 0 011.414-1.414l4 4a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0z"
58
+ clip-rule="evenodd"
59
+ /></svg
60
+ >
41
61
  </a>
42
62
  {:else}
43
63
  <a href="/" on:click|preventDefault={next} class={nextClass}>Next</a>
@@ -1,10 +1,10 @@
1
1
  <script>import { createEventDispatcher } from 'svelte';
2
2
  export let icon = false;
3
+ export let previousClass = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-500 bg-white rounded-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
3
4
  const dispatch = createEventDispatcher();
4
5
  const previous = () => {
5
6
  dispatch('previous');
6
7
  };
7
- export let previousClass = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-500 bg-white rounded-lg border border-gray-300 hover:bg-gray-100 hover:text-gray-700 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
8
8
  if (icon) {
9
9
  previousClass += ' mr-3';
10
10
  }
@@ -12,7 +12,17 @@ if (icon) {
12
12
 
13
13
  <a href="/" on:click|preventDefault={previous} class={previousClass}>
14
14
  {#if icon}
15
- <svg class="mr-2 w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M7.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l2.293 2.293a1 1 0 010 1.414z" clip-rule="evenodd" /></svg>
15
+ <svg
16
+ class="mr-2 w-5 h-5"
17
+ fill="currentColor"
18
+ viewBox="0 0 20 20"
19
+ xmlns="http://www.w3.org/2000/svg"
20
+ ><path
21
+ fill-rule="evenodd"
22
+ d="M7.707 14.707a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414l4-4a1 1 0 011.414 1.414L5.414 9H17a1 1 0 110 2H5.414l2.293 2.293a1 1 0 010 1.414z"
23
+ clip-rule="evenodd"
24
+ /></svg
25
+ >
16
26
  {/if}
17
27
  Previous
18
28
  </a>
@@ -1,4 +1,7 @@
1
1
  <script>import { createEventDispatcher } from 'svelte';
2
+ export let helper;
3
+ export let btnPreClass = 'py-2 px-4 text-sm font-medium text-white bg-gray-800 rounded-l hover:bg-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
4
+ export let btnNextClass = 'py-2 px-4 text-sm font-medium text-white bg-gray-800 rounded-r border-0 border-l border-gray-700 hover:bg-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
2
5
  const dispatch = createEventDispatcher();
3
6
  const previous = () => {
4
7
  dispatch('previous');
@@ -6,9 +9,6 @@ const previous = () => {
6
9
  const next = () => {
7
10
  dispatch('next');
8
11
  };
9
- export let helper;
10
- export let btnPreClass = 'py-2 px-4 text-sm font-medium text-white bg-gray-800 rounded-l hover:bg-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
11
- export let btnNextClass = 'py-2 px-4 text-sm font-medium text-white bg-gray-800 rounded-r border-0 border-l border-gray-700 hover:bg-gray-900 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white';
12
12
  </script>
13
13
 
14
14
  <div class="flex flex-col items-center">
@@ -1,33 +1,19 @@
1
- <script>export let progress = '45';
1
+ <script>import classNames from 'classnames';
2
+ export let progress = '45';
2
3
  export let size = 'h-2.5';
3
4
  export let labelInside = false;
4
5
  export let labelOutside = '';
5
6
  export let color = 'blue';
6
- let barColor;
7
- if (color === 'blue') {
8
- barColor = 'bg-blue-600';
9
- }
10
- else if (color === 'gray') {
11
- barColor = 'bg-gray-600 dark:bg-gray-300';
12
- }
13
- else if (color === 'red') {
14
- barColor = 'bg-red-600 dark:bg-red-500';
15
- }
16
- else if (color === 'green') {
17
- barColor = 'bg-green-600 dark:bg-green-500';
18
- }
19
- else if (color === 'yellow') {
20
- barColor = 'bg-yellow-400 ';
21
- }
22
- else if (color === 'purple') {
23
- barColor = 'bg-purple-600 dark:bg-purple-500';
24
- }
25
- else if (color === 'indigo') {
26
- barColor = 'bg-indigo-600 dark:bg-indigo-500';
27
- }
28
- else {
29
- barColor = 'bg-blue-600 dark:bg-blue-500';
30
- }
7
+ // let barColor: string;
8
+ const barColors = {
9
+ blue: 'bg-blue-600',
10
+ gray: 'bg-gray-600 dark:bg-gray-300',
11
+ red: 'bg-red-600 dark:bg-red-500',
12
+ green: 'bg-green-600 dark:bg-green-500',
13
+ yellow: 'bg-yellow-400',
14
+ purple: 'bg-purple-600 dark:bg-purple-500',
15
+ indigo: 'bg-indigo-600 dark:bg-indigo-500'
16
+ };
31
17
  </script>
32
18
 
33
19
  {#if labelOutside}
@@ -38,10 +24,13 @@ else {
38
24
  {/if}
39
25
  <div class="w-full bg-gray-200 rounded-full {size} dark:bg-gray-700">
40
26
  {#if labelInside}
41
- <div class="bg-blue-600 text-xs font-medium text-blue-100 text-center p-0.5 leading-none rounded-full" style="width: {progress}%">
27
+ <div
28
+ class="bg-blue-600 text-xs font-medium text-blue-100 text-center p-0.5 leading-none rounded-full"
29
+ style="width: {progress}%"
30
+ >
42
31
  {progress}%
43
32
  </div>
44
33
  {:else}
45
- <div class="{barColor} {size} rounded-full" style="width: {progress}%" />
34
+ <div class={classNames(barColors[color], size, 'rounded-full')} style="width: {progress}%" />
46
35
  {/if}
47
36
  </div>
@@ -11,12 +11,12 @@ let grayStars = total - roundedRating;
11
11
  <div class={divClass}>
12
12
  {#each Array(roundedRating) as _, star}
13
13
  <slot name="ratingUp">
14
- <Star variation="solid" class="text-yellow-300 dark:text-yellow-200" />
14
+ <Star variation="solid" size="24" class="text-yellow-300 dark:text-yellow-200" />
15
15
  </slot>
16
16
  {/each}
17
17
  {#each Array(grayStars) as _, star}
18
18
  <slot name="ratingDown">
19
- <Star class="text-gray-300 dark:text-gray-500" />
19
+ <Star size="26" class="px-0.5 text-gray-300 dark:text-gray-500" />
20
20
  </slot>
21
21
  {/each}
22
22
  {#if $$slots.text}
@@ -1,10 +1,15 @@
1
+ <script>export let size = '48';
2
+ </script>
3
+
1
4
  <div
2
5
  role="status"
3
6
  class="p-4 max-w-sm rounded border border-gray-200 shadow animate-pulse md:p-6 dark:border-gray-700"
4
7
  >
5
8
  <div class="flex justify-center items-center mb-4 h-48 bg-gray-300 rounded dark:bg-gray-700">
6
9
  <svg
7
- class="w-12 h-12 text-gray-200 dark:text-gray-600"
10
+ width={size}
11
+ height={size}
12
+ class="text-gray-200 dark:text-gray-600"
8
13
  xmlns="http://www.w3.org/2000/svg"
9
14
  aria-hidden="true"
10
15
  fill="currentColor"
@@ -1,19 +1,16 @@
1
- /** @typedef {typeof __propDef.props} CardPlaceholderProps */
2
- /** @typedef {typeof __propDef.events} CardPlaceholderEvents */
3
- /** @typedef {typeof __propDef.slots} CardPlaceholderSlots */
4
- export default class CardPlaceholder extends SvelteComponentTyped<{}, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> {
7
- }
8
- export type CardPlaceholderProps = typeof __propDef.props;
9
- export type CardPlaceholderEvents = typeof __propDef.events;
10
- export type CardPlaceholderSlots = typeof __propDef.slots;
11
1
  import { SvelteComponentTyped } from "svelte";
12
2
  declare const __propDef: {
13
- props: {};
3
+ props: {
4
+ size?: string;
5
+ };
14
6
  events: {
15
7
  [evt: string]: CustomEvent<any>;
16
8
  };
17
9
  slots: {};
18
10
  };
11
+ export declare type CardPlaceholderProps = typeof __propDef.props;
12
+ export declare type CardPlaceholderEvents = typeof __propDef.events;
13
+ export declare type CardPlaceholderSlots = typeof __propDef.slots;
14
+ export default class CardPlaceholder extends SvelteComponentTyped<CardPlaceholderProps, CardPlaceholderEvents, CardPlaceholderSlots> {
15
+ }
19
16
  export {};
@@ -1,3 +1,6 @@
1
+ <script>export let size = '48';
2
+ </script>
3
+
1
4
  <div
2
5
  role="status"
3
6
  class="space-y-8 animate-pulse md:space-y-0 md:space-x-8 md:flex md:items-center"
@@ -6,7 +9,9 @@
6
9
  class="flex justify-center items-center w-full h-48 bg-gray-300 rounded sm:w-96 dark:bg-gray-700"
7
10
  >
8
11
  <svg
9
- class="w-12 h-12 text-gray-200"
12
+ width={size}
13
+ height={size}
14
+ class="text-gray-200"
10
15
  xmlns="http://www.w3.org/2000/svg"
11
16
  aria-hidden="true"
12
17
  fill="currentColor"
@@ -1,19 +1,16 @@
1
- /** @typedef {typeof __propDef.props} ImagePlaceholderProps */
2
- /** @typedef {typeof __propDef.events} ImagePlaceholderEvents */
3
- /** @typedef {typeof __propDef.slots} ImagePlaceholderSlots */
4
- export default class ImagePlaceholder extends SvelteComponentTyped<{}, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> {
7
- }
8
- export type ImagePlaceholderProps = typeof __propDef.props;
9
- export type ImagePlaceholderEvents = typeof __propDef.events;
10
- export type ImagePlaceholderSlots = typeof __propDef.slots;
11
1
  import { SvelteComponentTyped } from "svelte";
12
2
  declare const __propDef: {
13
- props: {};
3
+ props: {
4
+ size?: string;
5
+ };
14
6
  events: {
15
7
  [evt: string]: CustomEvent<any>;
16
8
  };
17
9
  slots: {};
18
10
  };
11
+ export declare type ImagePlaceholderProps = typeof __propDef.props;
12
+ export declare type ImagePlaceholderEvents = typeof __propDef.events;
13
+ export declare type ImagePlaceholderSlots = typeof __propDef.slots;
14
+ export default class ImagePlaceholder extends SvelteComponentTyped<ImagePlaceholderProps, ImagePlaceholderEvents, ImagePlaceholderSlots> {
15
+ }
19
16
  export {};
@@ -1,9 +1,14 @@
1
+ <script>export let size = '48';
2
+ </script>
3
+
1
4
  <div
2
5
  role="status"
3
6
  class="flex justify-center items-center max-w-sm h-56 bg-gray-300 rounded-lg animate-pulse dark:bg-gray-700"
4
7
  >
5
8
  <svg
6
- class="w-12 h-12 text-gray-200 dark:text-gray-600"
9
+ width={size}
10
+ height={size}
11
+ class="text-gray-200 dark:text-gray-600"
7
12
  xmlns="http://www.w3.org/2000/svg"
8
13
  aria-hidden="true"
9
14
  fill="currentColor"
@@ -1,19 +1,16 @@
1
- /** @typedef {typeof __propDef.props} VideoPlaceholderProps */
2
- /** @typedef {typeof __propDef.events} VideoPlaceholderEvents */
3
- /** @typedef {typeof __propDef.slots} VideoPlaceholderSlots */
4
- export default class VideoPlaceholder extends SvelteComponentTyped<{}, {
5
- [evt: string]: CustomEvent<any>;
6
- }, {}> {
7
- }
8
- export type VideoPlaceholderProps = typeof __propDef.props;
9
- export type VideoPlaceholderEvents = typeof __propDef.events;
10
- export type VideoPlaceholderSlots = typeof __propDef.slots;
11
1
  import { SvelteComponentTyped } from "svelte";
12
2
  declare const __propDef: {
13
- props: {};
3
+ props: {
4
+ size?: string;
5
+ };
14
6
  events: {
15
7
  [evt: string]: CustomEvent<any>;
16
8
  };
17
9
  slots: {};
18
10
  };
11
+ export declare type VideoPlaceholderProps = typeof __propDef.props;
12
+ export declare type VideoPlaceholderEvents = typeof __propDef.events;
13
+ export declare type VideoPlaceholderSlots = typeof __propDef.slots;
14
+ export default class VideoPlaceholder extends SvelteComponentTyped<VideoPlaceholderProps, VideoPlaceholderEvents, VideoPlaceholderSlots> {
15
+ }
19
16
  export {};
@@ -2,10 +2,10 @@
2
2
  export let color = 'blue';
3
3
  export let bg = 'text-gray-300';
4
4
  export let size = '8';
5
- let iconsize = `w-${size} h-${size}`;
6
5
  // these two props add fine control over the spinner colors
7
6
  export let currentFill = 'currentFill';
8
7
  export let currentColor = 'currentColor';
8
+ let iconsize = `w-${size} h-${size}`;
9
9
  if (currentFill !== 'currentFill') {
10
10
  color = undefined;
11
11
  }
@@ -1,6 +1,6 @@
1
1
  <script>import classNames from 'classnames';
2
2
  </script>
3
3
 
4
- <th {...$$props} class={classNames('px-6 py-3', $$props.class)}>
4
+ <th {...$$restProps} class={classNames('px-6 py-3', $$props.class)}>
5
5
  <slot />
6
6
  </th>
@@ -26,10 +26,25 @@ Header part of Interactive tab component. Use with TabContent.
26
26
  ```
27
27
  -->
28
28
  <div class="mb-4 border-b border-gray-200">
29
- <ul class="flex flex-wrap -mb-px text-sm font-medium text-center" id={tabId} data-tabs-toggle="#myTabContent" role="tablist">
29
+ <ul
30
+ class="flex flex-wrap -mb-px text-sm font-medium text-center"
31
+ id={tabId}
32
+ data-tabs-toggle="#myTabContent"
33
+ role="tablist"
34
+ >
30
35
  {#each tabs as { name, id }}
31
36
  <li class="mr-2" role="presentation">
32
- <button on:click={handleClick(id)} class="inline-block py-4 px-4 text-sm font-medium text-center text-gray-500 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300" id="{name}-tab" data-tabs-target="#{name}" type="button" role="tab" class:active={activeTabValue === id} aria-controls={name} aria-selected="false">{name}</button>
37
+ <button
38
+ on:click={handleClick(id)}
39
+ class="inline-block py-4 px-4 text-sm font-medium text-center text-gray-500 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"
40
+ id="{name}-tab"
41
+ data-tabs-target="#{name}"
42
+ type="button"
43
+ role="tab"
44
+ class:active={activeTabValue === id}
45
+ aria-controls={name}
46
+ aria-selected="false">{name}</button
47
+ >
33
48
  </li>
34
49
  {/each}
35
50
  </ul>
@@ -1,14 +1,22 @@
1
1
  <script>export let tabId = 'myTab';
2
2
  export let activeTabValue = 1;
3
- const handleClick = (tabValue) => () => (activeTabValue = tabValue);
4
3
  export let tabs;
4
+ const handleClick = (tabValue) => () => (activeTabValue = tabValue);
5
5
  </script>
6
6
 
7
7
  <div class="mb-4 border-b border-gray-200 dark:border-gray-700">
8
8
  <ul class="flex flex-wrap -mb-px" id={tabId} role="tablist">
9
9
  {#each tabs as { name, id }}
10
10
  <li class="mr-2" role="presentation">
11
- <button on:click={handleClick(id)} class="inline-block py-4 px-4 text-sm font-medium text-center text-gray-500 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300" id="{name}-tab" type="button" role="tab" class:active={activeTabValue === id} aria-controls={name}>{name}</button>
11
+ <button
12
+ on:click={handleClick(id)}
13
+ class="inline-block py-4 px-4 text-sm font-medium text-center text-gray-500 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:text-gray-400 dark:hover:text-gray-300"
14
+ id="{name}-tab"
15
+ type="button"
16
+ role="tab"
17
+ class:active={activeTabValue === id}
18
+ aria-controls={name}>{name}</button
19
+ >
12
20
  </li>
13
21
  {/each}
14
22
  </ul>
@@ -16,7 +24,12 @@ export let tabs;
16
24
  <div id="{tabId}Content">
17
25
  {#each tabs as { name, content, id }}
18
26
  {#if activeTabValue === id}
19
- <div class="p-4 bg-gray-50 rounded-lg dark:bg-gray-800" id={name} role="tabpanel" aria-labelledby="{name}-tab">
27
+ <div
28
+ class="p-4 bg-gray-50 rounded-lg dark:bg-gray-800"
29
+ id={name}
30
+ role="tabpanel"
31
+ aria-labelledby="{name}-tab"
32
+ >
20
33
  {#if typeof content === 'string'}
21
34
  <p class="text-sm text-gray-500 dark:text-gray-400">
22
35
  {@html content}
@@ -6,7 +6,14 @@ export let tabs;
6
6
  <ul class="flex flex-wrap -mb-px">
7
7
  {#each tabs as { name, active, href, rel }}
8
8
  <li class="mr-2">
9
- <a {href} {rel} class={active ? 'inline-block p-4 text-blue-600 rounded-t-lg border-b-2 border-blue-600 active dark:text-blue-500 dark:border-blue-500' : ' inline-block p-4 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:hover:text-gray-300 '}>{name}</a>
9
+ <a
10
+ {href}
11
+ {rel}
12
+ class={active
13
+ ? 'inline-block p-4 text-blue-600 rounded-t-lg border-b-2 border-blue-600 active dark:text-blue-500 dark:border-blue-500'
14
+ : ' inline-block p-4 rounded-t-lg border-b-2 border-transparent hover:text-gray-600 hover:border-gray-300 dark:hover:text-gray-300 '}
15
+ >{name}</a
16
+ >
10
17
  </li>
11
18
  {/each}
12
19
  </ul>
@@ -1,7 +1,7 @@
1
- <script>import classNames from 'classnames';
1
+ <script>import { onMount } from 'svelte';
2
+ import classNames from 'classnames';
2
3
  import { clickOutside } from '../utils/clickOutside';
3
4
  import { computePosition, flip, shift, offset, autoPlacement, arrow as arrowFloat } from '@floating-ui/dom';
4
- import { onDestroy } from 'svelte';
5
5
  export let placement = 'top';
6
6
  export let trigger = 'hover';
7
7
  export let style = 'dark';
@@ -23,25 +23,26 @@ const floatingArrowPlacement = ({ placement }) => {
23
23
  left: 'right'
24
24
  }[placement.split('-')[0]];
25
25
  };
26
- const floatingMiddleware = ({ arrowRef, placement }) => {
27
- const middleware = [];
28
- middleware.push(offset(8));
29
- middleware.push(placement === 'auto' ? autoPlacement() : flip());
30
- middleware.push(shift({ padding: 8 }));
31
- if (arrowRef) {
32
- middleware.push(arrowFloat({ element: arrowRef }));
33
- }
34
- return middleware;
35
- };
36
26
  let placementData;
37
27
  let tooltipRef, triggerRef, arrowRef;
38
- const updatePosition = () => computePosition(triggerRef, tooltipRef, {
39
- middleware: floatingMiddleware({ arrowRef, placement }),
40
- placement: floatingPlacement({ placement })
41
- }).then((data) => (placementData = data));
42
28
  let attachedScroll = false;
43
- $: tooltipRef && open && updatePosition();
44
- $: {
29
+ onMount(async () => {
30
+ // dynamic import, to access 'window', since ace use it directly,
31
+ const floatingMiddleware = ({ arrowRef, placement }) => {
32
+ const middleware = [];
33
+ middleware.push(offset(8));
34
+ middleware.push(placement === 'auto' ? autoPlacement() : flip());
35
+ middleware.push(shift({ padding: 8 }));
36
+ if (arrowRef) {
37
+ middleware.push(arrowFloat({ element: arrowRef }));
38
+ }
39
+ return middleware;
40
+ };
41
+ const updatePosition = () => computePosition(triggerRef, tooltipRef, {
42
+ middleware: floatingMiddleware({ arrowRef, placement }),
43
+ placement: floatingPlacement({ placement })
44
+ }).then((data) => (placementData = data));
45
+ tooltipRef && open && updatePosition();
45
46
  if (open && !attachedScroll) {
46
47
  attachedScroll = true;
47
48
  window.addEventListener('scroll', updatePosition, true);
@@ -50,17 +51,13 @@ $: {
50
51
  attachedScroll = false;
51
52
  window.removeEventListener('scroll', updatePosition, true);
52
53
  }
53
- }
54
- onDestroy(() => {
55
- if (attachedScroll) {
56
- attachedScroll = false;
57
- window.removeEventListener('scroll', updatePosition, true);
58
- }
54
+ // console.log('updatePosition', updatePosition());
55
+ // console.log('floatingMiddleware', floatingMiddleware({ arrowRef, placement }));
59
56
  });
57
+ // console.log('placement', placement);
58
+ // console.log('floatingPlacement', floatingPlacement({ placement }));
60
59
  </script>
61
60
 
62
- <svelte:window on:resize={() => open && updatePosition()} />
63
-
64
61
  <div
65
62
  use:clickOutside={() => {
66
63
  if (open) {
package/types.d.ts CHANGED
@@ -66,6 +66,16 @@ export interface DotType {
66
66
  top?: boolean;
67
67
  color?: string;
68
68
  }
69
+ export interface drawerTransitionParamTypes {
70
+ amount?: number;
71
+ delay?: number;
72
+ duration?: number;
73
+ easing?: (t: number) => number;
74
+ opacity?: number;
75
+ x?: number;
76
+ y?: number;
77
+ }
78
+ export declare type drawerTransitionTypes = 'fade' | 'fly' | 'slide' | 'blur' | 'in:fly' | 'out:fly' | 'in:slide' | 'out:slide' | 'in:fade' | 'out:fade' | 'in:blur' | 'out:blur' | undefined;
69
79
  export declare type DropdownColorType = 'blue' | 'blue-outline' | 'dark' | 'dark-outline' | 'light' | 'green' | 'green-outline' | 'red' | 'red-outline' | 'yellow' | 'yellow-outline' | 'purple' | 'purple-outline';
70
80
  export interface DropdownType {
71
81
  name: string;
@@ -1,49 +0,0 @@
1
- <script>import Button from '../buttons/Button.svelte';
2
- export let title = 'Work fast from anywhere';
3
- export let headColor = 'gray';
4
- export let btns;
5
- export let divClass = 'p-4 w-full text-center bg-white rounded-lg border shadow-md sm:p-8 dark:bg-gray-800 dark:border-gray-700';
6
- let headClass = 'mb-2 text-3xl font-bold dark:text-white ';
7
- if (headColor === 'blue') {
8
- headClass += 'text-blue-900';
9
- }
10
- else if (headColor === 'gray') {
11
- headClass += 'text-gray-900';
12
- }
13
- else if (headColor === 'red') {
14
- headClass += 'text-red-900';
15
- }
16
- else if (headColor === 'yellow') {
17
- headClass += 'text-yellow-900';
18
- }
19
- else if (headColor === 'green') {
20
- headClass += 'text-green-900';
21
- }
22
- else if (headColor === 'indigo') {
23
- headClass += 'text-indigo-900';
24
- }
25
- else if (headColor === 'purple') {
26
- headClass += 'text-purple-900';
27
- }
28
- else if (headColor === 'pink') {
29
- headClass += 'text-pink-900';
30
- }
31
- </script>
32
-
33
- <div class={divClass}>
34
- <h3 class={headClass}>
35
- {title}
36
- </h3>
37
- <p class="mb-5 text-base text-gray-500 sm:text-lg dark:text-gray-400">
38
- <slot />
39
- </p>
40
- <div class="justify-center items-center space-y-4 sm:flex sm:space-y-0 sm:space-x-4">
41
- {#if btns}
42
- {#each btns as { name, textSize, type, href, rel, rounded }}
43
- <a {href} {rel}>
44
- <Button {rounded} {type} {textSize}>{name}</Button>
45
- </a>
46
- {/each}
47
- {/if}
48
- </div>
49
- </div>
@@ -1,22 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { CardButtonType, Colors } from '../types';
3
- declare const __propDef: {
4
- props: {
5
- title?: string;
6
- headColor?: Colors;
7
- btns: CardButtonType[];
8
- divClass?: string;
9
- };
10
- events: {
11
- [evt: string]: CustomEvent<any>;
12
- };
13
- slots: {
14
- default: {};
15
- };
16
- };
17
- export declare type CtaCardProps = typeof __propDef.props;
18
- export declare type CtaCardEvents = typeof __propDef.events;
19
- export declare type CtaCardSlots = typeof __propDef.slots;
20
- export default class CtaCard extends SvelteComponentTyped<CtaCardProps, CtaCardEvents, CtaCardSlots> {
21
- }
22
- export {};
@@ -1,23 +0,0 @@
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.';
6
- export let linkClass = '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';
7
- export let imgClass = 'object-cover w-full h-96 rounded-t-lg md:h-auto md:w-48 md:rounded-none md:rounded-l-lg';
8
- export let textClass = 'flex flex-col justify-between p-4 leading-normal';
9
- export let h3Class = 'mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white';
10
- export let pClass = 'mb-3 font-normal text-gray-700 dark:text-gray-400';
11
- </script>
12
-
13
- <a href={link} {rel} class={linkClass}>
14
- <img class={imgClass} src={img} {alt} />
15
- <div class={textClass}>
16
- <h3 class={h3Class}>
17
- {header}
18
- </h3>
19
- <p class={pClass}>
20
- <slot />
21
- </p>
22
- </div>
23
- </a>
@@ -1,27 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- declare const __propDef: {
3
- props: {
4
- link?: string;
5
- rel?: string;
6
- img?: string;
7
- alt?: string;
8
- header?: string;
9
- linkClass?: string;
10
- imgClass?: string;
11
- textClass?: string;
12
- h3Class?: string;
13
- pClass?: string;
14
- };
15
- events: {
16
- [evt: string]: CustomEvent<any>;
17
- };
18
- slots: {
19
- default: {};
20
- };
21
- };
22
- export declare type HorizontalCardProps = typeof __propDef.props;
23
- export declare type HorizontalCardEvents = typeof __propDef.events;
24
- export declare type HorizontalCardSlots = typeof __propDef.slots;
25
- export default class HorizontalCard extends SvelteComponentTyped<HorizontalCardProps, HorizontalCardEvents, HorizontalCardSlots> {
26
- }
27
- export {};