flowbite-svelte 0.15.41 → 0.16.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.
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.16.0](https://github.com/themesberg/flowbite-svelte/compare/v0.15.41...v0.16.0) (2022-05-26)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * update ButtonGroup components ([72fa977](https://github.com/themesberg/flowbite-svelte/commit/72fa9779438d5344fd30014fa00e1fe9f779f432))
11
+
5
12
  ### [0.15.41](https://github.com/themesberg/flowbite-svelte/compare/v0.15.40...v0.15.41) (2022-05-24)
6
13
 
7
14
 
@@ -11,7 +11,7 @@ export let placehoder = false;
11
11
  </div>
12
12
  {:else if avatar.header && avatar.text}
13
13
  <div class="flex items-center space-x-4">
14
- <img class="class={avatarClass}" alt={avatar.alt} src={avatar.src} />
14
+ <img class={avatarClass} alt={avatar.alt} src={avatar.src} />
15
15
  <div class="space-y-1 font-medium dark:text-white">
16
16
  <div>{avatar.header}</div>
17
17
  <div class="text-sm text-gray-500 dark:text-gray-400">{avatar.text}</div>
@@ -1,46 +1,6 @@
1
- <script>export let buttons;
2
- let btnLength = buttons.length;
3
- let baseClass = 'inline-flex relative items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white 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
- let classFirst = 'rounded-l-lg border';
5
- let classMiddle = 'border-t border-b';
6
- let classLast = 'rounded-r-md border';
1
+ <script>export let divClass = 'inline-flex rounded-md shadow-sm';
7
2
  </script>
8
3
 
9
- <div class="inline-flex rounded-md shadow-sm" role="group">
10
- {#each buttons as { name, icon, href, rel, iconClass, iconSize }, i}
11
- {#if i === 0}
12
- <button type="button" class="{baseClass} {classFirst}">
13
- {#if icon}
14
- <svelte:component this={icon} size={iconSize} class="mr-2 {iconClass}" />
15
- {/if}
16
- {#if href}
17
- <a {href} {rel}>{name}</a>
18
- {:else}
19
- {name}
20
- {/if}
21
- </button>
22
- {:else if i === btnLength - 1}
23
- <button type="button" class="{baseClass} {classLast}">
24
- {#if icon}
25
- <svelte:component this={icon} size={iconSize} class="mr-2 {iconClass}" />
26
- {/if}
27
- {#if href}
28
- <a {href} {rel}>{name}</a>
29
- {:else}
30
- {name}
31
- {/if}
32
- </button>
33
- {:else}
34
- <button type="button" class="{baseClass} {classMiddle}">
35
- {#if icon}
36
- <svelte:component this={icon} size={iconSize} class="mr-2 {iconClass}" />
37
- {/if}
38
- {#if href}
39
- <a {href} {rel}>{name}</a>
40
- {:else}
41
- {name}
42
- {/if}
43
- </button>
44
- {/if}
45
- {/each}
4
+ <div class="{divClass} {$$props.class}" role="group">
5
+ <slot />
46
6
  </div>
@@ -1,13 +1,15 @@
1
1
  import { SvelteComponentTyped } from "svelte";
2
- import type { ButtonGroupType } from '../types';
3
2
  declare const __propDef: {
4
3
  props: {
5
- buttons: ButtonGroupType[];
4
+ [x: string]: any;
5
+ divClass?: string;
6
6
  };
7
7
  events: {
8
8
  [evt: string]: CustomEvent<any>;
9
9
  };
10
- slots: {};
10
+ slots: {
11
+ default: {};
12
+ };
11
13
  };
12
14
  export declare type ButtonGroupProps = typeof __propDef.props;
13
15
  export declare type ButtonGroupEvents = typeof __propDef.events;
@@ -0,0 +1,16 @@
1
+ <script>export let btnClass = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-white first:rounded-l-lg border-t border-b first:border last:rounded-r-md last: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';
2
+ export let outlineClass = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-transparent first:rounded-l-lg border-t border-b first:border last:rounded-r-md last: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';
3
+ export let outline = false;
4
+ export let href = '';
5
+ if (outline) {
6
+ btnClass = outlineClass;
7
+ }
8
+ </script>
9
+
10
+ {#if href}
11
+ <a {href} class="{btnClass} {$$props.class}"><slot /></a>
12
+ {:else}
13
+ <button type="button" class="{btnClass} {$$props.class}">
14
+ <slot />
15
+ </button>
16
+ {/if}
@@ -0,0 +1,22 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare const __propDef: {
3
+ props: {
4
+ [x: string]: any;
5
+ btnClass?: string;
6
+ outlineClass?: string;
7
+ outline?: boolean;
8
+ href?: string;
9
+ };
10
+ events: {
11
+ [evt: string]: CustomEvent<any>;
12
+ };
13
+ slots: {
14
+ default: {};
15
+ };
16
+ };
17
+ export declare type ButtonGroupItemProps = typeof __propDef.props;
18
+ export declare type ButtonGroupItemEvents = typeof __propDef.events;
19
+ export declare type ButtonGroupItemSlots = typeof __propDef.slots;
20
+ export default class ButtonGroupItem extends SvelteComponentTyped<ButtonGroupItemProps, ButtonGroupItemEvents, ButtonGroupItemSlots> {
21
+ }
22
+ export {};
package/index.d.ts CHANGED
@@ -12,7 +12,7 @@ export { default as GradientDuotoneButton } from './buttons/GradientDuotoneButto
12
12
  export { default as GradientMonochromeButton } from './buttons/GradientMonochromeButton.svelte';
13
13
  export { default as GradientOutlineButton } from './buttons/GradientOutlineButton.svelte';
14
14
  export { default as ButtonGroup } from './buttongroups/ButtonGroup.svelte';
15
- export { default as ButtonGroupOutline } from './buttongroups/ButtonGroupOutline.svelte';
15
+ export { default as ButtonGroupItem } from './buttongroups/ButtonGroupItem.svelte';
16
16
  export { default as Card } from './cards/Card.svelte';
17
17
  export { default as HorizontalCard } from './cards/HorizontalCard.svelte';
18
18
  export { default as InteractiveCard } from './cards/InteractiveCard.svelte';
package/index.js CHANGED
@@ -19,7 +19,7 @@ export { default as GradientMonochromeButton } from './buttons/GradientMonochrom
19
19
  export { default as GradientOutlineButton } from './buttons/GradientOutlineButton.svelte';
20
20
  // Buttongroups
21
21
  export { default as ButtonGroup } from './buttongroups/ButtonGroup.svelte';
22
- export { default as ButtonGroupOutline } from './buttongroups/ButtonGroupOutline.svelte';
22
+ export { default as ButtonGroupItem } from './buttongroups/ButtonGroupItem.svelte';
23
23
  // Cards
24
24
  export { default as Card } from './cards/Card.svelte';
25
25
  export { default as HorizontalCard } from './cards/HorizontalCard.svelte';
@@ -2,7 +2,7 @@
2
2
  export let active = false;
3
3
  export let activeClass = 'block py-2 pr-4 pl-3 text-white bg-blue-700 rounded md:bg-transparent md:text-blue-700 md:p-0 dark:text-white';
4
4
  export let nonActiveClass = 'block py-2 pr-4 pl-3 text-gray-700 border-b border-gray-100 hover:bg-gray-50 md:hover:bg-transparent md:border-0 md:hover:text-blue-700 md:p-0 dark:text-gray-400 md:dark:hover:text-white dark:hover:bg-gray-700 dark:hover:text-white md:dark:hover:bg-transparent dark:border-gray-700';
5
- let aClass = active ? activeClass : nonActiveClass;
5
+ $: aClass = active ? activeClass : nonActiveClass;
6
6
  </script>
7
7
 
8
8
  <li>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.15.41",
3
+ "version": "0.16.0",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -95,7 +95,7 @@
95
95
  "./badges/BadgeLink.svelte": "./badges/BadgeLink.svelte",
96
96
  "./breadcrumbs/Breadcrumb.svelte": "./breadcrumbs/Breadcrumb.svelte",
97
97
  "./buttongroups/ButtonGroup.svelte": "./buttongroups/ButtonGroup.svelte",
98
- "./buttongroups/ButtonGroupOutline.svelte": "./buttongroups/ButtonGroupOutline.svelte",
98
+ "./buttongroups/ButtonGroupItem.svelte": "./buttongroups/ButtonGroupItem.svelte",
99
99
  "./buttons/Button.svelte": "./buttons/Button.svelte",
100
100
  "./buttons/ColorShadowButton.svelte": "./buttons/ColorShadowButton.svelte",
101
101
  "./buttons/GradientDuotoneButton.svelte": "./buttons/GradientDuotoneButton.svelte",
@@ -1,46 +0,0 @@
1
- <script>export let buttons;
2
- let btnLength = buttons.length;
3
- let baseClass = 'inline-flex items-center py-2 px-4 text-sm font-medium text-gray-900 bg-transparent 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
- let classFirst = 'rounded-l-lg border';
5
- let classMiddle = 'border-t border-b';
6
- let classLast = 'rounded-r-md border';
7
- </script>
8
-
9
- <div class="inline-flex rounded-md shadow-sm">
10
- {#each buttons as { href, name, rel, icon, iconClass, iconSize }, i}
11
- {#if i === 0}
12
- <button type="button" class="{baseClass} {classFirst}">
13
- {#if icon}
14
- <svelte:component this={icon} size={iconSize} class="mr-2 {iconClass}" />
15
- {/if}
16
- {#if href}
17
- <a {href} {rel}>{name}</a>
18
- {:else}
19
- {name}
20
- {/if}
21
- </button>
22
- {:else if i === btnLength - 1}
23
- <button type="button" class="{baseClass} {classLast}">
24
- {#if icon}
25
- <svelte:component this={icon} size={iconSize} class="mr-2 {iconClass}" />
26
- {/if}
27
- {#if href}
28
- <a {href} {rel}>{name}</a>
29
- {:else}
30
- {name}
31
- {/if}
32
- </button>
33
- {:else}
34
- <button type="button" class="{baseClass} {classMiddle}">
35
- {#if icon}
36
- <svelte:component this={icon} size={iconSize} class="mr-2 {iconClass}" />
37
- {/if}
38
- {#if href}
39
- <a {href} {rel}>{name}</a>
40
- {:else}
41
- {name}
42
- {/if}
43
- </button>
44
- {/if}
45
- {/each}
46
- </div>
@@ -1,17 +0,0 @@
1
- import { SvelteComponentTyped } from "svelte";
2
- import type { ButtonGroupType } from '../types';
3
- declare const __propDef: {
4
- props: {
5
- buttons: ButtonGroupType[];
6
- };
7
- events: {
8
- [evt: string]: CustomEvent<any>;
9
- };
10
- slots: {};
11
- };
12
- export declare type ButtonGroupOutlineProps = typeof __propDef.props;
13
- export declare type ButtonGroupOutlineEvents = typeof __propDef.events;
14
- export declare type ButtonGroupOutlineSlots = typeof __propDef.slots;
15
- export default class ButtonGroupOutline extends SvelteComponentTyped<ButtonGroupOutlineProps, ButtonGroupOutlineEvents, ButtonGroupOutlineSlots> {
16
- }
17
- export {};