flowbite-svelte 0.25.21 → 0.25.24
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 +30 -0
- package/alerts/Alert.svelte +3 -5
- package/alerts/Alert.svelte.d.ts +2 -4
- package/avatar/Avatar.svelte +4 -4
- package/dropdowns/Dropdown.svelte +25 -18
- package/dropdowns/Dropdown.svelte.d.ts +2 -3
- package/dropdowns/DropdownItem.svelte +1 -0
- package/index.d.ts +4 -0
- package/index.js +4 -0
- package/navbar/Menu.svelte +36 -0
- package/navbar/Menu.svelte.d.ts +22 -0
- package/navbar/NavHamburger.svelte +2 -3
- package/package.json +7 -1
- package/popover/Popover.svelte +3 -3
- package/popover/Popover.svelte.d.ts +1 -0
- package/ratings/Rating.svelte +1 -1
- package/ratings/RatingComment.svelte +4 -6
- package/ratings/Star.svelte +36 -0
- package/ratings/Star.svelte.d.ts +22 -0
- package/sidebars/SidebarDropdownWrapper.svelte +4 -7
- package/timelines/Timeline.svelte +13 -2
- package/timelines/Timeline.svelte.d.ts +2 -1
- package/timelines/TimelineItem.svelte +123 -35
- package/timelines/TimelineItem.svelte.d.ts +8 -3
- package/timelines/TimelineItemHorizontal.svelte +52 -21
- package/timelines/TimelineItemHorizontal.svelte.d.ts +6 -2
- package/timelines/TimelineItemVertical.svelte +30 -25
- package/timelines/TimelineItemVertical.svelte.d.ts +6 -3
- package/tooltips/Tooltip.svelte +12 -2
- package/tooltips/Tooltip.svelte.d.ts +2 -3
- package/utils/ChevronDown.svelte +36 -0
- package/utils/ChevronDown.svelte.d.ts +22 -0
- package/utils/ChevronLeft.svelte +36 -0
- package/utils/ChevronLeft.svelte.d.ts +22 -0
- package/utils/ChevronRight.svelte +36 -0
- package/utils/ChevronRight.svelte.d.ts +22 -0
- package/utils/ChevronUp.svelte +36 -0
- package/utils/ChevronUp.svelte.d.ts +22 -0
- package/utils/Popper.svelte +94 -66
- package/utils/Popper.svelte.d.ts +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,36 @@
|
|
|
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.24](https://github.com/themesberg/flowbite-svelte/compare/v0.25.23...v0.25.24) (2022-08-28)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* popper reloaded ([a4b851e](https://github.com/themesberg/flowbite-svelte/commit/a4b851e2409356a90fd6aaae62db327b505bdcb2))
|
|
11
|
+
* popper reloaded part 2 ([2482870](https://github.com/themesberg/flowbite-svelte/commit/2482870842386c8c1e5824869ce7822b8682e8a0))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* tab page timeline ([ab598a5](https://github.com/themesberg/flowbite-svelte/commit/ab598a59a3d373f14740a42bbaec3cb276eed34b))
|
|
17
|
+
|
|
18
|
+
### [0.25.23](https://github.com/themesberg/flowbite-svelte/compare/v0.25.22...v0.25.23) (2022-08-28)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* BREAKING CHANGE for timeline components ([8b30105](https://github.com/themesberg/flowbite-svelte/commit/8b30105060d150d632ea6fbfac8e1f5639f82546))
|
|
24
|
+
|
|
25
|
+
### [0.25.22](https://github.com/themesberg/flowbite-svelte/compare/v0.25.21...v0.25.22) (2022-08-28)
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
* create icon slot for Alert so that users can add svg or svelte component ([45244ec](https://github.com/themesberg/flowbite-svelte/commit/45244ec05f99298d150751209980dce519873163))
|
|
31
|
+
* remove heros from: ([57f6928](https://github.com/themesberg/flowbite-svelte/commit/57f69282190f5d33d7ac17c6adeab36b89184f47))
|
|
32
|
+
* update Alert color type ([fd819fb](https://github.com/themesberg/flowbite-svelte/commit/fd819fb59d2d01f900ad76449afabfa22de6d5b1))
|
|
33
|
+
* update Timeline components ([4b47d6b](https://github.com/themesberg/flowbite-svelte/commit/4b47d6b5d09abad3b2d8fc29c2b38287726c44d7))
|
|
34
|
+
|
|
5
35
|
### [0.25.21](https://github.com/themesberg/flowbite-svelte/compare/v0.25.20...v0.25.21) (2022-08-27)
|
|
6
36
|
|
|
7
37
|
|
package/alerts/Alert.svelte
CHANGED
|
@@ -5,7 +5,6 @@ import CloseButton from '../utils/CloseButton.svelte';
|
|
|
5
5
|
const dispatch = createEventDispatcher();
|
|
6
6
|
setContext('background', true);
|
|
7
7
|
export let color = 'blue';
|
|
8
|
-
export let icon = null;
|
|
9
8
|
export let dismissable = false;
|
|
10
9
|
export let rounded = true;
|
|
11
10
|
export let accent = false;
|
|
@@ -61,8 +60,8 @@ $: divClass = classNames('p-4 text-sm', bgClasses[color] ?? bgClasses.blue, acce
|
|
|
61
60
|
|
|
62
61
|
<div id={$$props.id} class:hidden class={divClass} role="alert">
|
|
63
62
|
<div class="flex items-center whitespace-pre-wrap">
|
|
64
|
-
{#if icon}
|
|
65
|
-
<
|
|
63
|
+
{#if $$slots.icon}
|
|
64
|
+
<slot name="icon" />
|
|
66
65
|
{/if}
|
|
67
66
|
|
|
68
67
|
<slot />
|
|
@@ -80,8 +79,7 @@ $: divClass = classNames('p-4 text-sm', bgClasses[color] ?? bgClasses.blue, acce
|
|
|
80
79
|
on:focus
|
|
81
80
|
on:blur
|
|
82
81
|
on:mouseenter
|
|
83
|
-
on:mouseleave
|
|
84
|
-
/>
|
|
82
|
+
on:mouseleave />
|
|
85
83
|
{/if}
|
|
86
84
|
</div>
|
|
87
85
|
<slot name="extra" />
|
package/alerts/Alert.svelte.d.ts
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { SvelteComponent } from 'svelte';
|
|
3
|
-
import type { Colors } from '../types';
|
|
4
2
|
declare const __propDef: {
|
|
5
3
|
props: {
|
|
6
4
|
[x: string]: any;
|
|
7
|
-
color?:
|
|
8
|
-
icon?: typeof SvelteComponent | null;
|
|
5
|
+
color?: 'gray' | 'blue' | 'red' | 'green' | 'yellow' | 'indigo' | 'purple' | 'pink' | 'dark' | 'custom';
|
|
9
6
|
dismissable?: boolean;
|
|
10
7
|
rounded?: boolean;
|
|
11
8
|
accent?: boolean;
|
|
@@ -27,6 +24,7 @@ declare const __propDef: {
|
|
|
27
24
|
[evt: string]: CustomEvent<any>;
|
|
28
25
|
};
|
|
29
26
|
slots: {
|
|
27
|
+
icon: {};
|
|
30
28
|
default: {};
|
|
31
29
|
extra: {};
|
|
32
30
|
};
|
package/avatar/Avatar.svelte
CHANGED
|
@@ -22,17 +22,17 @@ $: avatarClass = classNames(rounded ? 'rounded' : 'rounded-full', border && 'p-1
|
|
|
22
22
|
|
|
23
23
|
<Dot show={$$props.dot} {rounded} {...dot} {size} class={sizes[size]}>
|
|
24
24
|
{#if src}
|
|
25
|
-
<img
|
|
25
|
+
<img {alt} {src} {...$$restProps} class={avatarClass} />
|
|
26
26
|
{:else if $$slots.default}
|
|
27
27
|
<svelte:element
|
|
28
28
|
this={href ? 'a' : 'div'}
|
|
29
|
-
class="flex justify-center items-center text-xs font-medium {avatarClass}"
|
|
30
29
|
{href}
|
|
31
|
-
|
|
30
|
+
{...$$restProps}
|
|
31
|
+
class="flex justify-center items-center text-xs font-medium {avatarClass}">
|
|
32
32
|
<slot />
|
|
33
33
|
</svelte:element>
|
|
34
34
|
{:else}
|
|
35
|
-
<svelte:element this={href ? 'a' : 'div'} class={avatarClass}>
|
|
35
|
+
<svelte:element this={href ? 'a' : 'div'} {...$$restProps} class={avatarClass}>
|
|
36
36
|
<AvatarPlaceholder {rounded} />
|
|
37
37
|
</svelte:element>
|
|
38
38
|
{/if}
|
|
@@ -2,13 +2,19 @@
|
|
|
2
2
|
import Button from '../buttons/Button.svelte';
|
|
3
3
|
import Popper from '../utils/Popper.svelte';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
|
-
import
|
|
5
|
+
import ChevronUp from '../utils/ChevronUp.svelte';
|
|
6
|
+
import ChevronRight from '../utils/ChevronRight.svelte';
|
|
7
|
+
import ChevronDown from '../utils/ChevronDown.svelte';
|
|
8
|
+
import ChevronLeft from '../utils/ChevronLeft.svelte';
|
|
9
|
+
import generateId from '../utils/generateId';
|
|
6
10
|
export let label = '';
|
|
7
11
|
export let inline = false;
|
|
8
12
|
export let arrowIcon = true;
|
|
9
13
|
export let labelClass = 'flex items-center justify-between w-full py-2 pl-3 pr-4 font-medium 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 md:w-auto dark:text-gray-400 dark:hover:text-white dark:focus:text-white dark:border-gray-700 dark:hover:bg-gray-700 md:dark:hover:bg-transparent';
|
|
10
14
|
export let placement = 'bottom';
|
|
11
15
|
export let open = false;
|
|
16
|
+
export let triggeredBy = undefined;
|
|
17
|
+
let id = generateId();
|
|
12
18
|
setContext('background', true);
|
|
13
19
|
const icons = {
|
|
14
20
|
top: ChevronUp,
|
|
@@ -22,39 +28,40 @@ let popoverClass;
|
|
|
22
28
|
$: popoverClass = classNames('rounded-lg shadow-sm', 'bg-white dark:bg-gray-800', 'text-gray-500 dark:text-gray-400', 'border border-gray-200 dark:border-gray-700', 'outline-none', $$props.class);
|
|
23
29
|
</script>
|
|
24
30
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
arrow={false}
|
|
28
|
-
{placement}
|
|
29
|
-
{...$$restProps}
|
|
30
|
-
class={popoverClass}
|
|
31
|
-
trigger="click"
|
|
32
|
-
on:show
|
|
33
|
-
bind:open
|
|
34
|
-
>
|
|
35
|
-
<slot name="trigger" slot="trigger">
|
|
31
|
+
{#if label}
|
|
32
|
+
<slot name="trigger">
|
|
36
33
|
{#if inline}
|
|
37
|
-
<button class={labelClass} class:flex-row-reverse={icon == ChevronLeft}>
|
|
34
|
+
<button {id} class={labelClass} class:flex-row-reverse={icon == ChevronLeft}>
|
|
38
35
|
<slot name="label">{label}</slot>
|
|
39
36
|
{#if arrowIcon}
|
|
40
37
|
<svelte:component
|
|
41
38
|
this={icon ?? ChevronDown}
|
|
42
|
-
class={classNames('h-4 w-4', icon == ChevronLeft ? 'mr-2' : 'ml-2')}
|
|
43
|
-
/>
|
|
39
|
+
class={classNames('h-4 w-4', icon == ChevronLeft ? 'mr-2' : 'ml-2')} />
|
|
44
40
|
{/if}
|
|
45
41
|
</button>
|
|
46
42
|
{:else}
|
|
47
|
-
<Button {...$$restProps} class={icon == ChevronLeft && 'flex-row-reverse'}>
|
|
43
|
+
<Button {id} {...$$restProps} class={icon == ChevronLeft && 'flex-row-reverse'}>
|
|
48
44
|
<slot name="label">{label}</slot>
|
|
49
45
|
{#if arrowIcon}
|
|
50
46
|
<svelte:component
|
|
51
47
|
this={icon ?? ChevronDown}
|
|
52
|
-
class={classNames('h-4 w-4', icon == ChevronLeft ? 'mr-2' : 'ml-2')}
|
|
53
|
-
/>
|
|
48
|
+
class={classNames('h-4 w-4', icon == ChevronLeft ? 'mr-2' : 'ml-2')} />
|
|
54
49
|
{/if}
|
|
55
50
|
</Button>
|
|
56
51
|
{/if}
|
|
57
52
|
</slot>
|
|
53
|
+
{/if}
|
|
54
|
+
|
|
55
|
+
<Popper
|
|
56
|
+
activeContent={true}
|
|
57
|
+
arrow={false}
|
|
58
|
+
{placement}
|
|
59
|
+
{...$$restProps}
|
|
60
|
+
class={popoverClass}
|
|
61
|
+
trigger="click"
|
|
62
|
+
on:show
|
|
63
|
+
bind:open
|
|
64
|
+
triggeredBy={triggeredBy ?? '#' + id}>
|
|
58
65
|
<slot name="content">
|
|
59
66
|
<ul class="py-1">
|
|
60
67
|
<slot />
|
|
@@ -9,6 +9,7 @@ declare const __propDef: {
|
|
|
9
9
|
labelClass?: string;
|
|
10
10
|
placement?: 'auto' | Placement;
|
|
11
11
|
open?: boolean;
|
|
12
|
+
triggeredBy?: string;
|
|
12
13
|
};
|
|
13
14
|
events: {
|
|
14
15
|
show: CustomEvent<any>;
|
|
@@ -16,9 +17,7 @@ declare const __propDef: {
|
|
|
16
17
|
[evt: string]: CustomEvent<any>;
|
|
17
18
|
};
|
|
18
19
|
slots: {
|
|
19
|
-
trigger: {
|
|
20
|
-
slot: string;
|
|
21
|
-
};
|
|
20
|
+
trigger: {};
|
|
22
21
|
label: {};
|
|
23
22
|
content: {};
|
|
24
23
|
default: {};
|
package/index.d.ts
CHANGED
|
@@ -124,3 +124,7 @@ export { default as Secondary } from './typography/Secondary.svelte';
|
|
|
124
124
|
export { default as TextGradient } from './typography/TextGradient.svelte';
|
|
125
125
|
export { default as Underline } from './typography/Underline.svelte';
|
|
126
126
|
export { default as CloseButton } from './utils/CloseButton.svelte';
|
|
127
|
+
export { default as ChevronDown } from './utils/ChevronDown.svelte';
|
|
128
|
+
export { default as ChevronLeft } from './utils/ChevronLeft.svelte';
|
|
129
|
+
export { default as ChevronRight } from './utils/ChevronRight.svelte';
|
|
130
|
+
export { default as ChevronUp } from './utils/ChevronUp.svelte';
|
package/index.js
CHANGED
|
@@ -158,3 +158,7 @@ export { default as TextGradient } from './typography/TextGradient.svelte';
|
|
|
158
158
|
export { default as Underline } from './typography/Underline.svelte';
|
|
159
159
|
// utils
|
|
160
160
|
export { default as CloseButton } from './utils/CloseButton.svelte';
|
|
161
|
+
export { default as ChevronDown } from './utils/ChevronDown.svelte';
|
|
162
|
+
export { default as ChevronLeft } from './utils/ChevronLeft.svelte';
|
|
163
|
+
export { default as ChevronRight } from './utils/ChevronRight.svelte';
|
|
164
|
+
export { default as ChevronUp } from './utils/ChevronUp.svelte';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script>export let size = '24';
|
|
2
|
+
export let color = 'currentColor';
|
|
3
|
+
export let variation = 'outline';
|
|
4
|
+
let viewBox;
|
|
5
|
+
let svgpath;
|
|
6
|
+
let svgoutline = `<path d="M3.75 6.75H20.25M3.75 12H20.25M3.75 17.25H20.25" stroke="${color}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> `;
|
|
7
|
+
let svgsolid = `<path fill-rule="evenodd" clip-rule="evenodd" d="M3 6.75C3 6.33579 3.33579 6 3.75 6H20.25C20.6642 6 21 6.33579 21 6.75C21 7.16421 20.6642 7.5 20.25 7.5H3.75C3.33579 7.5 3 7.16421 3 6.75ZM3 12C3 11.5858 3.33579 11.25 3.75 11.25H20.25C20.6642 11.25 21 11.5858 21 12C21 12.4142 20.6642 12.75 20.25 12.75H3.75C3.33579 12.75 3 12.4142 3 12ZM3 17.25C3 16.8358 3.33579 16.5 3.75 16.5H20.25C20.6642 16.5 21 16.8358 21 17.25C21 17.6642 20.6642 18 20.25 18H3.75C3.33579 18 3 17.6642 3 17.25Z" fill="${color}"/> `;
|
|
8
|
+
$: switch (variation) {
|
|
9
|
+
case 'outline':
|
|
10
|
+
svgpath = svgoutline;
|
|
11
|
+
viewBox = '0 0 24 24';
|
|
12
|
+
break;
|
|
13
|
+
case 'solid':
|
|
14
|
+
svgpath = svgsolid;
|
|
15
|
+
viewBox = '0 0 24 24';
|
|
16
|
+
break;
|
|
17
|
+
default:
|
|
18
|
+
svgpath = svgoutline;
|
|
19
|
+
viewBox = '0 0 24 24';
|
|
20
|
+
}
|
|
21
|
+
export let ariaLabel = 'bars 3';
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<svg
|
|
25
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
26
|
+
width={size}
|
|
27
|
+
height={size}
|
|
28
|
+
class={$$props.class}
|
|
29
|
+
{...$$restProps}
|
|
30
|
+
aria-label={ariaLabel}
|
|
31
|
+
fill="none"
|
|
32
|
+
{viewBox}
|
|
33
|
+
stroke-width="2"
|
|
34
|
+
on:click>
|
|
35
|
+
{@html svgpath}
|
|
36
|
+
</svg>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
size?: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
variation?: 'solid' | 'outline';
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
click: MouseEvent;
|
|
12
|
+
} & {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export declare type MenuProps = typeof __propDef.props;
|
|
18
|
+
export declare type MenuEvents = typeof __propDef.events;
|
|
19
|
+
export declare type MenuSlots = typeof __propDef.slots;
|
|
20
|
+
export default class Menu extends SvelteComponentTyped<MenuProps, MenuEvents, MenuSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
import
|
|
2
|
+
import Menu from './Menu.svelte';
|
|
3
3
|
export let btnClass = 'ml-3 inline-flex items-center rounded-lg p-2 text-sm text-gray-500 hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600 md:hidden';
|
|
4
4
|
</script>
|
|
5
5
|
|
|
@@ -7,8 +7,7 @@ export let btnClass = 'ml-3 inline-flex items-center rounded-lg p-2 text-sm text
|
|
|
7
7
|
{...$$restProps}
|
|
8
8
|
class={classNames(btnClass, $$props.class)}
|
|
9
9
|
data-testid="navbar-toggle"
|
|
10
|
-
on:click
|
|
11
|
-
>
|
|
10
|
+
on:click>
|
|
12
11
|
<span class="sr-only">Open main menu</span>
|
|
13
12
|
<Menu class="h-6 w-6 shrink-0" />
|
|
14
13
|
</button>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.24",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -157,6 +157,7 @@
|
|
|
157
157
|
"./list-group/ListItem.svelte": "./list-group/ListItem.svelte",
|
|
158
158
|
"./megamenu/MegaMenu.svelte": "./megamenu/MegaMenu.svelte",
|
|
159
159
|
"./modals/Modal.svelte": "./modals/Modal.svelte",
|
|
160
|
+
"./navbar/Menu.svelte": "./navbar/Menu.svelte",
|
|
160
161
|
"./navbar/NavBrand.svelte": "./navbar/NavBrand.svelte",
|
|
161
162
|
"./navbar/NavDropdown.svelte": "./navbar/NavDropdown.svelte",
|
|
162
163
|
"./navbar/NavHamburger.svelte": "./navbar/NavHamburger.svelte",
|
|
@@ -174,6 +175,7 @@
|
|
|
174
175
|
"./ratings/RatingComment.svelte": "./ratings/RatingComment.svelte",
|
|
175
176
|
"./ratings/Review.svelte": "./ratings/Review.svelte",
|
|
176
177
|
"./ratings/ScoreRating.svelte": "./ratings/ScoreRating.svelte",
|
|
178
|
+
"./ratings/Star.svelte": "./ratings/Star.svelte",
|
|
177
179
|
"./sidebars/Sidebar.svelte": "./sidebars/Sidebar.svelte",
|
|
178
180
|
"./sidebars/SidebarBrand.svelte": "./sidebars/SidebarBrand.svelte",
|
|
179
181
|
"./sidebars/SidebarCta.svelte": "./sidebars/SidebarCta.svelte",
|
|
@@ -234,6 +236,10 @@
|
|
|
234
236
|
"./typography/Secondary.svelte": "./typography/Secondary.svelte",
|
|
235
237
|
"./typography/TextGradient.svelte": "./typography/TextGradient.svelte",
|
|
236
238
|
"./typography/Underline.svelte": "./typography/Underline.svelte",
|
|
239
|
+
"./utils/ChevronDown.svelte": "./utils/ChevronDown.svelte",
|
|
240
|
+
"./utils/ChevronLeft.svelte": "./utils/ChevronLeft.svelte",
|
|
241
|
+
"./utils/ChevronRight.svelte": "./utils/ChevronRight.svelte",
|
|
242
|
+
"./utils/ChevronUp.svelte": "./utils/ChevronUp.svelte",
|
|
237
243
|
"./utils/CloseButton.svelte": "./utils/CloseButton.svelte",
|
|
238
244
|
"./utils/Popper.svelte": "./utils/Popper.svelte",
|
|
239
245
|
"./utils/Wrapper.svelte": "./utils/Wrapper.svelte",
|
package/popover/Popover.svelte
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
<script>import Popper from '../utils/Popper.svelte';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
3
|
export let title = '';
|
|
4
|
+
export let triggeredBy;
|
|
4
5
|
let popoverClass;
|
|
5
6
|
$: popoverClass = classNames('rounded-lg shadow-sm', 'bg-white dark:bg-gray-800', 'text-gray-500 dark:text-gray-400', 'border border-gray-200 dark:border-gray-700', $$props.class);
|
|
6
7
|
</script>
|
|
7
8
|
|
|
8
|
-
<Popper activeContent={true} {...$$restProps} class={popoverClass} on:show>
|
|
9
|
+
<Popper activeContent={true} {triggeredBy} {...$$restProps} class={popoverClass} on:show>
|
|
9
10
|
<slot name="trigger" slot="trigger" />
|
|
10
11
|
{#if $$slots.title || title}
|
|
11
12
|
<div
|
|
12
|
-
class="py-2 px-3 bg-gray-100 rounded-t-lg border-b border-gray-200 dark:border-gray-600 dark:bg-gray-700"
|
|
13
|
-
>
|
|
13
|
+
class="py-2 px-3 bg-gray-100 rounded-t-lg border-b border-gray-200 dark:border-gray-600 dark:bg-gray-700">
|
|
14
14
|
<slot name="title">
|
|
15
15
|
<h3 class="font-semibold text-gray-900 dark:text-white">{title}</h3>
|
|
16
16
|
</slot>
|
package/ratings/Rating.svelte
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>import Button from '../buttons/Button.svelte';
|
|
2
|
-
import
|
|
2
|
+
import Star from './Star.svelte';
|
|
3
3
|
// default is floor
|
|
4
4
|
export let ceil = false;
|
|
5
5
|
export let helpfullink = '';
|
|
@@ -16,8 +16,7 @@ let grayStars = comment.total - roundedRating;
|
|
|
16
16
|
<p>
|
|
17
17
|
{comment.user.name}
|
|
18
18
|
<time datetime="2014-08-16 19:00" class="block text-sm text-gray-500 dark:text-gray-400"
|
|
19
|
-
>{comment.user.joined}</time
|
|
20
|
-
>
|
|
19
|
+
>{comment.user.joined}</time>
|
|
21
20
|
</p>
|
|
22
21
|
</div>
|
|
23
22
|
</div>
|
|
@@ -29,7 +28,7 @@ let grayStars = comment.total - roundedRating;
|
|
|
29
28
|
{/each}
|
|
30
29
|
{#each Array(grayStars) as _, star}
|
|
31
30
|
<slot name="ratingDown">
|
|
32
|
-
<Star size="
|
|
31
|
+
<Star size="24" class="px-0.5 text-gray-300 dark:text-gray-500" />
|
|
33
32
|
</slot>
|
|
34
33
|
{/each}
|
|
35
34
|
{#if comment.heading}
|
|
@@ -57,8 +56,7 @@ let grayStars = comment.total - roundedRating;
|
|
|
57
56
|
<a
|
|
58
57
|
href={abuselink}
|
|
59
58
|
class="pl-4 text-sm font-medium text-blue-600 hover:underline dark:text-blue-500"
|
|
60
|
-
>Report abuse</a
|
|
61
|
-
>
|
|
59
|
+
>Report abuse</a>
|
|
62
60
|
{/if}
|
|
63
61
|
</div>
|
|
64
62
|
{/if}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script>export let size = '24';
|
|
2
|
+
export let color = 'currentColor';
|
|
3
|
+
export let variation = 'outline';
|
|
4
|
+
let viewBox;
|
|
5
|
+
let svgpath;
|
|
6
|
+
let svgoutline = `<path d="M11.4806 3.49883C11.6728 3.03685 12.3272 3.03685 12.5193 3.49883L14.6453 8.61028C14.7263 8.80504 14.9095 8.93811 15.1197 8.95497L20.638 9.39736C21.1367 9.43735 21.339 10.0598 20.959 10.3853L16.7546 13.9867C16.5945 14.1239 16.5245 14.3392 16.5734 14.5444L17.8579 19.9293C17.974 20.416 17.4446 20.8007 17.0176 20.5398L12.2932 17.6542C12.1132 17.5443 11.8868 17.5443 11.7068 17.6542L6.98238 20.5398C6.55539 20.8007 6.02594 20.416 6.14203 19.9293L7.42652 14.5444C7.47546 14.3392 7.4055 14.1239 7.24531 13.9867L3.04099 10.3853C2.661 10.0598 2.86323 9.43735 3.36197 9.39736L8.88022 8.95497C9.09048 8.93811 9.27363 8.80504 9.35464 8.61028L11.4806 3.49883Z" stroke="${color}" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/> `;
|
|
7
|
+
let svgsolid = `<path fill-rule="evenodd" clip-rule="evenodd" d="M10.7881 3.2108C11.2364 2.13286 12.7635 2.13286 13.2118 3.2108L15.2938 8.21652L20.6979 8.64976C21.8616 8.74306 22.3335 10.1953 21.4469 10.9549L17.3295 14.4818L18.5874 19.7553C18.8583 20.8909 17.6229 21.7884 16.6266 21.1799L11.9999 18.354L7.37329 21.1799C6.37697 21.7884 5.14158 20.8909 5.41246 19.7553L6.67038 14.4818L2.55303 10.9549C1.66639 10.1953 2.13826 8.74306 3.302 8.64976L8.70609 8.21652L10.7881 3.2108Z" fill="${color}"/> `;
|
|
8
|
+
$: switch (variation) {
|
|
9
|
+
case 'outline':
|
|
10
|
+
svgpath = svgoutline;
|
|
11
|
+
viewBox = '0 0 24 24';
|
|
12
|
+
break;
|
|
13
|
+
case 'solid':
|
|
14
|
+
svgpath = svgsolid;
|
|
15
|
+
viewBox = '0 0 24 24';
|
|
16
|
+
break;
|
|
17
|
+
default:
|
|
18
|
+
svgpath = svgoutline;
|
|
19
|
+
viewBox = '0 0 24 24';
|
|
20
|
+
}
|
|
21
|
+
export let ariaLabel = 'star';
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<svg
|
|
25
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
26
|
+
width={size}
|
|
27
|
+
height={size}
|
|
28
|
+
class={$$props.class}
|
|
29
|
+
{...$$restProps}
|
|
30
|
+
aria-label={ariaLabel}
|
|
31
|
+
fill="none"
|
|
32
|
+
{viewBox}
|
|
33
|
+
stroke-width="2"
|
|
34
|
+
on:click>
|
|
35
|
+
{@html svgpath}
|
|
36
|
+
</svg>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
size?: string;
|
|
6
|
+
color?: string;
|
|
7
|
+
variation?: 'solid' | 'outline';
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
};
|
|
10
|
+
events: {
|
|
11
|
+
click: MouseEvent;
|
|
12
|
+
} & {
|
|
13
|
+
[evt: string]: CustomEvent<any>;
|
|
14
|
+
};
|
|
15
|
+
slots: {};
|
|
16
|
+
};
|
|
17
|
+
export declare type StarProps = typeof __propDef.props;
|
|
18
|
+
export declare type StarEvents = typeof __propDef.events;
|
|
19
|
+
export declare type StarSlots = typeof __propDef.slots;
|
|
20
|
+
export default class Star extends SvelteComponentTyped<StarProps, StarEvents, StarSlots> {
|
|
21
|
+
}
|
|
22
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
2
|
import { slide } from 'svelte/transition';
|
|
3
3
|
import { quintOut } from 'svelte/easing';
|
|
4
|
-
import
|
|
4
|
+
import ChevronDown from '../utils/ChevronDown.svelte';
|
|
5
5
|
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
6
|
export let label = '';
|
|
7
7
|
export let spanClass = 'flex-1 ml-3 text-left whitespace-nowrap';
|
|
@@ -19,14 +19,12 @@ const handleDropdown = () => {
|
|
|
19
19
|
on:click={() => handleDropdown()}
|
|
20
20
|
type="button"
|
|
21
21
|
class={classNames(btnClass, $$props.class)}
|
|
22
|
-
aria-controls="sidebar-dropdown"
|
|
23
|
-
>
|
|
22
|
+
aria-controls="sidebar-dropdown">
|
|
24
23
|
<svelte:component
|
|
25
24
|
this={icon.name}
|
|
26
25
|
size={icon.size}
|
|
27
26
|
color={icon.color}
|
|
28
|
-
class="mr-2 {icon.class}"
|
|
29
|
-
/>
|
|
27
|
+
class="mr-2 {icon.class}" />
|
|
30
28
|
<span class={spanClass} sidebar-toggle-item>{label}</span>
|
|
31
29
|
<ChevronDown />
|
|
32
30
|
</button>
|
|
@@ -34,8 +32,7 @@ const handleDropdown = () => {
|
|
|
34
32
|
<ul
|
|
35
33
|
id="dropdown"
|
|
36
34
|
class={ulClass}
|
|
37
|
-
transition:slide={{ delay: 250, duration: 300, easing: quintOut }}
|
|
38
|
-
>
|
|
35
|
+
transition:slide={{ delay: 250, duration: 300, easing: quintOut }}>
|
|
39
36
|
<slot />
|
|
40
37
|
</ul>
|
|
41
38
|
{/if}
|
|
@@ -1,6 +1,17 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script>import { setContext } from 'svelte';
|
|
2
|
+
export let customClass = '';
|
|
3
|
+
export let order = 'default';
|
|
4
|
+
setContext('order', order);
|
|
5
|
+
let olClasses = {
|
|
6
|
+
group: 'p-5 mb-4 bg-gray-50 rounded-lg border border-gray-100 dark:bg-gray-800 dark:border-gray-700',
|
|
7
|
+
horizontal: 'items-center sm:flex',
|
|
8
|
+
activity: 'relative border-l border-gray-200 dark:border-gray-700',
|
|
9
|
+
vertical: 'relative border-l border-gray-200 dark:border-gray-700',
|
|
10
|
+
default: 'relative border-l border-gray-200 dark:border-gray-700',
|
|
11
|
+
custom: customClass
|
|
12
|
+
};
|
|
2
13
|
</script>
|
|
3
14
|
|
|
4
|
-
<ol class={
|
|
15
|
+
<ol class={olClasses[order]}>
|
|
5
16
|
<slot />
|
|
6
17
|
</ol>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
|
-
|
|
4
|
+
customClass?: string;
|
|
5
|
+
order?: 'default' | 'vertical' | 'horizontal' | 'activity' | 'group' | 'custom';
|
|
5
6
|
};
|
|
6
7
|
events: {
|
|
7
8
|
[evt: string]: CustomEvent<any>;
|