flowbite-svelte 0.15.36 → 0.15.37

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.15.37](https://github.com/themesberg/flowbite-svelte/compare/v0.15.36...v0.15.37) (2022-05-18)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * add buttonClass to AccordionItem ([8387244](https://github.com/themesberg/flowbite-svelte/commit/83872440ebb872843a0f016f7fb576d156295b96))
11
+
5
12
  ### [0.15.36](https://github.com/themesberg/flowbite-svelte/compare/v0.15.35...v0.15.36) (2022-05-17)
6
13
 
7
14
 
@@ -2,7 +2,6 @@
2
2
  import { onMount } from 'svelte';
3
3
  import { ChevronDownSolid, ChevronUpSolid } from 'svelte-heros';
4
4
  export let id = '';
5
- export let btnClass = 'flex items-center focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 justify-between p-5 w-full font-medium border border-gray-200 dark:border-gray-700 text-left text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800';
6
5
  export let slotClass = 'p-5 border border-t-0 border-gray-200 dark:border-gray-700';
7
6
  export let isOpen = false;
8
7
  export let color = false;
@@ -15,21 +14,25 @@ onMount(() => {
15
14
  isOpen = true;
16
15
  }
17
16
  });
17
+ export let btnClass = 'flex items-center focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 justify-between p-5 w-full font-medium border border-gray-200 dark:border-gray-700 text-left text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800';
18
+ $: btnClass;
19
+ export let colorClass = 'focus:ring-blue-200 dark:focus:ring-blue-800 hover:bg-blue-100 text-blue-500 bg-blue-200 text-blue-700';
18
20
  const handleToggle = (id) => {
19
21
  isOpen = !isOpen;
20
- if (color && isOpen) {
21
- btnClass = 'flex items-center focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 justify-between p-5 w-full font-medium border border-gray-200 dark:border-gray-700 text-left text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 focus:ring-blue-200 dark:focus:ring-blue-800 hover:bg-blue-100 text-blue-500 bg-blue-200 text-blue-700';
22
- }
23
- else {
24
- btnClass = 'flex items-center focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 justify-between p-5 w-full font-medium border border-gray-200 dark:border-gray-700 text-left text-gray-500 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800';
25
- }
26
22
  };
23
+ let buttonClass;
24
+ $: if (color && isOpen) {
25
+ buttonClass = btnClass + colorClass;
26
+ }
27
+ else {
28
+ buttonClass = btnClass;
29
+ }
27
30
  export let iconSize = 24;
28
31
  export let iconClass = 'text-gray-500 sm:w-6 sm:h-6 dark:text-gray-300';
29
32
  </script>
30
33
 
31
34
  <h2 aria-expanded={isOpen}>
32
- <button on:click={() => handleToggle(id)} type="button" class:rounded-t-xl={id === '1'} class:border-t-0={id !== '1'} class="{btnClass} {$$props.class ? $$props.class : ''}">
35
+ <button on:click={() => handleToggle(id)} type="button" class:rounded-t-xl={id === '1'} class:border-t-0={id !== '1'} class="{buttonClass} {$$props.class ? $$props.class : ''}">
33
36
  <slot name="header" />
34
37
  {#if isOpen}
35
38
  <svelte:component this={icons.up} size={iconSize} class="mr-2 {iconClass}" />
@@ -4,11 +4,12 @@ declare const __propDef: {
4
4
  props: {
5
5
  [x: string]: any;
6
6
  id?: string;
7
- btnClass?: string;
8
7
  slotClass?: string;
9
8
  isOpen?: boolean;
10
9
  color?: boolean;
11
10
  icons?: AccordionIconType;
11
+ btnClass?: string;
12
+ colorClass?: string;
12
13
  iconSize?: number;
13
14
  iconClass?: string;
14
15
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flowbite-svelte",
3
- "version": "0.15.36",
3
+ "version": "0.15.37",
4
4
  "description": "Flowbite components for Svelte",
5
5
  "main": "index.js",
6
6
  "author": {