flowbite-svelte 0.29.3 → 0.29.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
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.29.4](https://github.com/themesberg/flowbite-svelte/compare/v0.29.3...v0.29.4) (2022-12-22)
6
+
7
+
8
+ ### Features
9
+
10
+ * add pagination examples ([#503](https://github.com/themesberg/flowbite-svelte/issues/503)) ([93e48e3](https://github.com/themesberg/flowbite-svelte/commit/93e48e354a731216213e4ba38bf12e462880d58a))
11
+
5
12
  ### [0.29.3](https://github.com/themesberg/flowbite-svelte/compare/v0.29.2...v0.29.3) (2022-12-20)
6
13
 
7
14
  ### [0.29.2](https://github.com/themesberg/flowbite-svelte/compare/v0.29.1...v0.29.2) (2022-12-19)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.29.3",
3
+ "version": "0.29.4",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -4,6 +4,7 @@ import PaginationItem from './PaginationItem.svelte';
4
4
  export let pages = [];
5
5
  export let ulClass = 'inline-flex -space-x-px items-center';
6
6
  export let table = false;
7
+ export let active = false;
7
8
  const dispatch = createEventDispatcher();
8
9
  setContext('group', true);
9
10
  setContext('table', table);
@@ -22,9 +23,10 @@ const next = () => {
22
23
  <slot name="prev">Previous</slot>
23
24
  </PaginationItem>
24
25
  </li>
25
- {#each pages as { name, href }}
26
+ {#each pages as { name, href, active }}
26
27
  <li>
27
28
  <PaginationItem
29
+ {active}
28
30
  on:blur
29
31
  on:change
30
32
  on:click
@@ -6,6 +6,7 @@ declare const __propDef: {
6
6
  pages?: LinkType[] | undefined;
7
7
  ulClass?: string | undefined;
8
8
  table?: boolean | undefined;
9
+ active?: boolean | undefined;
9
10
  };
10
11
  events: {
11
12
  blur: FocusEvent;
@@ -1,10 +1,13 @@
1
1
  <script>import classNames from 'classnames';
2
- import { getContext } from 'svelte';
2
+ import { getContext, onMount } from 'svelte';
3
3
  export let href = undefined;
4
+ export let active = false;
5
+ export let activeClass = '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';
6
+ export let normalClass = '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';
4
7
  const group = getContext('group');
5
8
  const table = getContext('table');
6
9
  let defaultClass;
7
- $: defaultClass = classNames('block py-2', group ? 'px-3' : 'px-4', 'text-sm font-medium', table || 'border border-gray-300', group || (table ? 'rounded' : 'rounded-lg'), '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', $$props.class);
10
+ $: defaultClass = classNames('block py-2', group ? 'px-3' : 'px-4', 'text-sm font-medium', table || 'border border-gray-300', group || (table ? 'rounded' : 'rounded-lg'), active ? activeClass : normalClass, $$props.class);
8
11
  </script>
9
12
 
10
13
  <svelte:element
@@ -3,6 +3,9 @@ declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
5
  href?: string | undefined;
6
+ active?: boolean | undefined;
7
+ activeClass?: string | undefined;
8
+ normalClass?: string | undefined;
6
9
  };
7
10
  events: {
8
11
  blur: FocusEvent;
package/types.d.ts CHANGED
@@ -96,6 +96,7 @@ export interface LinkType {
96
96
  name: number;
97
97
  href?: string;
98
98
  rel?: string;
99
+ active?: boolean;
99
100
  }
100
101
  export interface ListCardType {
101
102
  img: ImgType;