flowbite-svelte 0.26.5 → 0.26.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 +44 -0
- package/dropdowns/Dropdown.svelte +28 -34
- package/dropdowns/Dropdown.svelte.d.ts +1 -2
- package/dropdowns/DropdownItem.svelte +2 -2
- package/dropdowns/DropdownItem.svelte.d.ts +1 -0
- package/index.d.ts +1 -3
- package/index.js +1 -3
- package/navbar/NavLi.svelte +4 -4
- package/package.json +3 -3
- package/popover/Popover.svelte +13 -15
- package/popover/Popover.svelte.d.ts +1 -0
- package/tooltips/Tooltip.svelte +14 -9
- package/tooltips/Tooltip.svelte.d.ts +0 -1
- package/typography/A.svelte +1 -2
- package/typography/A.svelte.d.ts +0 -1
- package/typography/Blockquote.svelte +23 -14
- package/typography/Blockquote.svelte.d.ts +1 -1
- package/typography/Layout.svelte +10 -0
- package/typography/Layout.svelte.d.ts +20 -0
- package/typography/P.svelte +73 -5
- package/typography/P.svelte.d.ts +12 -3
- package/typography/Span.svelte +11 -1
- package/typography/Span.svelte.d.ts +9 -1
- package/typography/Underline.svelte +2 -2
- package/utils/Chevron.svelte +23 -0
- package/utils/Chevron.svelte.d.ts +19 -0
- package/utils/Frame.svelte +21 -12
- package/utils/Frame.svelte.d.ts +13 -4
- package/utils/Popper.svelte +13 -13
- package/utils/Popper.svelte.d.ts +0 -1
- package/typography/Highlight.svelte +0 -7
- package/typography/Highlight.svelte.d.ts +0 -19
- package/typography/TextGradient.svelte +0 -7
- package/typography/TextGradient.svelte.d.ts +0 -19
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,50 @@
|
|
|
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.8](https://github.com/themesberg/flowbite-svelte/compare/v0.26.7...v0.26.8) (2022-09-03)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* dropdown button ([f6347f2](https://github.com/themesberg/flowbite-svelte/commit/f6347f280cbfc552d001aa22128026174b46a6f3))
|
|
11
|
+
* more Frame inheritance ([bb72d69](https://github.com/themesberg/flowbite-svelte/commit/bb72d6952386bd0f6dec4711795e3591a6837c02))
|
|
12
|
+
* popover finalization ([c71481e](https://github.com/themesberg/flowbite-svelte/commit/c71481ec18e2850488d86cfdb583587eae4a19b2))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* missing 683restProps ([0d52fd1](https://github.com/themesberg/flowbite-svelte/commit/0d52fd1b4168c8cc707c174dc2c18f532cf2e93c))
|
|
18
|
+
* no triggers error ([83075e1](https://github.com/themesberg/flowbite-svelte/commit/83075e1a969bdf93a520bd9e35b339e36bf4f325))
|
|
19
|
+
* remove unused imports ([acb58b9](https://github.com/themesberg/flowbite-svelte/commit/acb58b9144948feeb3c1c14b41a71d2122187340))
|
|
20
|
+
|
|
21
|
+
### [0.26.7](https://github.com/themesberg/flowbite-svelte/compare/v0.26.6...v0.26.7) (2022-09-03)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* add Layout component ([2204586](https://github.com/themesberg/flowbite-svelte/commit/22045861703bf3e46cc7900e15c4db64d5246c50))
|
|
27
|
+
* add paragraphs page ([db973a3](https://github.com/themesberg/flowbite-svelte/commit/db973a3929bfdc8c4dd48338cc114bdc2c808fb8))
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### Bug Fixes
|
|
31
|
+
|
|
32
|
+
* add html block to text page ([37e910a](https://github.com/themesberg/flowbite-svelte/commit/37e910ae269099865865580d419b8dd05dccb7a8))
|
|
33
|
+
|
|
34
|
+
### [0.26.6](https://github.com/themesberg/flowbite-svelte/compare/v0.26.5...v0.26.6) (2022-09-02)
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
### Features
|
|
38
|
+
|
|
39
|
+
* add highlight to Span component and update heading page ([d47121b](https://github.com/themesberg/flowbite-svelte/commit/d47121ba47e6c6e3dfdd366128f51da77a966e0f))
|
|
40
|
+
* add Text decoration examples to text page ([fe074cd](https://github.com/themesberg/flowbite-svelte/commit/fe074cd2a36d780333444f276de69edec51649d5))
|
|
41
|
+
* add underline and decoratio class to Span ([f3b11a9](https://github.com/themesberg/flowbite-svelte/commit/f3b11a92b3782c27e09f25c894a81402661b73d3))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Bug Fixes
|
|
45
|
+
|
|
46
|
+
* header blocking anchor links ([af6d2d6](https://github.com/themesberg/flowbite-svelte/commit/af6d2d6eb9bb630e58e76fd214f8a14f0435dc2f))
|
|
47
|
+
* remove TextGradient and Underline ([cb7b2d7](https://github.com/themesberg/flowbite-svelte/commit/cb7b2d753f110cad4677f990d60a11154e38ac93))
|
|
48
|
+
|
|
5
49
|
### [0.26.5](https://github.com/themesberg/flowbite-svelte/compare/v0.26.4...v0.26.5) (2022-09-02)
|
|
6
50
|
|
|
7
51
|
|
|
@@ -1,26 +1,13 @@
|
|
|
1
|
-
<script>import
|
|
2
|
-
import
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
import Button from '../buttons/Button.svelte';
|
|
3
3
|
import Popper from '../utils/Popper.svelte';
|
|
4
|
-
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';
|
|
4
|
+
import Chevron from '../utils/Chevron.svelte';
|
|
9
5
|
export let label = '';
|
|
10
6
|
export let inline = false;
|
|
11
7
|
export let arrowIcon = true;
|
|
12
8
|
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';
|
|
13
9
|
export let placement = 'bottom';
|
|
14
10
|
export let open = false;
|
|
15
|
-
export let triggeredBy = undefined;
|
|
16
|
-
const icons = {
|
|
17
|
-
top: ChevronUp,
|
|
18
|
-
right: ChevronRight,
|
|
19
|
-
bottom: ChevronDown,
|
|
20
|
-
left: ChevronLeft
|
|
21
|
-
};
|
|
22
|
-
// @ts-ignore
|
|
23
|
-
$: icon = icons[placement.split('-')[0]];
|
|
24
11
|
let popoverClass;
|
|
25
12
|
$: popoverClass = classNames('outline-none', $$props.class);
|
|
26
13
|
</script>
|
|
@@ -28,33 +15,40 @@ $: popoverClass = classNames('outline-none', $$props.class);
|
|
|
28
15
|
{#if label}
|
|
29
16
|
<slot name="trigger">
|
|
30
17
|
{#if inline}
|
|
31
|
-
<button class={labelClass}
|
|
32
|
-
<slot name="label">{label}</slot>
|
|
18
|
+
<button class={labelClass}>
|
|
33
19
|
{#if arrowIcon}
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
20
|
+
<Chevron {placement}><slot name="label">{label}</slot></Chevron>
|
|
21
|
+
{:else}
|
|
22
|
+
<slot name="label">{label}</slot>
|
|
37
23
|
{/if}
|
|
38
24
|
</button>
|
|
39
25
|
{:else}
|
|
40
|
-
<Button
|
|
41
|
-
<slot name="label">{label}</slot>
|
|
26
|
+
<Button>
|
|
42
27
|
{#if arrowIcon}
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
28
|
+
<Chevron {placement}><slot name="label">{label}</slot></Chevron>
|
|
29
|
+
{:else}
|
|
30
|
+
<slot name="label">{label}</slot>
|
|
46
31
|
{/if}
|
|
47
32
|
</Button>
|
|
48
33
|
{/if}
|
|
49
34
|
</slot>
|
|
50
35
|
{/if}
|
|
51
36
|
|
|
52
|
-
<Popper
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
37
|
+
<Popper
|
|
38
|
+
rounded
|
|
39
|
+
border
|
|
40
|
+
shadow
|
|
41
|
+
activeContent
|
|
42
|
+
arrow={false}
|
|
43
|
+
{placement}
|
|
44
|
+
trigger="click"
|
|
45
|
+
{...$$restProps}
|
|
46
|
+
class={popoverClass}
|
|
47
|
+
on:show
|
|
48
|
+
bind:open>
|
|
49
|
+
<slot name="content">
|
|
50
|
+
<ul class="py-1">
|
|
51
|
+
<slot />
|
|
52
|
+
</ul>
|
|
53
|
+
</slot>
|
|
60
54
|
</Popper>
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
2
|
export let liClass = 'block font-medium cursor-pointer py-2 px-4 text-sm hover:bg-gray-100 dark:hover:bg-gray-600';
|
|
3
3
|
export let color = 'default';
|
|
4
|
+
export let tabindex = 0;
|
|
4
5
|
const colors = {
|
|
5
6
|
default: 'text-gray-700 dark:text-gray-200 dark:hover:text-white',
|
|
6
7
|
red: 'text-red-600 dark:text-red-500'
|
|
@@ -18,7 +19,6 @@ const colors = {
|
|
|
18
19
|
on:blur
|
|
19
20
|
on:mouseenter
|
|
20
21
|
on:mouseleave
|
|
21
|
-
tabindex
|
|
22
|
-
>
|
|
22
|
+
{tabindex}>
|
|
23
23
|
<slot />
|
|
24
24
|
</li>
|
package/index.d.ts
CHANGED
|
@@ -110,17 +110,15 @@ export { default as A } from './typography/A.svelte';
|
|
|
110
110
|
export { default as Blockquote } from './typography/Blockquote.svelte';
|
|
111
111
|
export { default as DescriptionList } from './typography/DescriptionList.svelte';
|
|
112
112
|
export { default as Heading } from './typography/Heading.svelte';
|
|
113
|
-
export { default as Highlight } from './typography/Highlight.svelte';
|
|
114
113
|
export { default as Hr } from './typography/Hr.svelte';
|
|
115
114
|
export { default as Img } from './typography/Img.svelte';
|
|
115
|
+
export { default as Layout } from './typography/Layout.svelte';
|
|
116
116
|
export { default as Li } from './typography/Li.svelte';
|
|
117
117
|
export { default as Mark } from './typography/Mark.svelte';
|
|
118
118
|
export { default as List } from './typography/List.svelte';
|
|
119
119
|
export { default as P } from './typography/P.svelte';
|
|
120
120
|
export { default as Secondary } from './typography/Secondary.svelte';
|
|
121
121
|
export { default as Span } from './typography/Span.svelte';
|
|
122
|
-
export { default as TextGradient } from './typography/TextGradient.svelte';
|
|
123
|
-
export { default as Underline } from './typography/Underline.svelte';
|
|
124
122
|
export { default as CloseButton } from './utils/CloseButton.svelte';
|
|
125
123
|
export { default as ChevronDown } from './utils/ChevronDown.svelte';
|
|
126
124
|
export { default as ChevronLeft } from './utils/ChevronLeft.svelte';
|
package/index.js
CHANGED
|
@@ -143,17 +143,15 @@ export { default as A } from './typography/A.svelte';
|
|
|
143
143
|
export { default as Blockquote } from './typography/Blockquote.svelte';
|
|
144
144
|
export { default as DescriptionList } from './typography/DescriptionList.svelte';
|
|
145
145
|
export { default as Heading } from './typography/Heading.svelte';
|
|
146
|
-
export { default as Highlight } from './typography/Highlight.svelte';
|
|
147
146
|
export { default as Hr } from './typography/Hr.svelte';
|
|
148
147
|
export { default as Img } from './typography/Img.svelte';
|
|
148
|
+
export { default as Layout } from './typography/Layout.svelte';
|
|
149
149
|
export { default as Li } from './typography/Li.svelte';
|
|
150
150
|
export { default as Mark } from './typography/Mark.svelte';
|
|
151
151
|
export { default as List } from './typography/List.svelte';
|
|
152
152
|
export { default as P } from './typography/P.svelte';
|
|
153
153
|
export { default as Secondary } from './typography/Secondary.svelte';
|
|
154
154
|
export { default as Span } from './typography/Span.svelte';
|
|
155
|
-
export { default as TextGradient } from './typography/TextGradient.svelte';
|
|
156
|
-
export { default as Underline } from './typography/Underline.svelte';
|
|
157
155
|
// utils
|
|
158
156
|
export { default as CloseButton } from './utils/CloseButton.svelte';
|
|
159
157
|
export { default as ChevronDown } from './utils/ChevronDown.svelte';
|
package/navbar/NavLi.svelte
CHANGED
|
@@ -7,7 +7,8 @@ $: aClass = active ? activeClass : nonActiveClass;
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<li>
|
|
10
|
-
<
|
|
10
|
+
<svelte:element
|
|
11
|
+
this={href ? 'a' : 'div'}
|
|
11
12
|
{href}
|
|
12
13
|
{...$$restProps}
|
|
13
14
|
on:blur
|
|
@@ -20,8 +21,7 @@ $: aClass = active ? activeClass : nonActiveClass;
|
|
|
20
21
|
on:mouseenter
|
|
21
22
|
on:mouseleave
|
|
22
23
|
on:mouseover
|
|
23
|
-
class={classNames(aClass, $$props.class)}
|
|
24
|
-
>
|
|
24
|
+
class={classNames(aClass, $$props.class)}>
|
|
25
25
|
<slot />
|
|
26
|
-
</
|
|
26
|
+
</svelte:element>
|
|
27
27
|
</li>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "flowbite-svelte",
|
|
3
|
-
"version": "0.26.
|
|
3
|
+
"version": "0.26.8",
|
|
4
4
|
"description": "Flowbite components for Svelte",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"author": {
|
|
@@ -222,18 +222,18 @@
|
|
|
222
222
|
"./typography/Blockquote.svelte": "./typography/Blockquote.svelte",
|
|
223
223
|
"./typography/DescriptionList.svelte": "./typography/DescriptionList.svelte",
|
|
224
224
|
"./typography/Heading.svelte": "./typography/Heading.svelte",
|
|
225
|
-
"./typography/Highlight.svelte": "./typography/Highlight.svelte",
|
|
226
225
|
"./typography/Hr.svelte": "./typography/Hr.svelte",
|
|
227
226
|
"./typography/Img.svelte": "./typography/Img.svelte",
|
|
227
|
+
"./typography/Layout.svelte": "./typography/Layout.svelte",
|
|
228
228
|
"./typography/Li.svelte": "./typography/Li.svelte",
|
|
229
229
|
"./typography/List.svelte": "./typography/List.svelte",
|
|
230
230
|
"./typography/Mark.svelte": "./typography/Mark.svelte",
|
|
231
231
|
"./typography/P.svelte": "./typography/P.svelte",
|
|
232
232
|
"./typography/Secondary.svelte": "./typography/Secondary.svelte",
|
|
233
233
|
"./typography/Span.svelte": "./typography/Span.svelte",
|
|
234
|
-
"./typography/TextGradient.svelte": "./typography/TextGradient.svelte",
|
|
235
234
|
"./typography/Ul.svelte": "./typography/Ul.svelte",
|
|
236
235
|
"./typography/Underline.svelte": "./typography/Underline.svelte",
|
|
236
|
+
"./utils/Chevron.svelte": "./utils/Chevron.svelte",
|
|
237
237
|
"./utils/ChevronDown.svelte": "./utils/ChevronDown.svelte",
|
|
238
238
|
"./utils/ChevronLeft.svelte": "./utils/ChevronLeft.svelte",
|
|
239
239
|
"./utils/ChevronRight.svelte": "./utils/ChevronRight.svelte",
|
package/popover/Popover.svelte
CHANGED
|
@@ -1,20 +1,18 @@
|
|
|
1
1
|
<script>import Popper from '../utils/Popper.svelte';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
2
|
export let title = '';
|
|
4
|
-
let
|
|
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);
|
|
3
|
+
export let defaultClass = 'py-2 px-3';
|
|
6
4
|
</script>
|
|
7
5
|
|
|
8
|
-
<Popper activeContent
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
6
|
+
<Popper activeContent border shadow rounded {...$$restProps} class={$$props.class} on:show>
|
|
7
|
+
{#if $$slots.title || title}
|
|
8
|
+
<div
|
|
9
|
+
class="py-2 px-3 bg-gray-100 rounded-t-lg border-b border-gray-200 dark:border-gray-600 dark:bg-gray-700">
|
|
10
|
+
<slot name="title">
|
|
11
|
+
<h3 class="font-semibold text-gray-900 dark:text-white">{title}</h3>
|
|
12
|
+
</slot>
|
|
13
|
+
</div>
|
|
14
|
+
{/if}
|
|
15
|
+
<div class={defaultClass}>
|
|
16
|
+
<slot />
|
|
17
|
+
</div>
|
|
20
18
|
</Popper>
|
package/tooltips/Tooltip.svelte
CHANGED
|
@@ -1,19 +1,24 @@
|
|
|
1
1
|
<script>import Popper from '../utils/Popper.svelte';
|
|
2
2
|
import classNames from 'classnames';
|
|
3
|
-
export let color = '';
|
|
4
|
-
export let style = '
|
|
5
|
-
export let tipClass = 'py-2 px-3 text-sm font-medium
|
|
6
|
-
export let triggeredBy;
|
|
3
|
+
export let color = 'custom';
|
|
4
|
+
export let style = 'auto';
|
|
5
|
+
export let tipClass = 'py-2 px-3 text-sm font-medium';
|
|
7
6
|
const colors = {
|
|
8
|
-
dark: 'border
|
|
9
|
-
light: 'border
|
|
10
|
-
auto: 'border
|
|
11
|
-
custom: color
|
|
7
|
+
dark: 'border-gray-800 bg-gray-900 text-white dark:bg-gray-700 dark:border-gray-600',
|
|
8
|
+
light: 'border-gray-200 bg-white text-gray-900',
|
|
9
|
+
auto: 'border-gray-200 bg-white text-gray-900 dark:bg-gray-700 dark:text-white dark:border-gray-600 '
|
|
12
10
|
};
|
|
13
11
|
let toolTipClass;
|
|
14
12
|
$: toolTipClass = classNames(tipClass, colors[style], $$props.class);
|
|
15
13
|
</script>
|
|
16
14
|
|
|
17
|
-
<Popper
|
|
15
|
+
<Popper
|
|
16
|
+
rounded
|
|
17
|
+
border
|
|
18
|
+
shadow
|
|
19
|
+
color={style === 'custom' ? color : 'none'}
|
|
20
|
+
{...$$restProps}
|
|
21
|
+
class={toolTipClass}
|
|
22
|
+
on:show>
|
|
18
23
|
<slot />
|
|
19
24
|
</Popper>
|
package/typography/A.svelte
CHANGED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
export let href = '#';
|
|
3
3
|
export let textColor = 'text-blue-600 dark:text-blue-500';
|
|
4
4
|
export let aClass = 'inline-flex items-center hover:underline';
|
|
5
|
-
export let textSize = 'text-lg';
|
|
6
5
|
</script>
|
|
7
6
|
|
|
8
|
-
<a {href} class={classNames(aClass, textColor,
|
|
7
|
+
<a {href} class={classNames(aClass, textColor, $$props.class)}>
|
|
9
8
|
<slot />
|
|
10
9
|
</a>
|
package/typography/A.svelte.d.ts
CHANGED
|
@@ -11,24 +11,33 @@ let alignmentClasses = {
|
|
|
11
11
|
center: 'text-center',
|
|
12
12
|
right: 'text-right'
|
|
13
13
|
};
|
|
14
|
-
export let size = '
|
|
15
|
-
|
|
14
|
+
export let size = 'lg';
|
|
15
|
+
const sizes = {
|
|
16
|
+
xs: 'text-xs',
|
|
17
|
+
sm: 'text-sm',
|
|
18
|
+
base: 'text-base',
|
|
16
19
|
lg: 'text-lg',
|
|
17
20
|
xl: 'text-xl',
|
|
18
|
-
|
|
21
|
+
'2xl': 'text-2xl',
|
|
22
|
+
'3xl': 'text-3xl',
|
|
23
|
+
'4xl': 'text-4xl',
|
|
24
|
+
'5xl': 'text-5xl',
|
|
25
|
+
'6xl': 'text-6xl',
|
|
26
|
+
'7xl': 'text-7xl',
|
|
27
|
+
'8xl': 'text-8xl',
|
|
28
|
+
'9xl': 'text-9xl'
|
|
19
29
|
};
|
|
20
30
|
</script>
|
|
21
31
|
|
|
22
32
|
<blockquote
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
<slot />
|
|
33
|
+
class={classNames(
|
|
34
|
+
baseClass,
|
|
35
|
+
alignmentClasses[alignment],
|
|
36
|
+
sizes[size],
|
|
37
|
+
bg && bgClass,
|
|
38
|
+
border && borderClass,
|
|
39
|
+
italic && 'italic',
|
|
40
|
+
$$props.class
|
|
41
|
+
)}>
|
|
42
|
+
<slot />
|
|
34
43
|
</blockquote>
|
|
@@ -9,7 +9,7 @@ declare const __propDef: {
|
|
|
9
9
|
bg?: boolean;
|
|
10
10
|
baseClass?: string;
|
|
11
11
|
alignment?: 'left' | 'center' | 'right';
|
|
12
|
-
size?: 'lg' | 'xl' | '
|
|
12
|
+
size?: 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
|
|
13
13
|
};
|
|
14
14
|
events: {
|
|
15
15
|
[evt: string]: CustomEvent<any>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<script>import classNames from 'classnames';
|
|
2
|
+
export let divClass = 'grid';
|
|
3
|
+
export let cols = 'grid-cols-1 sm:grid-cols-2';
|
|
4
|
+
export let gap;
|
|
5
|
+
let classDiv = classNames(divClass, 'gap-' + String(gap), cols);
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<div class={classDiv}>
|
|
9
|
+
<slot />
|
|
10
|
+
</div>
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
divClass?: string;
|
|
5
|
+
cols?: string;
|
|
6
|
+
gap: number;
|
|
7
|
+
};
|
|
8
|
+
events: {
|
|
9
|
+
[evt: string]: CustomEvent<any>;
|
|
10
|
+
};
|
|
11
|
+
slots: {
|
|
12
|
+
default: {};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare type LayoutProps = typeof __propDef.props;
|
|
16
|
+
export declare type LayoutEvents = typeof __propDef.events;
|
|
17
|
+
export declare type LayoutSlots = typeof __propDef.slots;
|
|
18
|
+
export default class Layout extends SvelteComponentTyped<LayoutProps, LayoutEvents, LayoutSlots> {
|
|
19
|
+
}
|
|
20
|
+
export {};
|
package/typography/P.svelte
CHANGED
|
@@ -1,9 +1,77 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let
|
|
3
|
-
export let
|
|
4
|
-
export let
|
|
2
|
+
export let color = 'text-gray-900 dark:text-white';
|
|
3
|
+
export let height = 'normal';
|
|
4
|
+
export let align = 'left';
|
|
5
|
+
export let justify = false;
|
|
6
|
+
export let italic = false;
|
|
7
|
+
export let firstupper = false;
|
|
8
|
+
export let upperClass = 'first-line:uppercase first-line:tracking-widest first-letter:text-7xl first-letter:font-bold first-letter:text-gray-900 dark:first-letter:text-gray-100 first-letter:mr-3 first-letter:float-left';
|
|
9
|
+
export let opacity;
|
|
10
|
+
export let whitespace = 'normal';
|
|
11
|
+
export let size = 'base';
|
|
12
|
+
export let space;
|
|
13
|
+
export let weight;
|
|
14
|
+
const sizes = {
|
|
15
|
+
xs: 'text-xs',
|
|
16
|
+
sm: 'text-sm',
|
|
17
|
+
base: 'text-base',
|
|
18
|
+
lg: 'text-lg',
|
|
19
|
+
xl: 'text-xl',
|
|
20
|
+
'2xl': 'text-2xl',
|
|
21
|
+
'3xl': 'text-3xl',
|
|
22
|
+
'4xl': 'text-4xl',
|
|
23
|
+
'5xl': 'text-5xl',
|
|
24
|
+
'6xl': 'text-6xl',
|
|
25
|
+
'7xl': 'text-7xl',
|
|
26
|
+
'8xl': 'text-8xl',
|
|
27
|
+
'9xl': 'text-9xl'
|
|
28
|
+
};
|
|
29
|
+
const weights = {
|
|
30
|
+
thin: 'font-thin',
|
|
31
|
+
extralight: 'font-extralight',
|
|
32
|
+
light: 'font-light',
|
|
33
|
+
normal: 'font-normal',
|
|
34
|
+
medium: 'font-medium',
|
|
35
|
+
semibold: 'font-semibold',
|
|
36
|
+
bold: 'font-bold',
|
|
37
|
+
extrabold: 'font-extrabold',
|
|
38
|
+
black: 'font-black'
|
|
39
|
+
};
|
|
40
|
+
const spaces = {
|
|
41
|
+
tighter: 'tracking-tighter',
|
|
42
|
+
tight: 'tracking-tight',
|
|
43
|
+
normal: 'tracking-normal',
|
|
44
|
+
wide: 'tracking-wide',
|
|
45
|
+
wider: 'tracking-wider',
|
|
46
|
+
widest: 'tracking-widest'
|
|
47
|
+
};
|
|
48
|
+
const heights = {
|
|
49
|
+
normal: 'leading-normal',
|
|
50
|
+
relaxed: 'leading-relaxed',
|
|
51
|
+
loose: 'leading-loose'
|
|
52
|
+
};
|
|
53
|
+
const aligns = {
|
|
54
|
+
left: 'text-left',
|
|
55
|
+
center: 'text-center',
|
|
56
|
+
right: 'text-right'
|
|
57
|
+
};
|
|
58
|
+
const whitespaces = {
|
|
59
|
+
normal: 'whitespace-normal',
|
|
60
|
+
nowrap: 'whitespace-nowrap',
|
|
61
|
+
pre: 'whitespace-pre',
|
|
62
|
+
preline: 'whitespace-pre-line',
|
|
63
|
+
prewrap: 'whitespace-pre-wrap'
|
|
64
|
+
};
|
|
65
|
+
let colorAndopacity = color
|
|
66
|
+
.split(' ')
|
|
67
|
+
.map((element) => element.trim())
|
|
68
|
+
.map((element) => element + '/' + String(opacity))
|
|
69
|
+
.join(' ');
|
|
70
|
+
// console.log('colorArr', colorAndopacity);
|
|
71
|
+
// console.log(typeof colorAndopacity);
|
|
72
|
+
let classP = classNames(size && sizes[size], (opacity && colorAndopacity) || (color && color), height && heights[height], weight && weights[weight], space && spaces[space], align && aligns[align], justify && 'text-justify', italic && 'italic', firstupper && upperClass, whitespace && whitespaces[whitespace], $$props.class);
|
|
5
73
|
</script>
|
|
6
74
|
|
|
7
|
-
<p class={
|
|
8
|
-
|
|
75
|
+
<p class={classP}>
|
|
76
|
+
<slot />
|
|
9
77
|
</p>
|
package/typography/P.svelte.d.ts
CHANGED
|
@@ -2,9 +2,18 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
color?: string;
|
|
6
|
+
height?: 'normal' | 'relaxed' | 'loose';
|
|
7
|
+
align?: 'left' | 'center' | 'right';
|
|
8
|
+
justify?: boolean;
|
|
9
|
+
italic?: boolean;
|
|
10
|
+
firstupper?: boolean;
|
|
11
|
+
upperClass?: string;
|
|
12
|
+
opacity: number;
|
|
13
|
+
whitespace?: 'normal' | 'nowrap' | 'pre' | 'preline' | 'prewrap';
|
|
14
|
+
size?: 'xs' | 'sm' | 'base' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | '8xl' | '9xl';
|
|
15
|
+
space: 'tighter' | 'tight' | 'normal' | 'wide' | 'wider' | 'widest';
|
|
16
|
+
weight: 'thin' | 'extralight' | 'light' | 'normal' | 'medium' | 'semibold' | 'bold' | 'extrabold' | 'black';
|
|
8
17
|
};
|
|
9
18
|
events: {
|
|
10
19
|
[evt: string]: CustomEvent<any>;
|
package/typography/Span.svelte
CHANGED
|
@@ -1,5 +1,15 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let
|
|
2
|
+
export let italic = false;
|
|
3
|
+
export let underline = false;
|
|
4
|
+
export let linethrough = false;
|
|
5
|
+
export let uppercase = false;
|
|
6
|
+
export let gradient = false;
|
|
7
|
+
export let highlight = false;
|
|
8
|
+
export let highlightClass = 'text-blue-600 dark:text-blue-500';
|
|
9
|
+
export let decorationClass = 'decoration-2 decoration-blue-400 dark:decoration-blue-600';
|
|
10
|
+
export let gradientClass = 'text-transparent bg-clip-text bg-gradient-to-r to-emerald-600 from-sky-400';
|
|
11
|
+
let underlineClass = classNames('underline', decorationClass);
|
|
12
|
+
let classSpan = classNames(italic && 'italic', underline && underlineClass, linethrough && 'line-through', uppercase && 'uppercase', gradient ? gradientClass : 'font-semibold text-gray-900 dark:text-white', highlight && highlightClass, $$props.class);
|
|
3
13
|
</script>
|
|
4
14
|
|
|
5
15
|
<span class={classSpan}>
|
|
@@ -2,7 +2,15 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
2
2
|
declare const __propDef: {
|
|
3
3
|
props: {
|
|
4
4
|
[x: string]: any;
|
|
5
|
-
|
|
5
|
+
italic?: boolean;
|
|
6
|
+
underline?: boolean;
|
|
7
|
+
linethrough?: boolean;
|
|
8
|
+
uppercase?: boolean;
|
|
9
|
+
gradient?: boolean;
|
|
10
|
+
highlight?: boolean;
|
|
11
|
+
highlightClass?: string;
|
|
12
|
+
decorationClass?: string;
|
|
13
|
+
gradientClass?: string;
|
|
6
14
|
};
|
|
7
15
|
events: {
|
|
8
16
|
[evt: string]: CustomEvent<any>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
|
-
export let underlineClass = 'underline
|
|
2
|
+
export let underlineClass = 'underline decoration-8 decoration-blue-400 dark:decoration-blue-600';
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<span class={classNames(underlineClass, $$props.class)}>
|
|
6
|
-
|
|
6
|
+
<slot />
|
|
7
7
|
</span>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script>import ChevronDown from './ChevronDown.svelte';
|
|
2
|
+
import ChevronLeft from './ChevronLeft.svelte';
|
|
3
|
+
import ChevronUp from './ChevronUp.svelte';
|
|
4
|
+
import ChevronRight from './ChevronRight.svelte';
|
|
5
|
+
export let placement = 'bottom';
|
|
6
|
+
const icons = {
|
|
7
|
+
top: ChevronUp,
|
|
8
|
+
right: ChevronRight,
|
|
9
|
+
bottom: ChevronDown,
|
|
10
|
+
left: ChevronLeft
|
|
11
|
+
};
|
|
12
|
+
// @ts-ignore
|
|
13
|
+
let icon;
|
|
14
|
+
$: icon = icons[placement.split('-')[0]] ?? ChevronDown;
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
{#if placement.split('-')[0] === 'left'}
|
|
18
|
+
<ChevronLeft class="h-4 w-4 mr-2" />
|
|
19
|
+
<slot />
|
|
20
|
+
{:else}
|
|
21
|
+
<slot />
|
|
22
|
+
<svelte:component this={icon} class="h-4 w-4 ml-2" />
|
|
23
|
+
{/if}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { Placement } from '@popperjs/core';
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
placement?: Placement;
|
|
6
|
+
};
|
|
7
|
+
events: {
|
|
8
|
+
[evt: string]: CustomEvent<any>;
|
|
9
|
+
};
|
|
10
|
+
slots: {
|
|
11
|
+
default: {};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
export declare type ChevronProps = typeof __propDef.props;
|
|
15
|
+
export declare type ChevronEvents = typeof __propDef.events;
|
|
16
|
+
export declare type ChevronSlots = typeof __propDef.slots;
|
|
17
|
+
export default class Chevron extends SvelteComponentTyped<ChevronProps, ChevronEvents, ChevronSlots> {
|
|
18
|
+
}
|
|
19
|
+
export {};
|
package/utils/Frame.svelte
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script>import classNames from 'classnames';
|
|
2
2
|
import { setContext } from 'svelte';
|
|
3
|
-
import
|
|
3
|
+
import { noop } from 'svelte/internal';
|
|
4
4
|
setContext('background', true);
|
|
5
5
|
$: setContext('color', color);
|
|
6
6
|
export let tag = 'div';
|
|
@@ -8,10 +8,14 @@ export let color = 'default';
|
|
|
8
8
|
export let rounded = false;
|
|
9
9
|
export let border = false;
|
|
10
10
|
export let shadow = false;
|
|
11
|
-
// Export a prop through which you can set a desired transition
|
|
11
|
+
// Export a prop through which you can set a desired svelte transition
|
|
12
12
|
export let transition = undefined;
|
|
13
13
|
// Pass in extra transition params
|
|
14
14
|
export let params = {};
|
|
15
|
+
// For components development
|
|
16
|
+
export let node = undefined;
|
|
17
|
+
export let use = noop;
|
|
18
|
+
export let options = {};
|
|
15
19
|
// your script goes here
|
|
16
20
|
const bgColors = {
|
|
17
21
|
gray: 'bg-gray-100 dark:bg-gray-200 ',
|
|
@@ -57,17 +61,22 @@ const borderColors = {
|
|
|
57
61
|
};
|
|
58
62
|
// have a custom transition function that returns the desired transition
|
|
59
63
|
let transitionFunc;
|
|
60
|
-
$: transitionFunc =
|
|
64
|
+
// $: transitionFunc = (node: Element) => (transition ? transition(node, params) : noop);
|
|
65
|
+
$: transitionFunc = transition ?? noop;
|
|
61
66
|
let divClass;
|
|
62
67
|
$: divClass = classNames(bgColors[color], textColors[color], rounded && 'rounded-lg ', border && 'border', borderColors[color], shadow && 'shadow-md', $$props.class);
|
|
63
68
|
</script>
|
|
64
69
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
<svelte:element
|
|
71
|
+
this={tag}
|
|
72
|
+
use:use={options}
|
|
73
|
+
bind:this={node}
|
|
74
|
+
transition:transitionFunc={params}
|
|
75
|
+
{...$$restProps}
|
|
76
|
+
class={divClass}
|
|
77
|
+
on:mouseenter
|
|
78
|
+
on:mouseleave
|
|
79
|
+
on:focusin
|
|
80
|
+
on:focusout>
|
|
81
|
+
<slot />
|
|
82
|
+
</svelte:element>
|
package/utils/Frame.svelte.d.ts
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Action } from 'svelte/action';
|
|
3
|
+
import type { TransitionConfig } from 'svelte/transition';
|
|
3
4
|
declare const __propDef: {
|
|
4
5
|
props: {
|
|
5
6
|
[x: string]: any;
|
|
6
|
-
tag?:
|
|
7
|
+
tag?: 'div' | 'a';
|
|
7
8
|
color?: string;
|
|
8
9
|
rounded?: boolean;
|
|
9
10
|
border?: boolean;
|
|
10
11
|
shadow?: boolean;
|
|
11
|
-
transition?:
|
|
12
|
-
params?:
|
|
12
|
+
transition?: (node: Element, params: object) => TransitionConfig;
|
|
13
|
+
params?: object;
|
|
14
|
+
node?: HTMLElement;
|
|
15
|
+
use?: Action;
|
|
16
|
+
options?: {};
|
|
13
17
|
};
|
|
14
18
|
events: {
|
|
19
|
+
mouseenter: MouseEvent;
|
|
20
|
+
mouseleave: MouseEvent;
|
|
21
|
+
focusin: FocusEvent;
|
|
22
|
+
focusout: FocusEvent;
|
|
23
|
+
} & {
|
|
15
24
|
[evt: string]: CustomEvent<any>;
|
|
16
25
|
};
|
|
17
26
|
slots: {
|
package/utils/Popper.svelte
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
<script>import { onMount } from 'svelte';
|
|
2
|
-
import { fade } from 'svelte/transition';
|
|
3
2
|
import { createPopper } from '@popperjs/core';
|
|
4
3
|
import classNames from 'classnames';
|
|
5
4
|
import createEventDispatcher from './createEventDispatcher';
|
|
5
|
+
import Frame from './Frame.svelte';
|
|
6
6
|
export let activeContent = false;
|
|
7
|
-
export let animation = 100;
|
|
8
7
|
export let arrow = true;
|
|
9
8
|
export let offset = 8;
|
|
10
9
|
export let placement = 'top';
|
|
@@ -77,12 +76,12 @@ onMount(() => {
|
|
|
77
76
|
['mouseenter', showHandler, !clickable],
|
|
78
77
|
['mouseleave', hideHandler, !clickable]
|
|
79
78
|
];
|
|
80
|
-
|
|
79
|
+
if (triggeredBy)
|
|
80
|
+
triggerEls = [...document.querySelectorAll(triggeredBy)];
|
|
81
|
+
else
|
|
82
|
+
triggerEls = contentEl.previousElementSibling ? [contentEl.previousElementSibling] : [];
|
|
81
83
|
if (!triggerEls.length) {
|
|
82
|
-
|
|
83
|
-
triggerEls.push(contentEl.previousElementSibling);
|
|
84
|
-
else
|
|
85
|
-
console.error('No triggers found.');
|
|
84
|
+
console.error('No triggers found.');
|
|
86
85
|
}
|
|
87
86
|
triggerEls.forEach((element) => {
|
|
88
87
|
if (element.tabIndex < 0)
|
|
@@ -108,18 +107,19 @@ onMount(() => {
|
|
|
108
107
|
{/if}
|
|
109
108
|
|
|
110
109
|
{#if open && triggerEl}
|
|
111
|
-
<
|
|
112
|
-
use
|
|
113
|
-
|
|
110
|
+
<Frame
|
|
111
|
+
use={init}
|
|
112
|
+
options={triggerEl}
|
|
114
113
|
role="tooltip"
|
|
115
114
|
tabIndex={activeContent ? -1 : undefined}
|
|
116
|
-
class={classNames('z-10', $$props.class)}
|
|
117
115
|
on:focusin={activeContent ? showHandler : undefined}
|
|
118
116
|
on:focusout={activeContent ? hideHandler : undefined}
|
|
119
|
-
on:mouseenter={
|
|
117
|
+
on:mouseenter={showHandler}
|
|
120
118
|
on:mouseleave={activeContent && !clickable ? hideHandler : undefined}
|
|
119
|
+
{...$$restProps}
|
|
120
|
+
class={classNames('z-10', $$props.class)}
|
|
121
121
|
style="position: absolute;">
|
|
122
122
|
<slot />
|
|
123
123
|
{#if arrow}<div data-popper-arrow />{/if}
|
|
124
|
-
</
|
|
124
|
+
</Frame>
|
|
125
125
|
{/if}
|
package/utils/Popper.svelte.d.ts
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,19 +0,0 @@
|
|
|
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 {};
|