flowbite-svelte 0.25.16 → 0.25.17
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 +12 -0
- package/accordions/AccordionItem.svelte +41 -22
- package/accordions/AccordionItem.svelte.d.ts +3 -4
- package/index.d.ts +0 -1
- package/index.js +0 -1
- package/package.json +1 -2
- package/utils/Popper.svelte +1 -0
- package/accordions/AccordionFlush.svelte +0 -47
- package/accordions/AccordionFlush.svelte.d.ts +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,18 @@
|
|
|
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.25.17](https://github.com/themesberg/flowbite-svelte/compare/v0.25.16...v0.25.17) (2022-08-27)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* combine Accordionflush and AccordionItem ([e53fa64](https://github.com/themesberg/flowbite-svelte/commit/e53fa6421ca747ed46d6432b67715b3eedf4cbba))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* textarea docs ([133b933](https://github.com/themesberg/flowbite-svelte/commit/133b9334841ac13d82c3a86bc24b3375de0972ff))
|
|
16
|
+
|
|
5
17
|
### [0.25.16](https://github.com/themesberg/flowbite-svelte/compare/v0.25.15...v0.25.16) (2022-08-25)
|
|
6
18
|
|
|
7
19
|
|
|
@@ -1,34 +1,25 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
2
|
import { slide } from 'svelte/transition';
|
|
3
|
-
|
|
4
|
-
import { ChevronDown, ChevronUp } from 'svelte-heros';
|
|
3
|
+
export let flush = false;
|
|
5
4
|
export let id = '';
|
|
6
|
-
export let slotClass = '
|
|
5
|
+
export let slotClass = 'border-gray-200 dark:border-gray-700';
|
|
6
|
+
let classSlot = classNames(slotClass, flush ? 'py-5 border-b' : 'p-5 border border-t-0');
|
|
7
7
|
export let isOpen = false;
|
|
8
8
|
export let color = false;
|
|
9
|
-
export let
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
export let
|
|
14
|
-
export let iconClass = 'text-gray-500 sm:w-6 sm:h-6 dark:text-gray-300';
|
|
15
|
-
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';
|
|
16
|
-
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';
|
|
17
|
-
$: btnClass;
|
|
18
|
-
onMount(() => {
|
|
19
|
-
if (isOpen) {
|
|
20
|
-
isOpen = true;
|
|
21
|
-
}
|
|
22
|
-
});
|
|
9
|
+
export let btnClass = 'flex items-center justify-between w-full font-medium text-left text-gray-500 border-gray-200 dark:border-gray-700 dark:text-gray-400';
|
|
10
|
+
let classBtn = classNames(btnClass, flush
|
|
11
|
+
? 'py-5 border-b'
|
|
12
|
+
: 'focus:ring-4 focus:ring-gray-200 dark:focus:ring-gray-800 p-5 border hover:bg-gray-100 dark:hover:bg-gray-800');
|
|
13
|
+
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';
|
|
23
14
|
const handleToggle = (id) => {
|
|
24
15
|
isOpen = !isOpen;
|
|
25
16
|
};
|
|
26
17
|
let buttonClass;
|
|
27
18
|
$: if (color && isOpen) {
|
|
28
|
-
buttonClass =
|
|
19
|
+
buttonClass = classBtn + colorClass;
|
|
29
20
|
}
|
|
30
21
|
else {
|
|
31
|
-
buttonClass =
|
|
22
|
+
buttonClass = classBtn;
|
|
32
23
|
}
|
|
33
24
|
</script>
|
|
34
25
|
|
|
@@ -42,15 +33,43 @@ else {
|
|
|
42
33
|
>
|
|
43
34
|
<slot name="header" />
|
|
44
35
|
{#if isOpen}
|
|
45
|
-
|
|
36
|
+
{#if $$slots.arrowup}
|
|
37
|
+
<slot name="arrowup" />
|
|
38
|
+
{:else}
|
|
39
|
+
<svg
|
|
40
|
+
data-accordion-icon
|
|
41
|
+
class="w-6 h-6 rotate-180 shrink-0"
|
|
42
|
+
fill="currentColor"
|
|
43
|
+
viewBox="0 0 20 20"
|
|
44
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
45
|
+
><path
|
|
46
|
+
fill-rule="evenodd"
|
|
47
|
+
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
|
|
48
|
+
clip-rule="evenodd"
|
|
49
|
+
/></svg
|
|
50
|
+
>
|
|
51
|
+
{/if}
|
|
52
|
+
{:else if $$slots.arrowdown}
|
|
53
|
+
<slot name="arrowdown" />
|
|
46
54
|
{:else}
|
|
47
|
-
<
|
|
55
|
+
<svg
|
|
56
|
+
data-accordion-icon
|
|
57
|
+
class="w-6 h-6 shrink-0"
|
|
58
|
+
fill="currentColor"
|
|
59
|
+
viewBox="0 0 20 20"
|
|
60
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
61
|
+
><path
|
|
62
|
+
fill-rule="evenodd"
|
|
63
|
+
d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z"
|
|
64
|
+
clip-rule="evenodd"
|
|
65
|
+
/></svg
|
|
66
|
+
>
|
|
48
67
|
{/if}
|
|
49
68
|
</button>
|
|
50
69
|
</h2>
|
|
51
70
|
{#if isOpen}
|
|
52
71
|
<div transition:slide={{ duration: 500 }}>
|
|
53
|
-
<div class={
|
|
72
|
+
<div class={classSlot}>
|
|
54
73
|
<slot name="body" />
|
|
55
74
|
</div>
|
|
56
75
|
</div>
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { AccordionIconType } from '../types';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: {
|
|
5
4
|
[x: string]: any;
|
|
5
|
+
flush?: boolean;
|
|
6
6
|
id?: string;
|
|
7
7
|
slotClass?: string;
|
|
8
8
|
isOpen?: boolean;
|
|
9
9
|
color?: boolean;
|
|
10
|
-
icons?: AccordionIconType;
|
|
11
|
-
iconSize?: number;
|
|
12
|
-
iconClass?: string;
|
|
13
10
|
btnClass?: string;
|
|
14
11
|
colorClass?: string;
|
|
15
12
|
};
|
|
@@ -18,6 +15,8 @@ declare const __propDef: {
|
|
|
18
15
|
};
|
|
19
16
|
slots: {
|
|
20
17
|
header: {};
|
|
18
|
+
arrowup: {};
|
|
19
|
+
arrowdown: {};
|
|
21
20
|
body: {};
|
|
22
21
|
};
|
|
23
22
|
};
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { default as AccordionItem } from './accordions/AccordionItem.svelte';
|
|
2
|
-
export { default as AccordionFlush } from './accordions/AccordionFlush.svelte';
|
|
3
2
|
export { default as Alert } from './alerts/Alert.svelte';
|
|
4
3
|
export { default as Avatar } from './avatar/Avatar.svelte';
|
|
5
4
|
export { default as Badge } from './badges/Badge.svelte';
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.17",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -100,7 +100,6 @@
|
|
|
100
100
|
"exports": {
|
|
101
101
|
"./package.json": "./package.json",
|
|
102
102
|
"./.DS_Store": "./.DS_Store",
|
|
103
|
-
"./accordions/AccordionFlush.svelte": "./accordions/AccordionFlush.svelte",
|
|
104
103
|
"./accordions/AccordionItem.svelte": "./accordions/AccordionItem.svelte",
|
|
105
104
|
"./alerts/Alert.svelte": "./alerts/Alert.svelte",
|
|
106
105
|
"./avatar/Avatar.svelte": "./avatar/Avatar.svelte",
|
package/utils/Popper.svelte
CHANGED
|
@@ -77,6 +77,7 @@ $: divClass = classNames('z-10', animation && `transition-opacity ${animation}`,
|
|
|
77
77
|
on:focusout={activeContent ? hideHandler : undefined}
|
|
78
78
|
on:mouseenter={activeContent && !clickable ? showHandler : undefined}
|
|
79
79
|
on:mouseleave={activeContent && !clickable ? hideHandler : undefined}
|
|
80
|
+
style="position: absolute;"
|
|
80
81
|
>
|
|
81
82
|
<slot />
|
|
82
83
|
{#if arrow}<div data-popper-arrow />{/if}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
<script>import classNames from 'classnames';
|
|
2
|
-
import { slide } from 'svelte/transition';
|
|
3
|
-
import { onMount } from 'svelte';
|
|
4
|
-
import { ChevronDown, ChevronUp } from 'svelte-heros';
|
|
5
|
-
export let id = '';
|
|
6
|
-
export let btnClass = 'flex justify-between items-center py-5 w-full font-medium text-left text-gray-500 border-b border-gray-200 dark:border-gray-700 dark:text-gray-400';
|
|
7
|
-
export let slotClass = 'py-5 border-b border-gray-200 dark:border-gray-700';
|
|
8
|
-
export let iconSize = 24;
|
|
9
|
-
export let iconClass = 'text-gray-500 sm:w-6 sm:h-6 dark:text-gray-300';
|
|
10
|
-
export let isOpen = false;
|
|
11
|
-
export let icons = {
|
|
12
|
-
up: ChevronUp,
|
|
13
|
-
down: ChevronDown
|
|
14
|
-
};
|
|
15
|
-
onMount(() => {
|
|
16
|
-
if (isOpen) {
|
|
17
|
-
isOpen = true;
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
const handleToggle = (id) => {
|
|
21
|
-
isOpen = !isOpen;
|
|
22
|
-
};
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<h2 aria-expanded={isOpen}>
|
|
26
|
-
<button
|
|
27
|
-
on:click={() => handleToggle(id)}
|
|
28
|
-
type="button"
|
|
29
|
-
class:rounded-t-xl={id === '1'}
|
|
30
|
-
class:border-t-0={id !== '1'}
|
|
31
|
-
class={classNames(btnClass, $$props.class)}
|
|
32
|
-
>
|
|
33
|
-
<slot name="header" />
|
|
34
|
-
{#if isOpen}
|
|
35
|
-
<svelte:component this={icons.up} size={iconSize} class="mr-2 {iconClass}" />
|
|
36
|
-
{:else}
|
|
37
|
-
<svelte:component this={icons.down} size={iconSize} class="mr-2 {iconClass}" />
|
|
38
|
-
{/if}
|
|
39
|
-
</button>
|
|
40
|
-
</h2>
|
|
41
|
-
{#if isOpen}
|
|
42
|
-
<div transition:slide={{ duration: 500 }}>
|
|
43
|
-
<div class={slotClass}>
|
|
44
|
-
<slot name="body" />
|
|
45
|
-
</div>
|
|
46
|
-
</div>
|
|
47
|
-
{/if}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { AccordionIconType } from '../types';
|
|
3
|
-
declare const __propDef: {
|
|
4
|
-
props: {
|
|
5
|
-
[x: string]: any;
|
|
6
|
-
id?: string;
|
|
7
|
-
btnClass?: string;
|
|
8
|
-
slotClass?: string;
|
|
9
|
-
iconSize?: number;
|
|
10
|
-
iconClass?: string;
|
|
11
|
-
isOpen?: boolean;
|
|
12
|
-
icons?: AccordionIconType;
|
|
13
|
-
};
|
|
14
|
-
events: {
|
|
15
|
-
[evt: string]: CustomEvent<any>;
|
|
16
|
-
};
|
|
17
|
-
slots: {
|
|
18
|
-
header: {};
|
|
19
|
-
body: {};
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
export declare type AccordionFlushProps = typeof __propDef.props;
|
|
23
|
-
export declare type AccordionFlushEvents = typeof __propDef.events;
|
|
24
|
-
export declare type AccordionFlushSlots = typeof __propDef.slots;
|
|
25
|
-
export default class AccordionFlush extends SvelteComponentTyped<AccordionFlushProps, AccordionFlushEvents, AccordionFlushSlots> {
|
|
26
|
-
}
|
|
27
|
-
export {};
|