flowbite-svelte 0.26.25 → 0.26.26

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,20 @@
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.26.26](https://github.com/themesberg/flowbite-svelte/compare/v0.26.25...v0.26.26) (2022-09-20)
6
+
7
+
8
+ ### Features
9
+
10
+ * add $$slots.arrowdown and arrowup for user icons ([3fa53de](https://github.com/themesberg/flowbite-svelte/commit/3fa53de11239fe93e2ae9e28e5bdf3ee3ccc1f69))
11
+ * add ChevronUp to SidebarDropdownWrapper ([032d540](https://github.com/themesberg/flowbite-svelte/commit/032d540b347ab30ddcdcddff8c0963290ce0c904))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * alert more tweaks ([444b340](https://github.com/themesberg/flowbite-svelte/commit/444b340f3a211f02572675b94624da4ae5d90c63))
17
+ * alert tweaks ([0c93b3c](https://github.com/themesberg/flowbite-svelte/commit/0c93b3c27d8911cd4709f78c554f68e524cc06d4))
18
+
5
19
  ### [0.26.25](https://github.com/themesberg/flowbite-svelte/compare/v0.26.24...v0.26.25) (2022-09-19)
6
20
 
7
21
 
@@ -3,32 +3,35 @@ import { createEventDispatcher } from 'svelte';
3
3
  import CloseButton from '../utils/CloseButton.svelte';
4
4
  import Frame from '../utils/Frame.svelte';
5
5
  const dispatch = createEventDispatcher();
6
- export let color = 'blue';
7
6
  export let dismissable = false;
8
- export let rounded = true;
9
7
  export let accent = false;
10
8
  let hidden = false;
11
9
  const handleHide = () => {
12
10
  hidden = !hidden;
13
- dispatch('handleAlert');
14
11
  dispatch('close'); // preffered name
15
12
  };
16
13
  let divClass;
17
14
  $: divClass = classNames('p-4 text-sm', accent && 'border-t-4 ', hidden && 'hidden', $$props.class);
15
+ $: {
16
+ // set default values
17
+ $$restProps.color = $$restProps.color ?? 'blue';
18
+ $$restProps.rounded = $$restProps.rounded ?? !accent;
19
+ }
18
20
  </script>
19
21
 
20
- <Frame {color} {rounded} {...$$restProps} class={divClass} role="alert">
21
- <div class="flex items-center whitespace-pre-wrap">
22
+ <Frame {...$$restProps} class={divClass} role="alert">
23
+ <div class="flex items-center">
22
24
  {#if $$slots.icon}
23
25
  <slot name="icon" />
24
26
  {/if}
25
-
26
- <slot />
27
+ <div class:ml-3={$$slots.icon}>
28
+ <slot />
29
+ </div>
27
30
 
28
31
  {#if dismissable}
29
32
  <CloseButton
30
33
  class="-mx-1.5 -my-1.5"
31
- {color}
34
+ color={$$restProps.color}
32
35
  on:click={handleHide}
33
36
  on:click
34
37
  on:change
@@ -2,9 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
- color?: "gray" | "blue" | "red" | "green" | "yellow" | "indigo" | "purple" | "pink" | "dark" | "custom" | undefined;
6
5
  dismissable?: boolean | undefined;
7
- rounded?: boolean | undefined;
8
6
  accent?: boolean | undefined;
9
7
  };
10
8
  events: {
@@ -16,7 +14,6 @@ declare const __propDef: {
16
14
  blur: CustomEvent<any>;
17
15
  mouseenter: CustomEvent<any>;
18
16
  mouseleave: CustomEvent<any>;
19
- handleAlert: CustomEvent<any>;
20
17
  close: CustomEvent<any>;
21
18
  } & {
22
19
  [evt: string]: CustomEvent<any>;
@@ -10,8 +10,8 @@ declare const __propDef: {
10
10
  href?: string | undefined;
11
11
  btnClass?: string | undefined;
12
12
  type?: ButtonType | undefined;
13
- color?: "blue" | "red" | "green" | "yellow" | "purple" | "pink" | "dark" | "light" | "cyan" | "teal" | "lime" | "alternative" | "purpleToBlue" | "cyanToBlue" | "greenToBlue" | "purpleToPink" | "pinkToOrange" | "tealToLime" | "redToYellow" | undefined;
14
- shadow?: "blue" | "red" | "green" | "purple" | "pink" | "cyan" | "teal" | "lime" | null | undefined;
13
+ color?: "blue" | "dark" | "light" | "green" | "red" | "yellow" | "purple" | "cyan" | "teal" | "lime" | "pink" | "alternative" | "purpleToBlue" | "cyanToBlue" | "greenToBlue" | "purpleToPink" | "pinkToOrange" | "tealToLime" | "redToYellow" | undefined;
14
+ shadow?: "blue" | "green" | "red" | "purple" | "cyan" | "teal" | "lime" | "pink" | null | undefined;
15
15
  };
16
16
  events: {
17
17
  click: MouseEvent;
@@ -7,7 +7,7 @@ declare const __propDef: {
7
7
  style?: "filled" | "outlined" | "standard" | undefined;
8
8
  type?: InputType | undefined;
9
9
  size?: "default" | "small" | undefined;
10
- color?: "red" | "green" | "base" | undefined;
10
+ color?: "green" | "red" | "base" | undefined;
11
11
  value?: string | undefined;
12
12
  label?: string | undefined;
13
13
  };
@@ -3,7 +3,7 @@ declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
5
  helperClass?: string | undefined;
6
- color?: "gray" | "red" | "green" | "disabled" | undefined;
6
+ color?: "green" | "red" | "gray" | "disabled" | undefined;
7
7
  };
8
8
  events: {
9
9
  [evt: string]: CustomEvent<any>;
@@ -7,7 +7,7 @@ declare const __propDef: {
7
7
  value?: string | undefined;
8
8
  size?: "sm" | "md" | "lg" | undefined;
9
9
  inputClass?: string | undefined;
10
- color?: "red" | "green" | "base" | undefined;
10
+ color?: "green" | "red" | "base" | undefined;
11
11
  };
12
12
  events: {
13
13
  blur: FocusEvent;
@@ -2,7 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
- color?: "gray" | "red" | "green" | "disabled" | undefined;
5
+ color?: "green" | "red" | "gray" | "disabled" | undefined;
6
6
  defaultClass?: string | undefined;
7
7
  show?: boolean | undefined;
8
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.26.25",
3
+ "version": "0.26.26",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {
@@ -2,6 +2,7 @@
2
2
  import { slide } from 'svelte/transition';
3
3
  import { quintOut } from 'svelte/easing';
4
4
  import ChevronDown from '../utils/ChevronDown.svelte';
5
+ import ChevronUp from '../utils/ChevronUp.svelte';
5
6
  export let btnClass = 'flex items-center p-2 w-full text-base font-normal text-gray-900 rounded-lg transition duration-75 group hover:bg-gray-100 dark:text-white dark:hover:bg-gray-700';
6
7
  export let label = '';
7
8
  export let spanClass = 'flex-1 ml-3 text-left whitespace-nowrap';
@@ -21,7 +22,17 @@ const handleDropdown = () => {
21
22
  aria-controls="sidebar-dropdown">
22
23
  <slot name="icon" />
23
24
  <span class={spanClass} sidebar-toggle-item>{label}</span>
24
- <ChevronDown />
25
+ {#if isOpen}
26
+ {#if $$slots.arrowup}
27
+ <slot name="arrowup" />
28
+ {:else}
29
+ <ChevronUp />
30
+ {/if}
31
+ {:else if $$slots.arrowdown}
32
+ <slot name="arrowdown" />
33
+ {:else}
34
+ <ChevronDown />
35
+ {/if}
25
36
  </button>
26
37
  {#if isOpen}
27
38
  <ul
@@ -13,6 +13,8 @@ declare const __propDef: {
13
13
  };
14
14
  slots: {
15
15
  icon: {};
16
+ arrowup: {};
17
+ arrowdown: {};
16
18
  default: {};
17
19
  };
18
20
  };
@@ -7,7 +7,7 @@ declare const __propDef: {
7
7
  hoverable?: boolean | undefined;
8
8
  noborder?: boolean | undefined;
9
9
  shadow?: boolean | undefined;
10
- color?: "default" | "blue" | "red" | "green" | "yellow" | "purple" | "custom" | undefined;
10
+ color?: "default" | "blue" | "green" | "red" | "yellow" | "purple" | "custom" | undefined;
11
11
  };
12
12
  events: {
13
13
  [evt: string]: CustomEvent<any>;
@@ -7,7 +7,7 @@ declare const __propDef: {
7
7
  striped?: boolean | undefined;
8
8
  hoverable?: boolean | undefined;
9
9
  placeholder?: string | undefined;
10
- color?: "default" | "blue" | "red" | "green" | "yellow" | "purple" | "custom" | undefined;
10
+ color?: "default" | "blue" | "green" | "red" | "yellow" | "purple" | "custom" | undefined;
11
11
  };
12
12
  events: {
13
13
  [evt: string]: CustomEvent<any>;
@@ -3,7 +3,7 @@ declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
5
  color?: string | undefined;
6
- style?: "dark" | "custom" | "light" | "auto" | undefined;
6
+ style?: "dark" | "light" | "custom" | "auto" | undefined;
7
7
  tipClass?: string | undefined;
8
8
  };
9
9
  events: {
@@ -2,7 +2,7 @@ import { SvelteComponentTyped } from "svelte";
2
2
  declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
- tag?: "ul" | "dl" | "ol" | undefined;
5
+ tag?: "dl" | "ol" | "ul" | undefined;
6
6
  list?: "none" | "disc" | "decimal" | undefined;
7
7
  position?: "inside" | "outside" | undefined;
8
8
  color?: string | undefined;
@@ -73,22 +73,21 @@ const borderColors = {
73
73
  };
74
74
  // have a custom transition function that returns the desired transition
75
75
  let transitionFunc;
76
- // $: transitionFunc = (node: Element) => (transition ? transition(node, params) : noop);
77
- $: transitionFunc = transition ?? noop;
76
+ $: transitionFunc = transition ?? (() => ({}));
78
77
  let divClass;
79
78
  $: divClass = classNames(bgColors[color], textColors[color], rounded && 'rounded-lg ', border && 'border', borderColors[color], shadow && 'shadow-md', $$props.class);
80
79
  </script>
81
80
 
82
81
  <svelte:element
83
- this={tag}
84
- use:use={options}
85
- bind:this={node}
86
- transition:transitionFunc={params}
87
- {...$$restProps}
88
- class={divClass}
89
- on:mouseenter
90
- on:mouseleave
91
- on:focusin
92
- on:focusout>
93
- <slot />
82
+ this={tag}
83
+ use:use={options}
84
+ bind:this={node}
85
+ transition:transitionFunc={params}
86
+ {...$$restProps}
87
+ class={divClass}
88
+ on:mouseenter
89
+ on:mouseleave
90
+ on:focusin
91
+ on:focusout>
92
+ <slot />
94
93
  </svelte:element>
@@ -4,12 +4,12 @@ import type { TransitionConfig } from 'svelte/transition';
4
4
  declare const __propDef: {
5
5
  props: {
6
6
  [x: string]: any;
7
- tag?: "div" | "a" | "nav" | "ul" | undefined;
7
+ tag?: string | undefined;
8
8
  color?: string | undefined;
9
9
  rounded?: boolean | undefined;
10
10
  border?: boolean | undefined;
11
11
  shadow?: boolean | undefined;
12
- transition?: ((node: Element, params: object) => TransitionConfig) | undefined;
12
+ transition?: ((node: HTMLElement, params: any) => TransitionConfig) | undefined;
13
13
  params?: object | undefined;
14
14
  node?: HTMLElement | undefined;
15
15
  use?: Action<HTMLElement, any, Record<never, any>> | undefined;