flowbite-svelte 1.2.6 → 1.3.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.
Files changed (153) hide show
  1. package/dist/buttons/Button.svelte +6 -4
  2. package/dist/buttons/Button.svelte.d.ts +2 -2
  3. package/dist/forms/dropzone/Dropzone.svelte +13 -10
  4. package/dist/forms/dropzone/Dropzone.svelte.d.ts +11 -10
  5. package/dist/forms/select/Select.svelte +2 -2
  6. package/dist/index.d.ts +1 -1
  7. package/dist/index.js +1 -1
  8. package/dist/pagination/Pagination.svelte +1 -1
  9. package/dist/pagination/Pagination.svelte.d.ts +1 -1
  10. package/dist/pagination/PaginationButton.svelte +60 -0
  11. package/dist/pagination/PaginationButton.svelte.d.ts +18 -0
  12. package/dist/pagination/PaginationItem.svelte +1 -1
  13. package/dist/pagination/PaginationItem.svelte.d.ts +1 -1
  14. package/dist/pagination/PaginationNav.svelte +99 -0
  15. package/dist/pagination/PaginationNav.svelte.d.ts +26 -0
  16. package/dist/pagination/index.d.ts +5 -4
  17. package/dist/pagination/index.js +5 -4
  18. package/dist/pagination/theme.d.ts +141 -1
  19. package/dist/pagination/theme.js +62 -0
  20. package/dist/popover/Popover.svelte +1 -1
  21. package/dist/popover/Popover.svelte.d.ts +1 -1
  22. package/dist/progress/Progressbar.svelte +1 -1
  23. package/dist/progress/Progressbar.svelte.d.ts +1 -1
  24. package/dist/progress/Progressradial.svelte +1 -1
  25. package/dist/progress/Progressradial.svelte.d.ts +1 -1
  26. package/dist/rating/AdvancedRating.svelte +1 -1
  27. package/dist/rating/AdvancedRating.svelte.d.ts +1 -1
  28. package/dist/rating/CustomIcon.svelte +1 -1
  29. package/dist/rating/CustomIcon.svelte.d.ts +1 -1
  30. package/dist/rating/Heart.svelte +1 -1
  31. package/dist/rating/Heart.svelte.d.ts +1 -1
  32. package/dist/rating/Rating.svelte +1 -1
  33. package/dist/rating/Rating.svelte.d.ts +1 -1
  34. package/dist/rating/RatingComment.svelte +1 -1
  35. package/dist/rating/RatingComment.svelte.d.ts +1 -1
  36. package/dist/rating/Review.svelte +1 -1
  37. package/dist/rating/Review.svelte.d.ts +1 -1
  38. package/dist/rating/ScoreRating.svelte +1 -1
  39. package/dist/rating/ScoreRating.svelte.d.ts +1 -1
  40. package/dist/rating/Star.svelte +1 -1
  41. package/dist/rating/Star.svelte.d.ts +1 -1
  42. package/dist/rating/Thumbup.svelte +1 -1
  43. package/dist/rating/Thumbup.svelte.d.ts +1 -1
  44. package/dist/sidebar/Sidebar.svelte +1 -1
  45. package/dist/sidebar/Sidebar.svelte.d.ts +1 -1
  46. package/dist/sidebar/SidebarBrand.svelte +1 -1
  47. package/dist/sidebar/SidebarBrand.svelte.d.ts +1 -1
  48. package/dist/sidebar/SidebarButton.svelte +1 -1
  49. package/dist/sidebar/SidebarButton.svelte.d.ts +1 -1
  50. package/dist/sidebar/SidebarCta.svelte +1 -1
  51. package/dist/sidebar/SidebarCta.svelte.d.ts +1 -1
  52. package/dist/sidebar/SidebarDropdownWrapper.svelte +1 -1
  53. package/dist/sidebar/SidebarDropdownWrapper.svelte.d.ts +1 -1
  54. package/dist/sidebar/SidebarGroup.svelte +1 -1
  55. package/dist/sidebar/SidebarGroup.svelte.d.ts +1 -1
  56. package/dist/sidebar/SidebarItem.svelte +1 -1
  57. package/dist/sidebar/SidebarItem.svelte.d.ts +1 -1
  58. package/dist/skeleton/CardPlaceholder.svelte +1 -1
  59. package/dist/skeleton/CardPlaceholder.svelte.d.ts +1 -1
  60. package/dist/skeleton/ImagePlaceholder.svelte +1 -1
  61. package/dist/skeleton/ImagePlaceholder.svelte.d.ts +1 -1
  62. package/dist/skeleton/ListPlaceholder.svelte +1 -1
  63. package/dist/skeleton/ListPlaceholder.svelte.d.ts +1 -1
  64. package/dist/skeleton/Skeleton.svelte +1 -1
  65. package/dist/skeleton/Skeleton.svelte.d.ts +1 -1
  66. package/dist/skeleton/TextPlaceholder.svelte +1 -1
  67. package/dist/skeleton/TextPlaceholder.svelte.d.ts +1 -1
  68. package/dist/skeleton/VideoPlaceholder.svelte +1 -1
  69. package/dist/skeleton/VideoPlaceholder.svelte.d.ts +1 -1
  70. package/dist/speed-dial/SpeedDial.svelte +1 -1
  71. package/dist/speed-dial/SpeedDial.svelte.d.ts +1 -1
  72. package/dist/speed-dial/SpeedDialButton.svelte +1 -1
  73. package/dist/speed-dial/SpeedDialButton.svelte.d.ts +1 -1
  74. package/dist/speed-dial/SpeedDialTrigger.svelte +1 -1
  75. package/dist/speed-dial/SpeedDialTrigger.svelte.d.ts +1 -1
  76. package/dist/spinner/Spinner.svelte +1 -1
  77. package/dist/spinner/Spinner.svelte.d.ts +1 -1
  78. package/dist/{steps → stepindicator}/StepIndicator.svelte +1 -1
  79. package/dist/{steps → stepindicator}/StepIndicator.svelte.d.ts +1 -1
  80. package/dist/table/Table.svelte +1 -1
  81. package/dist/table/Table.svelte.d.ts +1 -1
  82. package/dist/table/TableBody.svelte +1 -1
  83. package/dist/table/TableBody.svelte.d.ts +1 -1
  84. package/dist/table/TableBodyCell.svelte +1 -1
  85. package/dist/table/TableBodyCell.svelte.d.ts +1 -1
  86. package/dist/table/TableBodyRow.svelte +1 -1
  87. package/dist/table/TableBodyRow.svelte.d.ts +1 -1
  88. package/dist/table/TableHead.svelte +1 -1
  89. package/dist/table/TableHead.svelte.d.ts +1 -1
  90. package/dist/table/TableHeadCell.svelte +1 -1
  91. package/dist/table/TableHeadCell.svelte.d.ts +1 -1
  92. package/dist/table/TableSearch.svelte +1 -1
  93. package/dist/table/TableSearch.svelte.d.ts +1 -1
  94. package/dist/tabs/TabItem.svelte +1 -1
  95. package/dist/tabs/TabItem.svelte.d.ts +1 -1
  96. package/dist/tabs/Tabs.svelte +1 -1
  97. package/dist/tabs/Tabs.svelte.d.ts +1 -1
  98. package/dist/theme/Theme.svelte +2 -2
  99. package/dist/theme/Theme.svelte.d.ts +2 -2
  100. package/dist/timeline/Activity.svelte +1 -1
  101. package/dist/timeline/Activity.svelte.d.ts +1 -1
  102. package/dist/timeline/ActivityItem.svelte +1 -1
  103. package/dist/timeline/ActivityItem.svelte.d.ts +1 -1
  104. package/dist/timeline/Group.svelte +1 -1
  105. package/dist/timeline/Group.svelte.d.ts +1 -1
  106. package/dist/timeline/GroupItem.svelte +1 -1
  107. package/dist/timeline/GroupItem.svelte.d.ts +1 -1
  108. package/dist/timeline/Timeline.svelte +1 -1
  109. package/dist/timeline/Timeline.svelte.d.ts +1 -1
  110. package/dist/timeline/TimelineItem.svelte +1 -1
  111. package/dist/timeline/TimelineItem.svelte.d.ts +1 -1
  112. package/dist/toast/Toast.svelte +1 -1
  113. package/dist/toast/Toast.svelte.d.ts +1 -1
  114. package/dist/tooltip/Tooltip.svelte +1 -1
  115. package/dist/tooltip/Tooltip.svelte.d.ts +1 -1
  116. package/dist/types.d.ts +30 -1
  117. package/dist/typography/anchor/A.svelte +1 -1
  118. package/dist/typography/anchor/A.svelte.d.ts +1 -1
  119. package/dist/typography/blockquote/Blockquote.svelte +1 -1
  120. package/dist/typography/blockquote/Blockquote.svelte.d.ts +1 -1
  121. package/dist/typography/descriptionlist/DescriptionList.svelte +1 -1
  122. package/dist/typography/descriptionlist/DescriptionList.svelte.d.ts +1 -1
  123. package/dist/typography/heading/Heading.svelte +1 -1
  124. package/dist/typography/heading/Heading.svelte.d.ts +1 -1
  125. package/dist/typography/hr/Hr.svelte +1 -1
  126. package/dist/typography/hr/Hr.svelte.d.ts +1 -1
  127. package/dist/typography/img/EnhancedImg.svelte +1 -1
  128. package/dist/typography/img/EnhancedImg.svelte.d.ts +1 -1
  129. package/dist/typography/img/Img.svelte +1 -1
  130. package/dist/typography/img/Img.svelte.d.ts +1 -1
  131. package/dist/typography/layout/Layout.svelte +1 -1
  132. package/dist/typography/layout/Layout.svelte.d.ts +1 -1
  133. package/dist/typography/list/Li.svelte +1 -1
  134. package/dist/typography/list/Li.svelte.d.ts +1 -1
  135. package/dist/typography/list/List.svelte +1 -1
  136. package/dist/typography/list/List.svelte.d.ts +1 -1
  137. package/dist/typography/mark/Mark.svelte +1 -1
  138. package/dist/typography/mark/Mark.svelte.d.ts +1 -1
  139. package/dist/typography/paragraph/P.svelte +1 -1
  140. package/dist/typography/paragraph/P.svelte.d.ts +1 -1
  141. package/dist/typography/secondary/Secondary.svelte +1 -1
  142. package/dist/typography/secondary/Secondary.svelte.d.ts +1 -1
  143. package/dist/typography/span/Span.svelte +1 -1
  144. package/dist/typography/span/Span.svelte.d.ts +1 -1
  145. package/dist/utils/Arrow.svelte +9 -13
  146. package/dist/utils/Arrow.svelte.d.ts +8 -9
  147. package/dist/utils/Popper.svelte +1 -1
  148. package/dist/utils/Popper.svelte.d.ts +1 -1
  149. package/dist/video/Video.svelte +1 -1
  150. package/dist/video/Video.svelte.d.ts +1 -1
  151. package/package.json +24 -14
  152. /package/dist/{steps → stepindicator}/index.d.ts +0 -0
  153. /package/dist/{steps → stepindicator}/index.js +0 -0
@@ -8,11 +8,13 @@
8
8
  const group: SizeType = getContext("group");
9
9
  const ctxDisabled: boolean | undefined = getContext("disabled");
10
10
 
11
- let { children, onclick, pill, outline = false, size = group ? "sm" : "md", color = group ? (outline ? "dark" : "alternative") : "primary", shadow = false, tag = "button", disabled, class: className, ...restProps }: ButtonProps = $props();
11
+ let { children, onclick, pill, outline = false, size = "md", color = "primary", shadow = false, tag = "button", disabled, class: className, ...restProps }: ButtonProps = $props();
12
12
 
13
+ let actualSize = $derived(group ? "sm" : size);
14
+ let actualColor = $derived(group ? (outline ? "dark" : "alternative") : color);
13
15
  let isDisabled = $derived(Boolean(ctxDisabled) || Boolean(disabled));
14
16
 
15
- const { base, outline: outline_, shadow: shadow_ } = $derived(button({ color, size, disabled: isDisabled, pill, group: !!group }));
17
+ const { base, outline: outline_, shadow: shadow_ } = $derived(button({ color: actualColor, size: actualSize, disabled: isDisabled, pill, group: !!group }));
16
18
  let btnCls = $derived(twMerge(base(), outline && outline_(), shadow && shadow_(), clsx(className)));
17
19
  </script>
18
20
 
@@ -40,8 +42,8 @@
40
42
  @prop onclick
41
43
  @prop pill
42
44
  @prop outline = false
43
- @prop size = group ? "sm" : "md"
44
- @prop color = group ? (outline ? "dark" : "alternative") : "primary"
45
+ @prop size = "md"
46
+ @prop color = "primary"
45
47
  @prop shadow = false
46
48
  @prop tag = "button"
47
49
  @prop disabled
@@ -8,8 +8,8 @@ import type { ButtonProps } from "..";
8
8
  * @prop onclick
9
9
  * @prop pill
10
10
  * @prop outline = false
11
- * @prop size = group ? "sm" : "md"
12
- * @prop color = group ? (outline ? "dark" : "alternative") : "primary"
11
+ * @prop size = "md"
12
+ * @prop color = "primary"
13
13
  * @prop shadow = false
14
14
  * @prop tag = "button"
15
15
  * @prop disabled
@@ -6,16 +6,7 @@
6
6
 
7
7
  type HTMLInputElementWithFiles = HTMLInputElement & { files: FileList | null };
8
8
 
9
- let {
10
- children,
11
- files = $bindable<FileList | null>(),
12
- class: className,
13
- ...restProps
14
- }: DropzoneProps & {
15
- ondrop?: DragEventHandler<HTMLButtonElement>;
16
- ondragover?: DragEventHandler<HTMLButtonElement>;
17
- onchange?: ChangeEventHandler<HTMLInputElementWithFiles>;
18
- } = $props();
9
+ let { children, files = $bindable<FileList | null>(), class: className, ...restProps }: DropzoneProps = $props();
19
10
 
20
11
  const base = $derived(dropzone({ class: clsx(className) }));
21
12
  let input: HTMLInputElement;
@@ -66,3 +57,15 @@
66
57
  <label class="hidden">
67
58
  <input {...restProps} bind:files bind:this={input} onchange={onChange} type="file" />
68
59
  </label>
60
+
61
+ <!--
62
+ @component
63
+ [Go to docs](https://flowbite-svelte.com/)
64
+ ## Type
65
+ [DropzoneProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L691)
66
+ ## Props
67
+ @prop children
68
+ @prop files = $bindable<FileList | null>()
69
+ @prop class: className
70
+ @prop ...restProps
71
+ -->
@@ -1,13 +1,14 @@
1
- import type { DragEventHandler, ChangeEventHandler } from "svelte/elements";
2
1
  import type { DropzoneProps } from "../../types";
3
- type HTMLInputElementWithFiles = HTMLInputElement & {
4
- files: FileList | null;
5
- };
6
- type $$ComponentProps = DropzoneProps & {
7
- ondrop?: DragEventHandler<HTMLButtonElement>;
8
- ondragover?: DragEventHandler<HTMLButtonElement>;
9
- onchange?: ChangeEventHandler<HTMLInputElementWithFiles>;
10
- };
11
- declare const Dropzone: import("svelte").Component<$$ComponentProps, {}, "files">;
2
+ /**
3
+ * [Go to docs](https://flowbite-svelte.com/)
4
+ * ## Type
5
+ * [DropzoneProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L691)
6
+ * ## Props
7
+ * @prop children
8
+ * @prop files = $bindable<FileList | null>()
9
+ * @prop class: className
10
+ * @prop ...restProps
11
+ */
12
+ declare const Dropzone: import("svelte").Component<DropzoneProps, {}, "files">;
12
13
  type Dropzone = ReturnType<typeof Dropzone>;
13
14
  export default Dropzone;
@@ -23,8 +23,8 @@
23
23
  {/if}
24
24
 
25
25
  {#if items}
26
- {#each items as { value, name }}
27
- <option {value}>{name}</option>
26
+ {#each items as item}
27
+ <option value={item.value} disabled={item.disabled}>{item.name}</option>
28
28
  {/each}
29
29
  {/if}
30
30
 
package/dist/index.d.ts CHANGED
@@ -32,7 +32,7 @@ export * from "./sidebar";
32
32
  export * from "./skeleton";
33
33
  export * from "./speed-dial";
34
34
  export * from "./spinner";
35
- export * from "./steps";
35
+ export * from "./stepindicator";
36
36
  export * from "./tabs";
37
37
  export * from "./table";
38
38
  export * from "./timeline";
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ export * from "./sidebar";
32
32
  export * from "./skeleton";
33
33
  export * from "./speed-dial";
34
34
  export * from "./spinner";
35
- export * from "./steps";
35
+ export * from "./stepindicator";
36
36
  export * from "./tabs";
37
37
  export * from "./table";
38
38
  export * from "./timeline";
@@ -50,7 +50,7 @@
50
50
  @component
51
51
  [Go to docs](https://flowbite-svelte.com/)
52
52
  ## Type
53
- [PaginationProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1099)
53
+ [PaginationProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1124)
54
54
  ## Props
55
55
  @prop pages = []
56
56
  @prop previous
@@ -2,7 +2,7 @@ import type { PaginationProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [PaginationProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1099)
5
+ * [PaginationProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1124)
6
6
  * ## Props
7
7
  * @prop pages = []
8
8
  * @prop previous
@@ -0,0 +1,60 @@
1
+ <script lang="ts">
2
+ import clsx from "clsx";
3
+ import { paginationbutton } from ".";
4
+ import type { PaginationButtonProps } from "../types";
5
+ import { getContext } from "svelte";
6
+
7
+ let { children, size, onclick, disabled = false, class: className, href, active = false, ...restProps }: PaginationButtonProps = $props();
8
+
9
+ const group = getContext<boolean>("group");
10
+ const table = getContext<boolean>("table");
11
+
12
+ const paginationClass = $derived(
13
+ paginationbutton({
14
+ size: getContext("size") ?? size,
15
+ active,
16
+ group,
17
+ table,
18
+ disabled,
19
+ class: clsx(className)
20
+ })
21
+ );
22
+
23
+ function handleClick(e: MouseEvent) {
24
+ if (disabled) {
25
+ e.preventDefault();
26
+ return;
27
+ }
28
+ if (onclick) onclick();
29
+ }
30
+ </script>
31
+
32
+ {#if href}
33
+ <a {href} {...restProps} class={paginationClass} onclick={handleClick}>
34
+ {#if children}
35
+ {@render children()}
36
+ {/if}
37
+ </a>
38
+ {:else}
39
+ <button {...restProps} {disabled} class={paginationClass} onclick={handleClick}>
40
+ {#if children}
41
+ {@render children()}
42
+ {/if}
43
+ </button>
44
+ {/if}
45
+
46
+ <!--
47
+ @component
48
+ [Go to docs](https://flowbite-svelte.com/)
49
+ ## Type
50
+ [PaginationButtonProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1095)
51
+ ## Props
52
+ @prop children
53
+ @prop size
54
+ @prop onclick
55
+ @prop disabled = false
56
+ @prop class: className
57
+ @prop href
58
+ @prop active = false
59
+ @prop ...restProps
60
+ -->
@@ -0,0 +1,18 @@
1
+ import type { PaginationButtonProps } from "../types";
2
+ /**
3
+ * [Go to docs](https://flowbite-svelte.com/)
4
+ * ## Type
5
+ * [PaginationButtonProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1095)
6
+ * ## Props
7
+ * @prop children
8
+ * @prop size
9
+ * @prop onclick
10
+ * @prop disabled = false
11
+ * @prop class: className
12
+ * @prop href
13
+ * @prop active = false
14
+ * @prop ...restProps
15
+ */
16
+ declare const PaginationButton: import("svelte").Component<PaginationButtonProps, {}, "">;
17
+ type PaginationButton = ReturnType<typeof PaginationButton>;
18
+ export default PaginationButton;
@@ -29,7 +29,7 @@
29
29
  @component
30
30
  [Go to docs](https://flowbite-svelte.com/)
31
31
  ## Type
32
- [PaginationItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1095)
32
+ [PaginationItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1120)
33
33
  ## Props
34
34
  @prop children
35
35
  @prop size
@@ -2,7 +2,7 @@ import type { PaginationItemProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [PaginationItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1095)
5
+ * [PaginationItemProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1120)
6
6
  * ## Props
7
7
  * @prop children
8
8
  * @prop size
@@ -0,0 +1,99 @@
1
+ <script lang="ts">
2
+ import { setContext } from "svelte";
3
+ import { paginationnav } from "./theme";
4
+ import { type PaginationNavProps, PaginationButton } from "..";
5
+
6
+ function paginationRange(start: number, end: number): number[] {
7
+ return Array.from({ length: end - start + 1 }, (_, i) => start + i);
8
+ }
9
+
10
+ let { currentPage = 1, totalPages = 1, onPageChange, prevContent, nextContent, prevClass, nextClass, layout = "pagination", nextLabel = "Next", previousLabel = "Previous", ariaLabel = "Page navigation", size = "default", class: className, spanClass, tableDivClass, ...restProps }: PaginationNavProps = $props();
11
+
12
+ // Set context values for child components
13
+ setContext("group", true);
14
+ setContext("size", size);
15
+ setContext("table", layout === "table");
16
+
17
+ // Calculate visible pages range
18
+ const lastPage = $derived(Math.min(Math.max(layout === "pagination" ? currentPage + 2 : currentPage + 4, 5), totalPages));
19
+ const firstPage = $derived(Math.max(1, lastPage - 4));
20
+
21
+ // Generate array of page numbers to display
22
+ const pageNumbers = $derived(paginationRange(firstPage, lastPage));
23
+
24
+ // Navigation helper functions
25
+ function goToNextPage() {
26
+ onPageChange(Math.min(currentPage + 1, totalPages));
27
+ }
28
+
29
+ function goToPreviousPage() {
30
+ onPageChange(Math.max(currentPage - 1, 1));
31
+ }
32
+
33
+ const { base, tableDiv, tableSpan, prevItem, nextItem } = $derived(paginationnav({ layout }));
34
+ </script>
35
+
36
+ <nav aria-label={ariaLabel} {...restProps}>
37
+ {#if layout === "table"}
38
+ <div class={tableDiv({ class: tableDivClass })}>
39
+ Showing <span class={tableSpan({ class: spanClass })}>{currentPage}</span>
40
+ of
41
+ <span class={tableSpan({ class: spanClass })}>{totalPages}</span>
42
+ Entries
43
+ </div>
44
+ {/if}
45
+
46
+ <ul class={base({ class: className })}>
47
+ <li {...restProps}>
48
+ <PaginationButton onclick={goToPreviousPage} disabled={currentPage === 1} class={prevItem({ class: prevClass })}>
49
+ {#if prevContent}
50
+ {@render prevContent()}
51
+ {:else}
52
+ {previousLabel}
53
+ {/if}
54
+ </PaginationButton>
55
+ </li>
56
+ {#if layout === "pagination" && pageNumbers.length > 0}
57
+ {#each pageNumbers as page}
58
+ <li aria-current={page === currentPage ? "page" : undefined}>
59
+ <PaginationButton active={page === currentPage} onclick={() => onPageChange(page)}>
60
+ {page}
61
+ </PaginationButton>
62
+ </li>
63
+ {/each}
64
+ {/if}
65
+ <li {...restProps}>
66
+ <PaginationButton onclick={goToNextPage} disabled={currentPage === totalPages} class={nextItem({ class: nextClass })}>
67
+ {#if nextContent}
68
+ {@render nextContent()}
69
+ {:else}
70
+ {nextLabel}
71
+ {/if}
72
+ </PaginationButton>
73
+ </li>
74
+ </ul>
75
+ </nav>
76
+
77
+ <!--
78
+ @component
79
+ [Go to docs](https://flowbite-svelte.com/)
80
+ ## Type
81
+ [PaginationNavProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1101)
82
+ ## Props
83
+ @prop currentPage = 1
84
+ @prop totalPages = 1
85
+ @prop onPageChange
86
+ @prop prevContent
87
+ @prop nextContent
88
+ @prop prevClass
89
+ @prop nextClass
90
+ @prop layout = "pagination"
91
+ @prop nextLabel = "Next"
92
+ @prop previousLabel = "Previous"
93
+ @prop ariaLabel = "Page navigation"
94
+ @prop size = "default"
95
+ @prop class: className
96
+ @prop spanClass
97
+ @prop tableDivClass
98
+ @prop ...restProps
99
+ -->
@@ -0,0 +1,26 @@
1
+ import { type PaginationNavProps } from "..";
2
+ /**
3
+ * [Go to docs](https://flowbite-svelte.com/)
4
+ * ## Type
5
+ * [PaginationNavProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1101)
6
+ * ## Props
7
+ * @prop currentPage = 1
8
+ * @prop totalPages = 1
9
+ * @prop onPageChange
10
+ * @prop prevContent
11
+ * @prop nextContent
12
+ * @prop prevClass
13
+ * @prop nextClass
14
+ * @prop layout = "pagination"
15
+ * @prop nextLabel = "Next"
16
+ * @prop previousLabel = "Previous"
17
+ * @prop ariaLabel = "Page navigation"
18
+ * @prop size = "default"
19
+ * @prop class: className
20
+ * @prop spanClass
21
+ * @prop tableDivClass
22
+ * @prop ...restProps
23
+ */
24
+ declare const PaginationNav: import("svelte").Component<PaginationNavProps, {}, "">;
25
+ type PaginationNav = ReturnType<typeof PaginationNav>;
26
+ export default PaginationNav;
@@ -1,4 +1,5 @@
1
- import { paginationItem, pagination } from "./theme";
2
- import Pagination from "./Pagination.svelte";
3
- import PaginationItem from "./PaginationItem.svelte";
4
- export { Pagination, PaginationItem, paginationItem, pagination };
1
+ export { paginationItem, pagination, paginationbutton, paginationnav } from "./theme";
2
+ export { default as PaginationNav } from "./PaginationNav.svelte";
3
+ export { default as PaginationButton } from "./PaginationButton.svelte";
4
+ export { default as Pagination } from "./Pagination.svelte";
5
+ export { default as PaginationItem } from "./PaginationItem.svelte";
@@ -1,4 +1,5 @@
1
- import { paginationItem, pagination } from "./theme";
2
- import Pagination from "./Pagination.svelte";
3
- import PaginationItem from "./PaginationItem.svelte";
4
- export { Pagination, PaginationItem, paginationItem, pagination };
1
+ export { paginationItem, pagination, paginationbutton, paginationnav } from "./theme";
2
+ export { default as PaginationNav } from "./PaginationNav.svelte";
3
+ export { default as PaginationButton } from "./PaginationButton.svelte";
4
+ export { default as Pagination } from "./Pagination.svelte";
5
+ export { default as PaginationItem } from "./PaginationItem.svelte";
@@ -1,5 +1,146 @@
1
1
  import { type VariantProps } from "tailwind-variants";
2
+ export type PaginationVariants = VariantProps<typeof pagination>;
3
+ export declare const paginationnav: import("tailwind-variants").TVReturnType<{
4
+ size: {
5
+ default: string;
6
+ large: string;
7
+ };
8
+ layout: {
9
+ table: {
10
+ prevItem: string;
11
+ nextItem: string;
12
+ };
13
+ navigation: {
14
+ prevItem: string;
15
+ nextItem: string;
16
+ };
17
+ pagination: {
18
+ prevItem: string;
19
+ nextItem: string;
20
+ };
21
+ };
22
+ }, {
23
+ base: string;
24
+ tableDiv: string;
25
+ tableSpan: string;
26
+ prevItem: string;
27
+ nextItem: string;
28
+ }, undefined, {
29
+ size: {
30
+ default: string;
31
+ large: string;
32
+ };
33
+ layout: {
34
+ table: {
35
+ prevItem: string;
36
+ nextItem: string;
37
+ };
38
+ navigation: {
39
+ prevItem: string;
40
+ nextItem: string;
41
+ };
42
+ pagination: {
43
+ prevItem: string;
44
+ nextItem: string;
45
+ };
46
+ };
47
+ }, {
48
+ base: string;
49
+ tableDiv: string;
50
+ tableSpan: string;
51
+ prevItem: string;
52
+ nextItem: string;
53
+ }, import("tailwind-variants").TVReturnType<{
54
+ size: {
55
+ default: string;
56
+ large: string;
57
+ };
58
+ layout: {
59
+ table: {
60
+ prevItem: string;
61
+ nextItem: string;
62
+ };
63
+ navigation: {
64
+ prevItem: string;
65
+ nextItem: string;
66
+ };
67
+ pagination: {
68
+ prevItem: string;
69
+ nextItem: string;
70
+ };
71
+ };
72
+ }, {
73
+ base: string;
74
+ tableDiv: string;
75
+ tableSpan: string;
76
+ prevItem: string;
77
+ nextItem: string;
78
+ }, undefined, unknown, unknown, undefined>>;
2
79
  export type PaginationItemVariants = VariantProps<typeof paginationItem>;
80
+ export declare const paginationbutton: import("tailwind-variants").TVReturnType<{
81
+ size: {
82
+ default: string;
83
+ large: string;
84
+ };
85
+ active: {
86
+ true: string;
87
+ false: string;
88
+ };
89
+ group: {
90
+ true: string;
91
+ false: string;
92
+ };
93
+ table: {
94
+ true: string;
95
+ false: string;
96
+ };
97
+ disabled: {
98
+ true: string;
99
+ false: string;
100
+ };
101
+ }, undefined, "flex items-center font-medium", {
102
+ size: {
103
+ default: string;
104
+ large: string;
105
+ };
106
+ active: {
107
+ true: string;
108
+ false: string;
109
+ };
110
+ group: {
111
+ true: string;
112
+ false: string;
113
+ };
114
+ table: {
115
+ true: string;
116
+ false: string;
117
+ };
118
+ disabled: {
119
+ true: string;
120
+ false: string;
121
+ };
122
+ }, undefined, import("tailwind-variants").TVReturnType<{
123
+ size: {
124
+ default: string;
125
+ large: string;
126
+ };
127
+ active: {
128
+ true: string;
129
+ false: string;
130
+ };
131
+ group: {
132
+ true: string;
133
+ false: string;
134
+ };
135
+ table: {
136
+ true: string;
137
+ false: string;
138
+ };
139
+ disabled: {
140
+ true: string;
141
+ false: string;
142
+ };
143
+ }, undefined, "flex items-center font-medium", unknown, unknown, undefined>>;
3
144
  export declare const paginationItem: import("tailwind-variants").TVReturnType<{
4
145
  size: {
5
146
  default: string;
@@ -52,7 +193,6 @@ export declare const paginationItem: import("tailwind-variants").TVReturnType<{
52
193
  false: string;
53
194
  };
54
195
  }, undefined, "flex items-center font-medium", unknown, unknown, undefined>>;
55
- export type PaginationVariants = VariantProps<typeof pagination>;
56
196
  export declare const pagination: import("tailwind-variants").TVReturnType<{
57
197
  table: {
58
198
  true: string;
@@ -1,4 +1,66 @@
1
1
  import { tv } from "tailwind-variants";
2
+ export const paginationnav = tv({
3
+ slots: {
4
+ base: "inline-flex -space-x-px rtl:space-x-reverse items-center",
5
+ tableDiv: "flex items-center text-sm mb-4",
6
+ tableSpan: "font-semibold mx-1",
7
+ prevItem: "rounded-none",
8
+ nextItem: "rounded-none"
9
+ },
10
+ variants: {
11
+ size: {
12
+ default: "",
13
+ large: ""
14
+ },
15
+ layout: {
16
+ table: { prevItem: "rounded-s bg-gray-800 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 text-white hover:text-gray-200", nextItem: "text-white bg-gray-800 border-0 border-s border-gray-700 rounded-e hover:bg-gray-900 hover:text-gray-200 dark:bg-gray-800 dark:border-gray-700 dark:text-gray-400 dark:hover:bg-gray-700 dark:hover:text-white" },
17
+ navigation: { prevItem: "rounded-s-lg", nextItem: "rounded-e-lg" },
18
+ pagination: { prevItem: "rounded-s-lg", nextItem: "rounded-e-lg" }
19
+ }
20
+ },
21
+ defaultVariants: {
22
+ table: false,
23
+ size: "default"
24
+ }
25
+ });
26
+ export const paginationbutton = tv({
27
+ base: "flex items-center font-medium",
28
+ variants: {
29
+ size: {
30
+ default: "h-8 px-3 text-sm",
31
+ large: "h-10 px-4 text-base"
32
+ },
33
+ active: {
34
+ true: "text-blue-600 border border-gray-300 bg-blue-50 hover:bg-blue-100 hover:text-blue-700 dark:border-gray-700 dark:bg-gray-700 dark:text-white",
35
+ false: "text-gray-500 bg-white 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"
36
+ },
37
+ group: {
38
+ true: "",
39
+ false: "rounded-lg"
40
+ },
41
+ table: {
42
+ true: "rounded-sm",
43
+ false: "border"
44
+ },
45
+ disabled: {
46
+ true: "cursor-not-allowed opacity-50",
47
+ false: ""
48
+ }
49
+ },
50
+ compoundVariants: [
51
+ {
52
+ group: false,
53
+ table: false,
54
+ class: "rounded-lg"
55
+ }
56
+ ],
57
+ defaultVariants: {
58
+ size: "default",
59
+ active: false,
60
+ group: false,
61
+ table: false
62
+ }
63
+ });
2
64
  export const paginationItem = tv({
3
65
  base: "flex items-center font-medium",
4
66
  variants: {
@@ -26,7 +26,7 @@
26
26
  @component
27
27
  [Go to docs](https://flowbite-svelte.com/)
28
28
  ## Type
29
- [PopoverProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1109)
29
+ [PopoverProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1134)
30
30
  ## Props
31
31
  @prop title: titleSlot
32
32
  @prop color = "default"
@@ -2,7 +2,7 @@ import type { PopoverProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [PopoverProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1109)
5
+ * [PopoverProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1134)
6
6
  * ## Props
7
7
  * @prop title: titleSlot
8
8
  * @prop color = "default"
@@ -43,7 +43,7 @@
43
43
  @component
44
44
  [Go to docs](https://flowbite-svelte.com/)
45
45
  ## Type
46
- [ProgressbarProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1119)
46
+ [ProgressbarProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1144)
47
47
  ## Props
48
48
  @prop progress = "45"
49
49
  @prop precision = 0
@@ -2,7 +2,7 @@ import type { ProgressbarProps } from "../types";
2
2
  /**
3
3
  * [Go to docs](https://flowbite-svelte.com/)
4
4
  * ## Type
5
- * [ProgressbarProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1119)
5
+ * [ProgressbarProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1144)
6
6
  * ## Props
7
7
  * @prop progress = "45"
8
8
  * @prop precision = 0
@@ -62,7 +62,7 @@
62
62
  @component
63
63
  [Go to docs](https://flowbite-svelte.com/)
64
64
  ## Type
65
- [ProgressradialProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1136)
65
+ [ProgressradialProps](https://github.com/themesberg/flowbite-svelte/blob/main/src/lib/types.ts#L1161)
66
66
  ## Props
67
67
  @prop progress = 45
68
68
  @prop radius = 42