flowbite-svelte 0.25.4 → 0.25.8
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 +67 -0
- package/README.md +2 -1
- package/avatar/Dot.svelte +1 -1
- package/badges/Badge.svelte +2 -1
- package/badges/Badge.svelte.d.ts +1 -0
- package/breadcrumbs/Breadcrumb.svelte +1 -1
- package/dropdowns/Dropdown.svelte +12 -10
- package/dropdowns/Dropdown.svelte.d.ts +6 -5
- package/dropdowns/DropdownItem.svelte +0 -1
- package/forms/Iconinput.svelte +0 -1
- package/forms/Iconinput.svelte.d.ts +1 -2
- package/index.d.ts +9 -0
- package/index.js +11 -0
- package/package.json +16 -4
- package/popover/Popover.svelte +22 -0
- package/popover/Popover.svelte.d.ts +25 -0
- package/tables/Table.svelte +17 -3
- package/tables/Table.svelte.d.ts +3 -0
- package/tables/TableBodyCell.svelte +9 -2
- package/tables/TableBodyRow.svelte +33 -13
- package/tables/TableHead.svelte +30 -7
- package/tables/TableHead.svelte.d.ts +1 -0
- package/tables/TableSearch.svelte +12 -1
- package/tables/TableSearch.svelte.d.ts +1 -0
- package/tooltips/Tooltip.svelte +11 -133
- package/tooltips/Tooltip.svelte.d.ts +7 -9
- package/typography/A.svelte +9 -0
- package/typography/A.svelte.d.ts +21 -0
- package/typography/Heading.svelte +20 -0
- package/typography/Heading.svelte.d.ts +21 -0
- package/typography/Highlight.svelte +7 -0
- package/typography/Highlight.svelte.d.ts +19 -0
- package/typography/Mark.svelte +9 -0
- package/typography/Mark.svelte.d.ts +21 -0
- package/typography/P.svelte +9 -0
- package/typography/P.svelte.d.ts +21 -0
- package/typography/Secondary.svelte +8 -0
- package/typography/Secondary.svelte.d.ts +20 -0
- package/typography/TextGradient.svelte +7 -0
- package/typography/TextGradient.svelte.d.ts +19 -0
- package/typography/Underline.svelte +7 -0
- package/typography/Underline.svelte.d.ts +19 -0
- package/utils/Popper.svelte +83 -0
- package/utils/Popper.svelte.d.ts +29 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,73 @@
|
|
|
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.8](https://github.com/themesberg/flowbite-svelte/compare/v0.25.7...v0.25.8) (2022-08-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* add H1, H2, A, P, Higlight components ([3f80473](https://github.com/themesberg/flowbite-svelte/commit/3f804731e6a093c1e34f8b3be6289f930c372a96))
|
|
11
|
+
* add Heading and removed H1 and H2 ([b2be994](https://github.com/themesberg/flowbite-svelte/commit/b2be9945c39bcbfe23a0df53348ce768c5958255))
|
|
12
|
+
* add Mark and TextGradient ([343e719](https://github.com/themesberg/flowbite-svelte/commit/343e719406bc146639882f97bbeafbc2de9514cb))
|
|
13
|
+
|
|
14
|
+
### [0.25.7](https://github.com/themesberg/flowbite-svelte/compare/v0.25.6...v0.25.7) (2022-08-21)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* dropdown as Popper + fixes ([67fdf78](https://github.com/themesberg/flowbite-svelte/commit/67fdf7837f36d63b3683e0b6f6e78fbf91f6bf23))
|
|
20
|
+
|
|
21
|
+
### [0.25.6](https://github.com/themesberg/flowbite-svelte/compare/v0.25.5...v0.25.6) (2022-08-20)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* fixing standard-version ([cd316e4](https://github.com/themesberg/flowbite-svelte/commit/cd316e412171689e04ec435dfc31abd89b7cbe1d))
|
|
27
|
+
|
|
28
|
+
### [0.25.5](https://github.com/themesberg/flowbite-svelte/compare/v0.25.4...v0.25.5) (2022-08-20)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* Iconinput has unused export property value when I install it ([b19afc9](https://github.com/themesberg/flowbite-svelte/commit/b19afc9284aa2c92c5a15b89de9dc9111652f0f7))
|
|
34
|
+
|
|
35
|
+
### [0.25.4](https://github.com/themesberg/flowbite-svelte/compare/v0.25.2...v0.25.4) (2022-08-20)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
* add Table color hover and example ([b49c139](https://github.com/themesberg/flowbite-svelte/commit/b49c139c6d09a4563d462b35a5c49da605006d79))
|
|
41
|
+
|
|
42
|
+
### [0.25.2](https://github.com/themesberg/flowbite-svelte/compare/v0.25.1...v0.25.2) (2022-08-19)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Features
|
|
46
|
+
|
|
47
|
+
* add popover related files ([8b5050b](https://github.com/themesberg/flowbite-svelte/commit/8b5050b0e9f6e45533b858c7aa392463cfb6cc91))
|
|
48
|
+
* popover ([c41ddc4](https://github.com/themesberg/flowbite-svelte/commit/c41ddc408f3696e05ee66de4922b95ee5cee1a08))
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### Bug Fixes
|
|
52
|
+
|
|
53
|
+
* change href=# to href=/ in popover page ([f885a92](https://github.com/themesberg/flowbite-svelte/commit/f885a924706e477349c975641fc6fba0b4df45e5))
|
|
54
|
+
* missing Popper ([ff4b0e7](https://github.com/themesberg/flowbite-svelte/commit/ff4b0e772e228f03c1024e222fcc91e63adc23ba))
|
|
55
|
+
|
|
56
|
+
### [0.25.1](https://github.com/themesberg/flowbite-svelte/compare/v0.25.0...v0.25.1) (2022-08-18)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### Bug Fixes
|
|
60
|
+
|
|
61
|
+
* move @floating-ui/dom from dependencies to devDependencies ([6668ec8](https://github.com/themesberg/flowbite-svelte/commit/6668ec8ca1559366ad0cbc223c9c91e3337ceb22))
|
|
62
|
+
|
|
63
|
+
## [0.25.0](https://github.com/themesberg/flowbite-svelte/compare/v0.24.19...v0.25.0) (2022-08-18)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
### Bug Fixes
|
|
67
|
+
|
|
68
|
+
* [#226](https://github.com/themesberg/flowbite-svelte/issues/226) for double on:click in DropdownItem ([c125d2d](https://github.com/themesberg/flowbite-svelte/commit/c125d2d02e3818cedb83994e930ca5cc7075571c))
|
|
69
|
+
* migrate to sveltekit 1.0.0 ([434ec99](https://github.com/themesberg/flowbite-svelte/commit/434ec998e1f96ab5e35eda6c6c78f6db2279aa4e))
|
|
70
|
+
* update pnpm-lock ([4926a47](https://github.com/themesberg/flowbite-svelte/commit/4926a47bd529601b1a0709533fee2b5291e59eb8))
|
|
71
|
+
|
|
5
72
|
### [0.24.19](https://github.com/themesberg/flowbite-svelte/compare/v0.24.18...v0.24.19) (2022-08-17)
|
|
6
73
|
|
|
7
74
|
|
package/README.md
CHANGED
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/flowbite-svelte)
|
|
4
4
|
[](https://www.npmjs.com/package/flowbite-svelte)
|
|
5
|
-
[](https://www.npmjs.com/package/flowbite-svelte)
|
|
6
6
|
[](https://github.com/themesberg/flowbite-svelte/blob/main/LICENSE)
|
|
7
|
+
[](https://discord.com/invite/4eeurUVvTy)
|
|
7
8
|
|
|
8
9
|
**⚠️ Flowbite-Svelte is currently in early development and APIs and packages are likely to change quite often.**
|
|
9
10
|
|
package/avatar/Dot.svelte
CHANGED
package/badges/Badge.svelte
CHANGED
|
@@ -6,6 +6,7 @@ export let href = undefined;
|
|
|
6
6
|
export let rounded = false;
|
|
7
7
|
export let index = false;
|
|
8
8
|
export let dismissable = false;
|
|
9
|
+
export let baseClass = 'inline-flex items-center justify-center -mb-0.5';
|
|
9
10
|
let hidden = false;
|
|
10
11
|
const colors = {
|
|
11
12
|
blue: 'bg-blue-100 text-blue-800 dark:bg-blue-200 dark:text-blue-800',
|
|
@@ -36,7 +37,7 @@ const hovers = {
|
|
|
36
37
|
pink: 'hover:bg-pink-200 dark:hover:bg-pink-300'
|
|
37
38
|
};
|
|
38
39
|
let badgeClass;
|
|
39
|
-
$: badgeClass = classNames(
|
|
40
|
+
$: badgeClass = classNames(baseClass, large ? 'text-sm font-medium' : 'text-xs font-semibold', colors[color], href && (hovers[color] ?? hovers.blue), rounded ? 'rounded-full p-1' : 'rounded px-2.5 py-0.5', index && 'absolute font-bold border-2 border-white dark:border-gray-900', index && (large ? 'w-7 h-7 -top-3 -right-3' : 'w-6 h-6 -top-2 -right-2'), $$props.class);
|
|
40
41
|
const handleHide = () => {
|
|
41
42
|
hidden = !hidden;
|
|
42
43
|
};
|
package/badges/Badge.svelte.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ export let navClass = 'flex';
|
|
|
3
3
|
export let olClass = 'inline-flex items-center space-x-1 md:space-x-3';
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
|
-
<nav aria-label="Breadcrumb" {...$$restProps} class={classNames(navClass, $$props.
|
|
6
|
+
<nav aria-label="Breadcrumb" {...$$restProps} class={classNames(navClass, $$props.class)}>
|
|
7
7
|
<ol class={classNames(olClass, $$props.classOl)}>
|
|
8
8
|
<slot />
|
|
9
9
|
</ol>
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
<script>import { setContext } from 'svelte';
|
|
2
|
-
import Tooltip from '../tooltips/Tooltip.svelte';
|
|
3
2
|
import Button from '../buttons/Button.svelte';
|
|
3
|
+
import Popper from '../utils/Popper.svelte';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { ChevronUp, ChevronRight, ChevronDown, ChevronLeft } from 'svelte-heros';
|
|
6
6
|
export let label = '';
|
|
7
7
|
export let inline = false;
|
|
8
|
-
export let tooltipArrow = false;
|
|
9
8
|
export let arrowIcon = true;
|
|
10
9
|
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';
|
|
11
10
|
export let placement = 'bottom';
|
|
@@ -19,18 +18,21 @@ const icons = {
|
|
|
19
18
|
};
|
|
20
19
|
// @ts-ignore
|
|
21
20
|
$: icon = icons[placement.split('-')[0]];
|
|
21
|
+
let popoverClass;
|
|
22
|
+
$: 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);
|
|
22
23
|
</script>
|
|
23
24
|
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
animation="duration-100"
|
|
25
|
+
<Popper
|
|
26
|
+
activeContent={true}
|
|
27
|
+
arrow={false}
|
|
28
28
|
{placement}
|
|
29
|
-
|
|
29
|
+
{...$$restProps}
|
|
30
|
+
class={popoverClass}
|
|
30
31
|
trigger="click"
|
|
32
|
+
on:show
|
|
31
33
|
bind:open
|
|
32
34
|
>
|
|
33
|
-
<slot name="trigger">
|
|
35
|
+
<slot name="trigger" slot="trigger">
|
|
34
36
|
{#if inline}
|
|
35
37
|
<button class={labelClass} class:flex-row-reverse={icon == ChevronLeft}>
|
|
36
38
|
<slot name="label">{label}</slot>
|
|
@@ -53,9 +55,9 @@ $: icon = icons[placement.split('-')[0]];
|
|
|
53
55
|
</Button>
|
|
54
56
|
{/if}
|
|
55
57
|
</slot>
|
|
56
|
-
<slot name="content"
|
|
58
|
+
<slot name="content">
|
|
57
59
|
<ul class="py-1">
|
|
58
60
|
<slot />
|
|
59
61
|
</ul>
|
|
60
62
|
</slot>
|
|
61
|
-
</
|
|
63
|
+
</Popper>
|
|
@@ -1,25 +1,26 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { Placement } from '@
|
|
2
|
+
import type { Placement } from '@popperjs/core';
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
[x: string]: any;
|
|
6
6
|
label?: string;
|
|
7
7
|
inline?: boolean;
|
|
8
|
-
tooltipArrow?: boolean;
|
|
9
8
|
arrowIcon?: boolean;
|
|
10
9
|
labelClass?: string;
|
|
11
10
|
placement?: 'auto' | Placement;
|
|
12
11
|
open?: boolean;
|
|
13
12
|
};
|
|
14
13
|
events: {
|
|
14
|
+
show: CustomEvent<any>;
|
|
15
|
+
} & {
|
|
15
16
|
[evt: string]: CustomEvent<any>;
|
|
16
17
|
};
|
|
17
18
|
slots: {
|
|
18
|
-
trigger: {
|
|
19
|
-
label: {};
|
|
20
|
-
content: {
|
|
19
|
+
trigger: {
|
|
21
20
|
slot: string;
|
|
22
21
|
};
|
|
22
|
+
label: {};
|
|
23
|
+
content: {};
|
|
23
24
|
default: {};
|
|
24
25
|
};
|
|
25
26
|
};
|
package/forms/Iconinput.svelte
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { InputType } from '../types';
|
|
3
2
|
import type { SvelteComponent } from 'svelte';
|
|
3
|
+
import type { InputType } from '../types';
|
|
4
4
|
declare const __propDef: {
|
|
5
5
|
props: {
|
|
6
6
|
[x: string]: any;
|
|
7
7
|
type?: InputType;
|
|
8
|
-
value?: string;
|
|
9
8
|
size?: 'sm' | 'md' | 'lg';
|
|
10
9
|
icon: typeof SvelteComponent;
|
|
11
10
|
noBorder?: boolean;
|
package/index.d.ts
CHANGED
|
@@ -59,6 +59,7 @@ export { default as Pagination } from './paginations/Pagination.svelte';
|
|
|
59
59
|
export { default as Previous } from './paginations/Previous.svelte';
|
|
60
60
|
export { default as Next } from './paginations/Next.svelte';
|
|
61
61
|
export { default as TableData } from './paginations/TableData.svelte';
|
|
62
|
+
export { default as Popover } from './popover/Popover.svelte';
|
|
62
63
|
export { default as Progressbar } from './progressbars/Progressbar.svelte';
|
|
63
64
|
export { default as Rating } from './ratings/Rating.svelte';
|
|
64
65
|
export { default as AdvancedRating } from './ratings/AdvancedRating.svelte';
|
|
@@ -110,4 +111,12 @@ export { default as TimelineItemHorizontal } from './timelines/TimelineItemHoriz
|
|
|
110
111
|
export { default as TimelineItemVertical } from './timelines/TimelineItemVertical.svelte';
|
|
111
112
|
export { default as Toast } from './toasts/Toast.svelte';
|
|
112
113
|
export { default as Tooltip } from './tooltips/Tooltip.svelte';
|
|
114
|
+
export { default as A } from './typography/A.svelte';
|
|
115
|
+
export { default as Heading } from './typography/Heading.svelte';
|
|
116
|
+
export { default as Highlight } from './typography/Highlight.svelte';
|
|
117
|
+
export { default as Mark } from './typography/Mark.svelte';
|
|
118
|
+
export { default as P } from './typography/P.svelte';
|
|
119
|
+
export { default as Secondary } from './typography/Secondary.svelte';
|
|
120
|
+
export { default as TextGradient } from './typography/TextGradient.svelte';
|
|
121
|
+
export { default as Underline } from './typography/Underline.svelte';
|
|
113
122
|
export { default as CloseButton } from './utils/CloseButton.svelte';
|
package/index.js
CHANGED
|
@@ -80,6 +80,8 @@ export { default as Pagination } from './paginations/Pagination.svelte';
|
|
|
80
80
|
export { default as Previous } from './paginations/Previous.svelte';
|
|
81
81
|
export { default as Next } from './paginations/Next.svelte';
|
|
82
82
|
export { default as TableData } from './paginations/TableData.svelte';
|
|
83
|
+
// Popover
|
|
84
|
+
export { default as Popover } from './popover/Popover.svelte';
|
|
83
85
|
// Progressbar
|
|
84
86
|
export { default as Progressbar } from './progressbars/Progressbar.svelte';
|
|
85
87
|
// Rating
|
|
@@ -141,5 +143,14 @@ export { default as TimelineItemVertical } from './timelines/TimelineItemVertica
|
|
|
141
143
|
export { default as Toast } from './toasts/Toast.svelte';
|
|
142
144
|
// Tooltips
|
|
143
145
|
export { default as Tooltip } from './tooltips/Tooltip.svelte';
|
|
146
|
+
// Typography
|
|
147
|
+
export { default as A } from './typography/A.svelte';
|
|
148
|
+
export { default as Heading } from './typography/Heading.svelte';
|
|
149
|
+
export { default as Highlight } from './typography/Highlight.svelte';
|
|
150
|
+
export { default as Mark } from './typography/Mark.svelte';
|
|
151
|
+
export { default as P } from './typography/P.svelte';
|
|
152
|
+
export { default as Secondary } from './typography/Secondary.svelte';
|
|
153
|
+
export { default as TextGradient } from './typography/TextGradient.svelte';
|
|
154
|
+
export { default as Underline } from './typography/Underline.svelte';
|
|
144
155
|
// utils
|
|
145
156
|
export { default as CloseButton } from './utils/CloseButton.svelte';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.8",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -14,11 +14,14 @@
|
|
|
14
14
|
"devDependencies": {
|
|
15
15
|
"@floating-ui/dom": "^1.0.1",
|
|
16
16
|
"@playwright/test": "^1.25.0",
|
|
17
|
+
"@popperjs/core": "^2.11.6",
|
|
17
18
|
"@sveltejs/adapter-auto": "next",
|
|
18
|
-
"@sveltejs/kit": "next",
|
|
19
|
+
"@sveltejs/kit": "1.0.0-next.420",
|
|
20
|
+
"@sveltejs/package": "1.0.0-next.1",
|
|
19
21
|
"@typescript-eslint/eslint-plugin": "^5.33.0",
|
|
20
22
|
"@typescript-eslint/parser": "^5.33.0",
|
|
21
23
|
"autoprefixer": "^10.4.8",
|
|
24
|
+
"classnames": "^2.3.1",
|
|
22
25
|
"createprops": "^0.4.9",
|
|
23
26
|
"eslint": "^8.21.0",
|
|
24
27
|
"eslint-config-prettier": "^8.5.0",
|
|
@@ -82,7 +85,6 @@
|
|
|
82
85
|
"url": "https://github.com/themesberg/flowbite-svelte"
|
|
83
86
|
},
|
|
84
87
|
"dependencies": {
|
|
85
|
-
"classnames": "^2.3.1",
|
|
86
88
|
"flowbite": "^1.5.2"
|
|
87
89
|
},
|
|
88
90
|
"engines": {
|
|
@@ -167,6 +169,7 @@
|
|
|
167
169
|
"./paginations/Pagination.svelte": "./paginations/Pagination.svelte",
|
|
168
170
|
"./paginations/Previous.svelte": "./paginations/Previous.svelte",
|
|
169
171
|
"./paginations/TableData.svelte": "./paginations/TableData.svelte",
|
|
172
|
+
"./popover/Popover.svelte": "./popover/Popover.svelte",
|
|
170
173
|
"./progressbars/Progressbar.svelte": "./progressbars/Progressbar.svelte",
|
|
171
174
|
"./ratings/AdvancedRating.svelte": "./ratings/AdvancedRating.svelte",
|
|
172
175
|
"./ratings/Rating.svelte": "./ratings/Rating.svelte",
|
|
@@ -219,10 +222,19 @@
|
|
|
219
222
|
"./toasts/Toast.svelte": "./toasts/Toast.svelte",
|
|
220
223
|
"./tooltips/Tooltip.svelte": "./tooltips/Tooltip.svelte",
|
|
221
224
|
"./types": "./types.js",
|
|
225
|
+
"./typography/A.svelte": "./typography/A.svelte",
|
|
226
|
+
"./typography/Heading.svelte": "./typography/Heading.svelte",
|
|
227
|
+
"./typography/Highlight.svelte": "./typography/Highlight.svelte",
|
|
228
|
+
"./typography/Mark.svelte": "./typography/Mark.svelte",
|
|
229
|
+
"./typography/P.svelte": "./typography/P.svelte",
|
|
230
|
+
"./typography/Secondary.svelte": "./typography/Secondary.svelte",
|
|
231
|
+
"./typography/TextGradient.svelte": "./typography/TextGradient.svelte",
|
|
232
|
+
"./typography/Underline.svelte": "./typography/Underline.svelte",
|
|
222
233
|
"./utils/CloseButton.svelte": "./utils/CloseButton.svelte",
|
|
234
|
+
"./utils/Popper.svelte": "./utils/Popper.svelte",
|
|
223
235
|
"./utils/clickOutside": "./utils/clickOutside.js",
|
|
224
236
|
"./utils/focusTrap": "./utils/focusTrap.js",
|
|
225
237
|
"./utils/generateId": "./utils/generateId.js"
|
|
226
238
|
},
|
|
227
239
|
"svelte": "./index.js"
|
|
228
|
-
}
|
|
240
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>import Popper from '../utils/Popper.svelte';
|
|
2
|
+
import classNames from 'classnames';
|
|
3
|
+
export let title = '';
|
|
4
|
+
let popoverClass;
|
|
5
|
+
$: 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
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<Popper activeContent={true} {...$$restProps} class={popoverClass} on:show>
|
|
9
|
+
<slot name="trigger" slot="trigger" />
|
|
10
|
+
{#if $$slots.title || title}
|
|
11
|
+
<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
|
+
>
|
|
14
|
+
<slot name="title">
|
|
15
|
+
<h3 class="font-semibold text-gray-900 dark:text-white">{title}</h3>
|
|
16
|
+
</slot>
|
|
17
|
+
</div>
|
|
18
|
+
{/if}
|
|
19
|
+
<div class="py-2 px-3">
|
|
20
|
+
<slot />
|
|
21
|
+
</div>
|
|
22
|
+
</Popper>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
title?: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
show: CustomEvent<any>;
|
|
9
|
+
} & {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
trigger: {
|
|
14
|
+
slot: string;
|
|
15
|
+
};
|
|
16
|
+
title: {};
|
|
17
|
+
default: {};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export declare type PopoverProps = typeof __propDef.props;
|
|
21
|
+
export declare type PopoverEvents = typeof __propDef.events;
|
|
22
|
+
export declare type PopoverSlots = typeof __propDef.slots;
|
|
23
|
+
export default class Popover extends SvelteComponentTyped<PopoverProps, PopoverEvents, PopoverSlots> {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
package/tables/Table.svelte
CHANGED
|
@@ -1,16 +1,30 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
2
|
import { setContext } from 'svelte';
|
|
3
|
-
export let divClass = 'relative overflow-x-auto
|
|
3
|
+
export let divClass = 'relative overflow-x-auto';
|
|
4
4
|
export let striped = false;
|
|
5
5
|
export let hoverable = false;
|
|
6
|
+
export let noborder = false;
|
|
7
|
+
export let shadow = false;
|
|
8
|
+
export let color = 'default';
|
|
9
|
+
const colors = {
|
|
10
|
+
default: 'text-gray-500 dark:text-gray-400',
|
|
11
|
+
blue: 'text-blue-100 dark:text-blue-100',
|
|
12
|
+
green: 'text-green-100 dark:text-green-100',
|
|
13
|
+
red: 'text-red-100 dark:text-red-100',
|
|
14
|
+
yellow: 'text-yellow-100 dark:text-yellow-100',
|
|
15
|
+
purple: 'text-purple-100 dark:text-purple-100',
|
|
16
|
+
custom: ''
|
|
17
|
+
};
|
|
6
18
|
$: setContext('striped', striped);
|
|
7
19
|
$: setContext('hoverable', hoverable);
|
|
20
|
+
$: setContext('noborder', noborder);
|
|
21
|
+
$: setContext('color', color);
|
|
8
22
|
</script>
|
|
9
23
|
|
|
10
|
-
<div class={divClass}>
|
|
24
|
+
<div class={classNames(divClass, shadow && 'shadow-md sm:rounded-lg')}>
|
|
11
25
|
<table
|
|
12
26
|
{...$$restProps}
|
|
13
|
-
class={classNames('w-full text-left text-sm
|
|
27
|
+
class={classNames('w-full text-left text-sm', colors[color], $$props.class)}
|
|
14
28
|
>
|
|
15
29
|
<slot />
|
|
16
30
|
</table>
|
package/tables/Table.svelte.d.ts
CHANGED
|
@@ -5,6 +5,9 @@ declare const __propDef: {
|
|
|
5
5
|
divClass?: string;
|
|
6
6
|
striped?: boolean;
|
|
7
7
|
hoverable?: boolean;
|
|
8
|
+
noborder?: boolean;
|
|
9
|
+
shadow?: boolean;
|
|
10
|
+
color?: 'blue' | 'green' | 'red' | 'yellow' | 'purple' | 'default' | 'custom';
|
|
8
11
|
};
|
|
9
12
|
events: {
|
|
10
13
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
|
|
2
|
+
import { getContext } from 'svelte';
|
|
3
|
+
export let tdClass = 'px-6 py-4 whitespace-nowrap font-medium ';
|
|
4
|
+
let color = 'default';
|
|
5
|
+
color = getContext('color');
|
|
6
|
+
let tdClassfinal;
|
|
7
|
+
$: tdClassfinal = classNames(tdClass, color === 'default'
|
|
8
|
+
? 'text-gray-900 dark:text-white'
|
|
9
|
+
: 'text-blue-50 whitespace-nowrap dark:text-blue-100', $$props.class);
|
|
3
10
|
</script>
|
|
4
11
|
|
|
5
|
-
<td {...$$restProps} class={
|
|
12
|
+
<td {...$$restProps} class={tdClassfinal}>
|
|
6
13
|
<slot />
|
|
7
14
|
</td>
|
|
@@ -1,19 +1,39 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
2
|
import { getContext } from 'svelte';
|
|
3
|
-
export let trClass = 'bg-white
|
|
3
|
+
export let trClass = 'bg-white';
|
|
4
|
+
const colors = {
|
|
5
|
+
default: 'dark:border-gray-700 dark:bg-gray-800',
|
|
6
|
+
blue: 'bg-blue-500 border-b border-blue-400',
|
|
7
|
+
green: 'bg-green-500 border-b border-green-400',
|
|
8
|
+
red: 'bg-red-500 border-b border-red-400',
|
|
9
|
+
yellow: 'bg-yellow-500 border-b border-yellow-400',
|
|
10
|
+
purple: 'bg-purple-500 border-b border-purple-400',
|
|
11
|
+
custom: ''
|
|
12
|
+
};
|
|
13
|
+
const hoverColors = {
|
|
14
|
+
default: 'hover:bg-gray-50 dark:hover:bg-gray-600',
|
|
15
|
+
blue: 'hover:bg-blue-400',
|
|
16
|
+
green: 'hover:bg-green-400',
|
|
17
|
+
red: 'hover:bg-red-400',
|
|
18
|
+
yellow: 'hover:bg-yellow-400',
|
|
19
|
+
purple: 'hover:bg-purple-400',
|
|
20
|
+
custom: ''
|
|
21
|
+
};
|
|
22
|
+
const stripColors = {
|
|
23
|
+
default: 'odd:bg-white even:bg-gray-50 odd:dark:bg-gray-800 even:dark:bg-gray-700',
|
|
24
|
+
blue: 'odd:bg-blue-800 even:bg-blue-700 odd:dark:bg-blue-800 even:dark:bg-blue-700',
|
|
25
|
+
green: 'odd:bg-green-800 even:bg-green-700 odd:dark:bg-green-800 even:dark:bg-green-700',
|
|
26
|
+
red: 'odd:bg-red-800 even:bg-red-700 odd:dark:bg-red-800 even:dark:bg-red-700',
|
|
27
|
+
yellow: 'odd:bg-yellow-800 even:bg-yellow-700 odd:dark:bg-yellow-800 even:dark:bg-yellow-700',
|
|
28
|
+
purple: 'odd:bg-purple-800 even:bg-purple-700 odd:dark:bg-purple-800 even:dark:bg-purple-700',
|
|
29
|
+
custom: ''
|
|
30
|
+
};
|
|
31
|
+
let color = 'default';
|
|
32
|
+
color = getContext('color');
|
|
33
|
+
let trClassfinal;
|
|
34
|
+
$: trClassfinal = classNames(getContext('noborder') ? 'bg-white dark:bg-gray-800' : trClass, colors[color], getContext('hoverable') && hoverColors[color], getContext('striped') && stripColors[color], $$props.class);
|
|
4
35
|
</script>
|
|
5
36
|
|
|
6
|
-
<tr
|
|
7
|
-
{...$$restProps}
|
|
8
|
-
class={classNames(
|
|
9
|
-
trClass,
|
|
10
|
-
{
|
|
11
|
-
'odd:bg-white even:bg-gray-50 odd:dark:bg-gray-800 even:dark:bg-gray-700':
|
|
12
|
-
getContext('striped') === true,
|
|
13
|
-
'hover:bg-gray-50 dark:hover:bg-gray-600': getContext('hoverable') === true
|
|
14
|
-
},
|
|
15
|
-
$$props.class
|
|
16
|
-
)}
|
|
17
|
-
>
|
|
37
|
+
<tr {...$$restProps} class={trClassfinal}>
|
|
18
38
|
<slot />
|
|
19
39
|
</tr>
|
package/tables/TableHead.svelte
CHANGED
|
@@ -1,13 +1,36 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
+
import { getContext } from 'svelte';
|
|
3
|
+
export let theadClass = 'text-xs uppercase';
|
|
4
|
+
let color;
|
|
5
|
+
color = getContext('color');
|
|
6
|
+
let noborder = getContext('noborder');
|
|
7
|
+
let striped = getContext('striped');
|
|
8
|
+
let defatultBgColor = noborder || striped ? '' : 'bg-gray-50 dark:bg-gray-700';
|
|
9
|
+
const bgColors = {
|
|
10
|
+
default: defatultBgColor,
|
|
11
|
+
blue: 'bg-blue-600',
|
|
12
|
+
green: 'bg-green-600',
|
|
13
|
+
red: 'bg-red-600',
|
|
14
|
+
yellow: 'bg-yellow-600',
|
|
15
|
+
purple: 'bg-purple-600',
|
|
16
|
+
custom: ''
|
|
17
|
+
};
|
|
18
|
+
let textColor = color === 'default'
|
|
19
|
+
? 'text-gray-700 dark:text-gray-400'
|
|
20
|
+
: color === 'custom'
|
|
21
|
+
? ''
|
|
22
|
+
: 'text-white dark:text-white';
|
|
23
|
+
let borderColors = striped
|
|
24
|
+
? ''
|
|
25
|
+
: color === 'default'
|
|
26
|
+
? 'border-gray-700'
|
|
27
|
+
: color === 'custom'
|
|
28
|
+
? ''
|
|
29
|
+
: `border-${color}-400`;
|
|
30
|
+
$: theadClassfinal = classNames(theadClass, textColor, striped && borderColors, bgColors[color], $$props.class);
|
|
2
31
|
</script>
|
|
3
32
|
|
|
4
|
-
<thead
|
|
5
|
-
{...$$restProps}
|
|
6
|
-
class={classNames(
|
|
7
|
-
'bg-gray-50 text-xs uppercase text-gray-700 dark:bg-gray-700 dark:text-gray-400',
|
|
8
|
-
$$props.class
|
|
9
|
-
)}
|
|
10
|
-
>
|
|
33
|
+
<thead {...$$restProps} class={theadClassfinal}>
|
|
11
34
|
<tr>
|
|
12
35
|
<slot />
|
|
13
36
|
</tr>
|
|
@@ -5,8 +5,19 @@ export let inputValue = '';
|
|
|
5
5
|
export let striped = false;
|
|
6
6
|
export let hoverable = false;
|
|
7
7
|
export let placeholder = 'Search';
|
|
8
|
+
export let color = 'default';
|
|
9
|
+
const colors = {
|
|
10
|
+
default: 'text-gray-500 dark:text-gray-400',
|
|
11
|
+
blue: 'text-blue-100 dark:text-blue-100',
|
|
12
|
+
green: 'text-green-100 dark:text-green-100',
|
|
13
|
+
red: 'text-red-100 dark:text-red-100',
|
|
14
|
+
yellow: 'text-yellow-100 dark:text-yellow-100',
|
|
15
|
+
purple: 'text-purple-100 dark:text-purple-100',
|
|
16
|
+
custom: ''
|
|
17
|
+
};
|
|
8
18
|
$: setContext('striped', striped);
|
|
9
19
|
$: setContext('hoverable', hoverable);
|
|
20
|
+
$: setContext('color', color);
|
|
10
21
|
</script>
|
|
11
22
|
|
|
12
23
|
<div class={divClass}>
|
|
@@ -37,7 +48,7 @@ $: setContext('hoverable', hoverable);
|
|
|
37
48
|
</div>
|
|
38
49
|
<table
|
|
39
50
|
{...$$restProps}
|
|
40
|
-
class={classNames('w-full text-left text-sm
|
|
51
|
+
class={classNames('w-full text-left text-sm', colors[color], $$props.class)}
|
|
41
52
|
>
|
|
42
53
|
<slot />
|
|
43
54
|
</table>
|
package/tooltips/Tooltip.svelte
CHANGED
|
@@ -1,142 +1,20 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import
|
|
3
|
-
import { computePosition, flip, shift, offset, autoPlacement, arrow as arrowFloat } from '@floating-ui/dom';
|
|
4
|
-
import { onDestroy } from 'svelte';
|
|
5
|
-
export let placement = 'top';
|
|
6
|
-
export let trigger = 'hover';
|
|
7
|
-
export let style = 'dark';
|
|
1
|
+
<script>import Popper from '../utils/Popper.svelte';
|
|
2
|
+
import classNames from 'classnames';
|
|
8
3
|
export let content = '';
|
|
9
|
-
export let
|
|
10
|
-
export let arrow = true;
|
|
11
|
-
export let tipClass = 'absolute inline-block rounded-lg py-2 px-3 text-sm font-medium shadow-sm';
|
|
4
|
+
export let style = 'dark';
|
|
12
5
|
export let tipColor = '';
|
|
13
|
-
export let
|
|
6
|
+
export let tipClass = 'py-2 px-3 text-sm font-medium rounded-lg shadow-sm tooltip';
|
|
14
7
|
const tipStyleClasses = {
|
|
15
|
-
dark: 'bg-gray-900 text-white dark:bg-gray-700',
|
|
8
|
+
dark: 'border border-gray-800 bg-gray-900 text-white dark:bg-gray-700 dark:border-gray-600',
|
|
16
9
|
light: 'border border-gray-200 bg-white text-gray-900',
|
|
17
|
-
auto: 'border border-gray-200 bg-white text-gray-900 dark:
|
|
18
|
-
custom: tipColor
|
|
19
|
-
};
|
|
20
|
-
const arrowStyleClasses = {
|
|
21
|
-
dark: 'bg-gray-900 dark:bg-gray-700',
|
|
22
|
-
light: 'bg-white',
|
|
23
|
-
auto: 'bg-white dark:bg-gray-700',
|
|
10
|
+
auto: 'border border-gray-200 bg-white text-gray-900 dark:bg-gray-700 dark:text-white dark:border-gray-600 ',
|
|
24
11
|
custom: tipColor
|
|
25
12
|
};
|
|
26
13
|
let toolTipClass;
|
|
27
|
-
$: toolTipClass = classNames(tipClass,
|
|
28
|
-
const floatingPlacement = (placement) => {
|
|
29
|
-
return placement === 'auto' ? undefined : placement;
|
|
30
|
-
};
|
|
31
|
-
const floatingMiddleware = (arrowRef, placement) => {
|
|
32
|
-
const middleware = [];
|
|
33
|
-
middleware.push(offset(8));
|
|
34
|
-
middleware.push(placement === 'auto' ? autoPlacement() : flip());
|
|
35
|
-
middleware.push(shift({ padding: 8 }));
|
|
36
|
-
if (arrowRef) {
|
|
37
|
-
middleware.push(arrowFloat({ element: arrowRef }));
|
|
38
|
-
}
|
|
39
|
-
return middleware;
|
|
40
|
-
};
|
|
41
|
-
let placementData;
|
|
42
|
-
let tooltipRef, triggerRef, arrowRef;
|
|
43
|
-
const updatePosition = () => computePosition(triggerRef, tooltipRef, {
|
|
44
|
-
middleware: floatingMiddleware(arrowRef, placement),
|
|
45
|
-
placement: floatingPlacement(placement)
|
|
46
|
-
}).then((data) => (placementData = data));
|
|
47
|
-
let attachedScroll = false;
|
|
48
|
-
$: tooltipRef && open && updatePosition();
|
|
49
|
-
$: {
|
|
50
|
-
if (tooltipRef && triggerRef) {
|
|
51
|
-
if (open && !attachedScroll) {
|
|
52
|
-
attachedScroll = true;
|
|
53
|
-
window.addEventListener('scroll', updatePosition, true);
|
|
54
|
-
}
|
|
55
|
-
else if (!open && attachedScroll) {
|
|
56
|
-
attachedScroll = false;
|
|
57
|
-
window.removeEventListener('scroll', updatePosition, true);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
onDestroy(() => {
|
|
62
|
-
if (attachedScroll) {
|
|
63
|
-
attachedScroll = false;
|
|
64
|
-
window.removeEventListener('scroll', updatePosition, true);
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
const arrPos = {
|
|
68
|
-
top: 'bottom',
|
|
69
|
-
right: 'left',
|
|
70
|
-
bottom: 'top',
|
|
71
|
-
left: 'right'
|
|
72
|
-
};
|
|
73
|
-
let floatingArrowPlacement;
|
|
74
|
-
$: {
|
|
75
|
-
if (placementData) {
|
|
76
|
-
const arrow = placementData.middlewareData.arrow;
|
|
77
|
-
const pos = arrPos[placementData?.placement?.split('-')[0]] ?? 'top';
|
|
78
|
-
if (pos === 'top' || pos === 'bottom')
|
|
79
|
-
floatingArrowPlacement = `${pos}: -4px; left: ${px(arrow?.x)}`;
|
|
80
|
-
else
|
|
81
|
-
floatingArrowPlacement = `${pos}: -4px; top: ${px(arrow?.y)}`;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
const px = (x) => (x === undefined ? '' : x + 'px');
|
|
14
|
+
$: toolTipClass = classNames(tipClass, tipStyleClasses[style], $$props.class);
|
|
85
15
|
</script>
|
|
86
16
|
|
|
87
|
-
<
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
if (open) {
|
|
92
|
-
open = false;
|
|
93
|
-
}
|
|
94
|
-
}}
|
|
95
|
-
>
|
|
96
|
-
<div
|
|
97
|
-
class="w-fit"
|
|
98
|
-
bind:this={triggerRef}
|
|
99
|
-
on:mouseenter={() => {
|
|
100
|
-
if (trigger === 'hover') {
|
|
101
|
-
open = true;
|
|
102
|
-
}
|
|
103
|
-
}}
|
|
104
|
-
on:mouseleave={() => {
|
|
105
|
-
if (open && trigger === 'hover') {
|
|
106
|
-
open = false;
|
|
107
|
-
}
|
|
108
|
-
}}
|
|
109
|
-
on:click={() => {
|
|
110
|
-
if (trigger === 'click') {
|
|
111
|
-
open = !open;
|
|
112
|
-
}
|
|
113
|
-
}}
|
|
114
|
-
>
|
|
115
|
-
<slot />
|
|
116
|
-
</div>
|
|
117
|
-
|
|
118
|
-
<div
|
|
119
|
-
bind:this={tooltipRef}
|
|
120
|
-
data-testid="tooltip"
|
|
121
|
-
class={toolTipClass}
|
|
122
|
-
style:left={px(placementData?.x)}
|
|
123
|
-
style:top={px(placementData?.y)}
|
|
124
|
-
style:position={placementData?.strategy ?? ''}
|
|
125
|
-
>
|
|
126
|
-
<div class="relative z-20">
|
|
127
|
-
<slot name="content">
|
|
128
|
-
{content}
|
|
129
|
-
</slot>
|
|
130
|
-
</div>
|
|
131
|
-
{#if arrow}
|
|
132
|
-
<div
|
|
133
|
-
class={classNames('absolute z-10 h-2 w-2 rotate-45', arrowStyleClasses[style])}
|
|
134
|
-
data-testid="tooltip-arrow"
|
|
135
|
-
style={floatingArrowPlacement}
|
|
136
|
-
bind:this={arrowRef}
|
|
137
|
-
>
|
|
138
|
-
|
|
139
|
-
</div>
|
|
140
|
-
{/if}
|
|
141
|
-
</div>
|
|
142
|
-
</div>
|
|
17
|
+
<Popper activeContent={false} {...$$restProps} class={toolTipClass} on:show>
|
|
18
|
+
<slot slot="trigger" />
|
|
19
|
+
<slot name="content">{content}</slot>
|
|
20
|
+
</Popper>
|
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type { Placement } from '@floating-ui/dom';
|
|
3
2
|
declare const __propDef: {
|
|
4
3
|
props: {
|
|
5
4
|
[x: string]: any;
|
|
6
|
-
placement?: 'auto' | Placement;
|
|
7
|
-
trigger?: 'hover' | 'click';
|
|
8
|
-
style?: 'dark' | 'light' | 'auto' | 'custom';
|
|
9
5
|
content?: string;
|
|
10
|
-
|
|
11
|
-
arrow?: boolean;
|
|
12
|
-
tipClass?: string;
|
|
6
|
+
style?: 'dark' | 'light' | 'auto' | 'custom';
|
|
13
7
|
tipColor?: string;
|
|
14
|
-
|
|
8
|
+
tipClass?: string;
|
|
15
9
|
};
|
|
16
10
|
events: {
|
|
11
|
+
show: CustomEvent<any>;
|
|
12
|
+
} & {
|
|
17
13
|
[evt: string]: CustomEvent<any>;
|
|
18
14
|
};
|
|
19
15
|
slots: {
|
|
20
|
-
default: {
|
|
16
|
+
default: {
|
|
17
|
+
slot: string;
|
|
18
|
+
};
|
|
21
19
|
content: {};
|
|
22
20
|
};
|
|
23
21
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
export let href = '#';
|
|
3
|
+
export let textColor = 'text-blue-600 dark:text-blue-500';
|
|
4
|
+
export let aClass = 'inline-flex items-center text-lg hover:underline';
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<a {href} class={classNames(aClass, textColor, $$props.class)}>
|
|
8
|
+
<slot />
|
|
9
|
+
</a>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
href?: string;
|
|
6
|
+
textColor?: string;
|
|
7
|
+
aClass?: string;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
default: {};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare type AProps = typeof __propDef.props;
|
|
17
|
+
export declare type AEvents = typeof __propDef.events;
|
|
18
|
+
export declare type ASlots = typeof __propDef.slots;
|
|
19
|
+
export default class A extends SvelteComponentTyped<AProps, AEvents, ASlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
export let tag = 'h1';
|
|
3
|
+
export let textColor = 'text-gray-900 dark:text-white';
|
|
4
|
+
export let customSize;
|
|
5
|
+
const textSizes = {
|
|
6
|
+
h1: 'text-5xl font-extrabold',
|
|
7
|
+
h2: 'text-4xl font-bold',
|
|
8
|
+
h3: 'text-3xl font-bold',
|
|
9
|
+
h4: 'text-2xl font-bold',
|
|
10
|
+
h5: 'text-xl font-bold',
|
|
11
|
+
h6: 'text-lg font-bold'
|
|
12
|
+
};
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<svelte:element
|
|
16
|
+
this={tag}
|
|
17
|
+
class={classNames(customSize ? customSize : textSizes[tag], textColor, $$props.class)}
|
|
18
|
+
>
|
|
19
|
+
<slot />
|
|
20
|
+
</svelte:element>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
tag?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
6
|
+
textColor?: string;
|
|
7
|
+
customSize: string;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
default: {};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare type HeadingProps = typeof __propDef.props;
|
|
17
|
+
export declare type HeadingEvents = typeof __propDef.events;
|
|
18
|
+
export declare type HeadingSlots = typeof __propDef.slots;
|
|
19
|
+
export default class Heading extends SvelteComponentTyped<HeadingProps, HeadingEvents, HeadingSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
textColor?: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {
|
|
11
|
+
default: {};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare type HighlightProps = typeof __propDef.props;
|
|
15
|
+
export declare type HighlightEvents = typeof __propDef.events;
|
|
16
|
+
export declare type HighlightSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Highlight extends SvelteComponentTyped<HighlightProps, HighlightEvents, HighlightSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
export let textColor = 'text-white dark:bg-blue-500';
|
|
3
|
+
export let bgColor = 'bg-blue-600';
|
|
4
|
+
export let markClass = 'px-2 rounded';
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<mark class={classNames(markClass, bgColor, textColor, $$props.class)}>
|
|
8
|
+
<slot />
|
|
9
|
+
</mark>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
textColor?: string;
|
|
6
|
+
bgColor?: string;
|
|
7
|
+
markClass?: string;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
default: {};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare type MarkProps = typeof __propDef.props;
|
|
17
|
+
export declare type MarkEvents = typeof __propDef.events;
|
|
18
|
+
export declare type MarkSlots = typeof __propDef.slots;
|
|
19
|
+
export default class Mark extends SvelteComponentTyped<MarkProps, MarkEvents, MarkSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
export let textColor = 'text-gray-500 dark:text-gray-400';
|
|
3
|
+
export let size = 'text-lg';
|
|
4
|
+
export let pClass = 'font-normal';
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<p class={classNames(pClass, size, textColor, $$props.class)}>
|
|
8
|
+
<slot />
|
|
9
|
+
</p>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
textColor?: string;
|
|
6
|
+
size?: string;
|
|
7
|
+
pClass?: string;
|
|
8
|
+
};
|
|
9
|
+
events: {
|
|
10
|
+
[evt: string]: CustomEvent<any>;
|
|
11
|
+
};
|
|
12
|
+
slots: {
|
|
13
|
+
default: {};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
export declare type PProps = typeof __propDef.props;
|
|
17
|
+
export declare type PEvents = typeof __propDef.events;
|
|
18
|
+
export declare type PSlots = typeof __propDef.slots;
|
|
19
|
+
export default class P extends SvelteComponentTyped<PProps, PEvents, PSlots> {
|
|
20
|
+
}
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
textColor?: string;
|
|
6
|
+
secondaryClass?: string;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare type SecondaryProps = typeof __propDef.props;
|
|
16
|
+
export declare type SecondaryEvents = typeof __propDef.events;
|
|
17
|
+
export declare type SecondarySlots = typeof __propDef.slots;
|
|
18
|
+
export default class Secondary extends SvelteComponentTyped<SecondaryProps, SecondaryEvents, SecondarySlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
gradientClass?: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {
|
|
11
|
+
default: {};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare type TextGradientProps = typeof __propDef.props;
|
|
15
|
+
export declare type TextGradientEvents = typeof __propDef.events;
|
|
16
|
+
export declare type TextGradientSlots = typeof __propDef.slots;
|
|
17
|
+
export default class TextGradient extends SvelteComponentTyped<TextGradientProps, TextGradientEvents, TextGradientSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
[x: string]: any;
|
|
5
|
+
underlineClass?: string;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {
|
|
11
|
+
default: {};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare type UnderlineProps = typeof __propDef.props;
|
|
15
|
+
export declare type UnderlineEvents = typeof __propDef.events;
|
|
16
|
+
export declare type UnderlineSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Underline extends SvelteComponentTyped<UnderlineProps, UnderlineEvents, UnderlineSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
<script>import { createEventDispatcher } from 'svelte';
|
|
2
|
+
import { createPopper } from '@popperjs/core';
|
|
3
|
+
import classNames from 'classnames';
|
|
4
|
+
const dispatch = createEventDispatcher();
|
|
5
|
+
export let open = false;
|
|
6
|
+
export let placement = 'top';
|
|
7
|
+
export let offset = 8;
|
|
8
|
+
export let trigger = 'hover';
|
|
9
|
+
export let arrow = true;
|
|
10
|
+
export let animation = 'duration-300';
|
|
11
|
+
export let activeContent;
|
|
12
|
+
let clickable;
|
|
13
|
+
$: clickable = trigger === 'click';
|
|
14
|
+
let triggerEl, contentEl, popper;
|
|
15
|
+
let _blocked = false; // managment of the race condition between focusin and click events
|
|
16
|
+
const block = () => ((_blocked = true), setTimeout(() => (_blocked = false), 500));
|
|
17
|
+
const showHandler = (ev) => {
|
|
18
|
+
if (clickable && ev.type === 'focusin' && !open)
|
|
19
|
+
block();
|
|
20
|
+
open = ev.type === 'click' && !_blocked ? !open : true;
|
|
21
|
+
};
|
|
22
|
+
const hideHandler = (ev) => {
|
|
23
|
+
if (activeContent)
|
|
24
|
+
setTimeout(() => (!clickable && (triggerEl.matches(':hover') || contentEl.matches(':hover'))) ||
|
|
25
|
+
contentEl.contains(document.activeElement) ||
|
|
26
|
+
(open = false), 100);
|
|
27
|
+
else
|
|
28
|
+
open = false;
|
|
29
|
+
};
|
|
30
|
+
$: {
|
|
31
|
+
if (triggerEl && contentEl) {
|
|
32
|
+
popper = createPopper(triggerEl, contentEl, {
|
|
33
|
+
placement,
|
|
34
|
+
modifiers: [{ name: 'offset', options: { offset: [0, offset] } }]
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function enableListeners(modifiers) {
|
|
39
|
+
const modifier = modifiers.find((x) => x.name === 'eventListeners');
|
|
40
|
+
if (!modifier)
|
|
41
|
+
return [...modifiers, { name: 'eventListeners', enabled: open }];
|
|
42
|
+
modifier.enabled = open;
|
|
43
|
+
return modifiers;
|
|
44
|
+
}
|
|
45
|
+
$: {
|
|
46
|
+
if (popper) {
|
|
47
|
+
// Enable the event listeners
|
|
48
|
+
popper.setOptions(({ modifiers, ...options }) => ({
|
|
49
|
+
...options,
|
|
50
|
+
modifiers: enableListeners(modifiers)
|
|
51
|
+
}));
|
|
52
|
+
open && popper.update(); // Update the position
|
|
53
|
+
dispatch('show', open);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
let divClass;
|
|
57
|
+
$: divClass = classNames('z-10', animation && `transition-opacity ${animation}`, open ? 'visible opacity-100' : 'invisible opacity-0', $$props.class);
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<div
|
|
61
|
+
bind:this={triggerEl}
|
|
62
|
+
on:focusin={showHandler}
|
|
63
|
+
on:focusout={hideHandler}
|
|
64
|
+
on:click={clickable ? showHandler : undefined}
|
|
65
|
+
on:mouseenter={clickable ? undefined : showHandler}
|
|
66
|
+
on:mouseleave={clickable ? undefined : hideHandler}
|
|
67
|
+
class="inline-block"
|
|
68
|
+
>
|
|
69
|
+
<slot name="trigger" />
|
|
70
|
+
</div>
|
|
71
|
+
<div
|
|
72
|
+
bind:this={contentEl}
|
|
73
|
+
role="tooltip"
|
|
74
|
+
tabindex={activeContent ? -1 : undefined}
|
|
75
|
+
class={divClass}
|
|
76
|
+
on:focusin={activeContent ? showHandler : undefined}
|
|
77
|
+
on:focusout={activeContent ? hideHandler : undefined}
|
|
78
|
+
on:mouseenter={activeContent && !clickable ? showHandler : undefined}
|
|
79
|
+
on:mouseleave={activeContent && !clickable ? hideHandler : undefined}
|
|
80
|
+
>
|
|
81
|
+
<slot />
|
|
82
|
+
{#if arrow}<div data-popper-arrow />{/if}
|
|
83
|
+
</div>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Placement } from '@popperjs/core';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
placement?: Placement;
|
|
8
|
+
offset?: number;
|
|
9
|
+
trigger?: 'hover' | 'click';
|
|
10
|
+
arrow?: boolean;
|
|
11
|
+
animation?: false | `duration-${number}`;
|
|
12
|
+
activeContent: boolean;
|
|
13
|
+
};
|
|
14
|
+
events: {
|
|
15
|
+
show: CustomEvent<any>;
|
|
16
|
+
} & {
|
|
17
|
+
[evt: string]: CustomEvent<any>;
|
|
18
|
+
};
|
|
19
|
+
slots: {
|
|
20
|
+
trigger: {};
|
|
21
|
+
default: {};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare type PopperProps = typeof __propDef.props;
|
|
25
|
+
export declare type PopperEvents = typeof __propDef.events;
|
|
26
|
+
export declare type PopperSlots = typeof __propDef.slots;
|
|
27
|
+
export default class Popper extends SvelteComponentTyped<PopperProps, PopperEvents, PopperSlots> {
|
|
28
|
+
}
|
|
29
|
+
export {};
|