sve-ui 0.1.0 → 0.1.2
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/LICENCE +21 -0
- package/README.md +91 -2
- package/dist/components/Box/Box.svelte +14 -4
- package/dist/components/Box/Box.svelte.d.ts +36 -0
- package/dist/components/Center/Center.svelte +9 -4
- package/dist/components/Center/Center.svelte.d.ts +7 -2
- package/dist/components/Circle/Circle.svelte.d.ts +20 -15
- package/dist/components/CodeExample/CodeExample.svelte +43 -38
- package/dist/components/CodeExample/CodeExample.svelte.d.ts +11 -1
- package/dist/components/Flex/Flex.svelte.d.ts +4 -0
- package/dist/components/Grid/Grid.svelte +16 -0
- package/dist/components/Grid/Grid.svelte.d.ts +44 -0
- package/dist/components/GridItem/GridItem.svelte +22 -0
- package/dist/components/GridItem/GridItem.svelte.d.ts +29 -0
- package/dist/components/Loaders/DotPulse.svelte +62 -0
- package/dist/components/Loaders/DotPulse.svelte.d.ts +40 -0
- package/dist/components/Loaders/DotSpinner.svelte +121 -0
- package/dist/components/Loaders/DotSpinner.svelte.d.ts +40 -0
- package/dist/components/Loaders/DotWave.svelte +67 -0
- package/dist/components/Loaders/DotWave.svelte.d.ts +40 -0
- package/dist/components/Spacer/Spacer.svelte +3 -2
- package/dist/components/Spacer/Spacer.svelte.d.ts +7 -2
- package/dist/components/Square/Square.svelte.d.ts +20 -15
- package/dist/components/Text/Text.svelte +51 -0
- package/dist/components/Text/Text.svelte.d.ts +45 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +6 -0
- package/dist/theme/breakpoints.d.ts +8 -0
- package/dist/theme/breakpoints.js +8 -0
- package/dist/theme/index.d.ts +183 -0
- package/dist/theme/index.js +19 -0
- package/dist/theme/radius.d.ts +10 -0
- package/dist/theme/radius.js +10 -0
- package/dist/theme/sizes.d.ts +60 -0
- package/dist/theme/sizes.js +33 -0
- package/dist/theme/spacing.d.ts +35 -0
- package/dist/theme/spacing.js +35 -0
- package/dist/theme/typography.d.ts +63 -0
- package/dist/theme/typography.js +63 -0
- package/package.json +1 -1
package/LICENCE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Rodrigo Abregu / Alcino
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,5 +1,94 @@
|
|
|
1
1
|
# Sve-UI
|
|
2
|
+
## _Best UI components library for Svelte_
|
|
2
3
|
|
|
3
|
-
Sve-UI is a
|
|
4
|
+
Sve-UI is a UI component library for Svelte that provides the best collection of components for building modern web applications and fast.
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
<br />
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
<br />
|
|
11
|
+
|
|
12
|
+
## Features
|
|
13
|
+
|
|
14
|
+
- Responsive components that work seamlessly across all devices and screen sizes
|
|
15
|
+
- Easy to use and highly customizable components
|
|
16
|
+
- Well-documented API and usage examples
|
|
17
|
+
- Regularly updated with new components and features
|
|
18
|
+
|
|
19
|
+
<br />
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
<br />
|
|
24
|
+
|
|
25
|
+
## Installation
|
|
26
|
+
|
|
27
|
+
> You can install Sve-UI using pnpm, npm or yarn.
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
pnpm add sve-ui
|
|
31
|
+
npm install sve-ui
|
|
32
|
+
yarn add sve-ui
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
To use:
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
<script>
|
|
39
|
+
import { Button } from 'sve-ui';
|
|
40
|
+
|
|
41
|
+
function handleClick() {
|
|
42
|
+
alert('Button clicked!');
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<Button onClick={handleClick}>Click me!</Button>
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
<br />
|
|
52
|
+
|
|
53
|
+
## Showcase & docs
|
|
54
|
+
|
|
55
|
+
<br />
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
| Showcase | Link |
|
|
59
|
+
| ------ | ------ |
|
|
60
|
+
| Docs | [/docs][docs] |
|
|
61
|
+
| Github page | [/sve-ui][Gp] |
|
|
62
|
+
| GitHub issues | [/sve-ui/issues][Gpi] |
|
|
63
|
+
| Github PR | [/sve-ui/pulls][Gppr] |
|
|
64
|
+
| Npmjs | [/package/sve-ui][LSjs] |
|
|
65
|
+
|
|
66
|
+
<br />
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
<br />
|
|
71
|
+
|
|
72
|
+
## List of components
|
|
73
|
+
|
|
74
|
+
- Box, Center, Spacer, Flex, Grid, GridItem
|
|
75
|
+
- Button, Text
|
|
76
|
+
- CodeExample
|
|
77
|
+
- Square, Circle
|
|
78
|
+
|
|
79
|
+
<br />
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
<br />
|
|
84
|
+
|
|
85
|
+
## License
|
|
86
|
+
|
|
87
|
+
MIT
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
[Gp]: <https://github.com/rodriabregu/sve-ui>
|
|
91
|
+
[Gpi]: <https://github.com/rodriabregu/sve-ui/issues>
|
|
92
|
+
[Gppr]: <https://github.com/rodriabregu/sve-ui/pulls>
|
|
93
|
+
[LSjs]: <https://www.npmjs.com/package/sve-ui>
|
|
94
|
+
[docs]: <https://sveui.org/>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
<script>export let
|
|
1
|
+
<script>export let as = "div";
|
|
2
|
+
export let p = 0;
|
|
2
3
|
export let padding = 0;
|
|
3
4
|
export let m = 0;
|
|
4
5
|
export let margin = 0;
|
|
@@ -16,9 +17,14 @@ export let d = "";
|
|
|
16
17
|
export let display = "";
|
|
17
18
|
export let fontSize = 1;
|
|
18
19
|
export let style = "";
|
|
20
|
+
export let textAlign = "";
|
|
21
|
+
export let alignItems = "";
|
|
22
|
+
export let justifyContent = "";
|
|
23
|
+
export let justifyItems = "";
|
|
19
24
|
</script>
|
|
20
25
|
|
|
21
|
-
<
|
|
26
|
+
<svelte:element
|
|
27
|
+
this={as}
|
|
22
28
|
style={`
|
|
23
29
|
padding: ${p || padding}rem;
|
|
24
30
|
margin: ${m || margin}rem;
|
|
@@ -30,9 +36,13 @@ export let style = "";
|
|
|
30
36
|
border-radius: ${br || borderRadius || 'none'};
|
|
31
37
|
display: ${d || display};
|
|
32
38
|
font-size: ${fontSize}rem;
|
|
39
|
+
text-align: ${textAlign};
|
|
40
|
+
align-items: ${alignItems};
|
|
41
|
+
justify-content: ${justifyContent};
|
|
42
|
+
justify-items: ${justifyItems};
|
|
33
43
|
${style}
|
|
34
|
-
|
|
44
|
+
`}
|
|
35
45
|
{...$$restProps}
|
|
36
46
|
>
|
|
37
47
|
<slot />
|
|
38
|
-
</
|
|
48
|
+
</svelte:element>
|
|
@@ -97,6 +97,42 @@ declare const __propDef: {
|
|
|
97
97
|
* @type string | undefined
|
|
98
98
|
*/
|
|
99
99
|
display?: string | undefined;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* @default undefined
|
|
103
|
+
* @description The position of the text in the box.
|
|
104
|
+
* @type string | undefined
|
|
105
|
+
*/
|
|
106
|
+
textAlign?: string | undefined;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* @default undefined
|
|
110
|
+
* @description The align items of the box.
|
|
111
|
+
* @type string | undefined
|
|
112
|
+
*/
|
|
113
|
+
alignItems?: string | undefined;
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @default undefined
|
|
117
|
+
* @description The justify content of the box.
|
|
118
|
+
* @type string | undefined
|
|
119
|
+
*/
|
|
120
|
+
justifyContent?: string | undefined;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* @default undefined
|
|
124
|
+
* @description The justify items of the box.
|
|
125
|
+
* @type string | undefined
|
|
126
|
+
*/
|
|
127
|
+
justifyItems?: string | undefined;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* @default undefined
|
|
131
|
+
* @description The font size of the text.
|
|
132
|
+
* @type string | undefined
|
|
133
|
+
*/
|
|
134
|
+
fontSize?: string | undefined;
|
|
135
|
+
|
|
100
136
|
/**
|
|
101
137
|
* @default undefined
|
|
102
138
|
* @description Style of the box.
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
<script>
|
|
1
|
+
<script>import Box from "../Box/Box.svelte";
|
|
2
|
+
export let width = "100%";
|
|
2
3
|
export let height = "100%";
|
|
3
4
|
</script>
|
|
4
5
|
|
|
5
|
-
<
|
|
6
|
-
|
|
6
|
+
<Box
|
|
7
|
+
display={'flex'}
|
|
8
|
+
justifyContent={'center'}
|
|
9
|
+
alignItems={'center'}
|
|
10
|
+
{width}
|
|
11
|
+
{height}
|
|
7
12
|
{...$$restProps}
|
|
8
13
|
>
|
|
9
14
|
<slot />
|
|
10
|
-
</
|
|
15
|
+
</Box>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { BoxProps } from "../Box/Box.svelte";
|
|
2
3
|
declare const __propDef: {
|
|
3
4
|
props: {
|
|
4
5
|
[x: string]: any;
|
|
5
6
|
width?: string | undefined;
|
|
6
7
|
height?: string | undefined;
|
|
7
|
-
}
|
|
8
|
+
} & BoxProps
|
|
8
9
|
events: {
|
|
9
10
|
[evt: string]: CustomEvent<any>;
|
|
10
11
|
};
|
|
@@ -15,6 +16,10 @@ declare const __propDef: {
|
|
|
15
16
|
export type CenterProps = typeof __propDef.props;
|
|
16
17
|
export type CenterEvents = typeof __propDef.events;
|
|
17
18
|
export type CenterSlots = typeof __propDef.slots;
|
|
19
|
+
/**
|
|
20
|
+
* A box component that can be used to center its children.
|
|
21
|
+
* @see Docs https://sveui.org/components/center
|
|
22
|
+
*/
|
|
18
23
|
export default class Center extends SvelteComponentTyped<CenterProps, CenterEvents, CenterSlots> {
|
|
19
24
|
}
|
|
20
|
-
export {};
|
|
25
|
+
export { Center, CenterProps };
|
|
@@ -1,29 +1,34 @@
|
|
|
1
1
|
/** @typedef {typeof __propDef.props} CircleProps */
|
|
2
2
|
/** @typedef {typeof __propDef.events} CircleEvents */
|
|
3
3
|
/** @typedef {typeof __propDef.slots} CircleSlots */
|
|
4
|
+
/**
|
|
5
|
+
* A square flex component with full border radius apply.
|
|
6
|
+
* @see Docs https://sveui.org/components/circle
|
|
7
|
+
*/
|
|
4
8
|
export default class Circle extends SvelteComponentTyped<{
|
|
5
|
-
|
|
6
|
-
|
|
9
|
+
[x: string]: any;
|
|
10
|
+
size?: string | undefined;
|
|
7
11
|
}, {
|
|
8
|
-
|
|
12
|
+
[evt: string]: CustomEvent<any>;
|
|
9
13
|
}, {
|
|
10
|
-
|
|
14
|
+
default: {};
|
|
11
15
|
}> {
|
|
12
16
|
}
|
|
13
17
|
export type CircleProps = typeof __propDef.props;
|
|
14
18
|
export type CircleEvents = typeof __propDef.events;
|
|
15
19
|
export type CircleSlots = typeof __propDef.slots;
|
|
16
20
|
import { SvelteComponentTyped } from "svelte";
|
|
21
|
+
import type { SquareProps } from "../Square/Square.svelte";
|
|
17
22
|
declare const __propDef: {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
props: {
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
size?: string | undefined;
|
|
26
|
+
} & SquareProps
|
|
27
|
+
events: {
|
|
28
|
+
[evt: string]: CustomEvent<any>;
|
|
29
|
+
};
|
|
30
|
+
slots: {
|
|
31
|
+
default: {};
|
|
32
|
+
};
|
|
28
33
|
};
|
|
29
|
-
export {};
|
|
34
|
+
export { Circle, CircleProps };
|
|
@@ -1,54 +1,59 @@
|
|
|
1
|
-
<script>
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
1
|
+
<script>export let typeCodeLabel = "Sve-UI";
|
|
2
|
+
export let basic = false;
|
|
3
|
+
let copied = false;
|
|
4
|
+
const copyToClipboard = async () => {
|
|
5
|
+
try {
|
|
6
|
+
const codeElement = document.querySelector(".code-box code");
|
|
7
|
+
if (codeElement) {
|
|
8
|
+
const text = codeElement.textContent;
|
|
9
|
+
text && await navigator.clipboard.writeText(text);
|
|
10
|
+
copied = true;
|
|
11
|
+
setTimeout(() => {
|
|
12
|
+
copied = false;
|
|
13
|
+
}, 1500);
|
|
14
|
+
}
|
|
15
|
+
} catch (err) {
|
|
16
|
+
console.error("Failed to copy: ", err);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
20
19
|
</script>
|
|
21
20
|
|
|
22
21
|
<pre class="code-box">
|
|
23
|
-
|
|
22
|
+
{#if basic}
|
|
23
|
+
<code>
|
|
24
|
+
<slot />
|
|
25
|
+
</code>
|
|
26
|
+
{:else}
|
|
27
|
+
<article class="button-copy">
|
|
24
28
|
<span>{typeCodeLabel}</span>
|
|
25
29
|
<button on:click={copyToClipboard}>
|
|
26
30
|
{#if copied}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
31
|
+
<span>Copied</span>
|
|
32
|
+
{:else}
|
|
33
|
+
<svg
|
|
34
|
+
stroke="currentColor"
|
|
35
|
+
fill="none"
|
|
36
|
+
stroke-width="2"
|
|
37
|
+
viewBox="0 0 24 24"
|
|
38
|
+
stroke-linecap="round"
|
|
39
|
+
stroke-linejoin="round"
|
|
40
|
+
class="h-4 w-4"
|
|
41
|
+
height="1em"
|
|
42
|
+
width="1em"
|
|
43
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
44
|
+
><path
|
|
45
|
+
d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"
|
|
46
|
+
/><rect x="8" y="2" width="8" height="4" rx="1" ry="1" /></svg
|
|
47
|
+
>
|
|
44
48
|
<span>Copy</span>
|
|
45
|
-
|
|
49
|
+
{/if}
|
|
46
50
|
</button>
|
|
47
51
|
</article>
|
|
48
52
|
|
|
49
53
|
<code id="textCode" class={copied ? 'textCode' : ''}>
|
|
50
54
|
<slot />
|
|
51
55
|
</code>
|
|
56
|
+
{/if}
|
|
52
57
|
</pre>
|
|
53
58
|
|
|
54
59
|
<style>
|
|
@@ -9,9 +9,18 @@
|
|
|
9
9
|
export default class CodeExample extends SvelteComponentTyped<{
|
|
10
10
|
/**
|
|
11
11
|
* The type code label text, show in the top of the code example component.
|
|
12
|
-
*
|
|
12
|
+
* @default 'Sve-UI'
|
|
13
|
+
* @type {string}
|
|
14
|
+
* @example <CodeExample typeCodeLabel="Svelte">
|
|
13
15
|
*/
|
|
14
16
|
typeCodeLabel?: string | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* If you want a more compact and simpler version, without the top copy button, you can use the basic option of the component with this property set to true.
|
|
19
|
+
* @default false
|
|
20
|
+
* @type {boolean}
|
|
21
|
+
* @example <CodeExample isBasic={true}>
|
|
22
|
+
*/
|
|
23
|
+
basic?: boolean | undefined;
|
|
15
24
|
}, {
|
|
16
25
|
[evt: string]: CustomEvent<any>;
|
|
17
26
|
}, {
|
|
@@ -25,6 +34,7 @@ import { SvelteComponentTyped } from "svelte";
|
|
|
25
34
|
declare const __propDef: {
|
|
26
35
|
props: {
|
|
27
36
|
typeCodeLabel?: string | undefined;
|
|
37
|
+
basic?: boolean | undefined;
|
|
28
38
|
};
|
|
29
39
|
events: {
|
|
30
40
|
[evt: string]: CustomEvent<any>;
|
|
@@ -25,6 +25,10 @@ declare const __propDef: {
|
|
|
25
25
|
export type FlexProps = typeof __propDef.props;
|
|
26
26
|
export type FlexEvents = typeof __propDef.events;
|
|
27
27
|
export type FlexSlots = typeof __propDef.slots;
|
|
28
|
+
/**
|
|
29
|
+
* A flex box component that can be used to create layouts.
|
|
30
|
+
* @see Docs https://sveui.org/components/flex
|
|
31
|
+
*/
|
|
28
32
|
export default class Flex extends SvelteComponentTyped<FlexProps, FlexEvents, FlexSlots> {
|
|
29
33
|
}
|
|
30
34
|
export { Flex, FlexProps };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<script>export let columns = 1;
|
|
2
|
+
export let gap = 1;
|
|
3
|
+
export let flow = "row";
|
|
4
|
+
</script>
|
|
5
|
+
|
|
6
|
+
<div
|
|
7
|
+
style="
|
|
8
|
+
display: grid;
|
|
9
|
+
grid-template-columns: repeat({columns}, 1fr);
|
|
10
|
+
grid-gap: {gap}rem;
|
|
11
|
+
grid-auto-flow: {flow};
|
|
12
|
+
"
|
|
13
|
+
{...$$restProps}
|
|
14
|
+
>
|
|
15
|
+
<slot />
|
|
16
|
+
</div>
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { BoxProps } from "../Box/Box.svelte";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
[x: string]: any;
|
|
6
|
+
/**
|
|
7
|
+
* The number of columns in the grid.
|
|
8
|
+
* @default 1
|
|
9
|
+
* @type {number}
|
|
10
|
+
* @example <Grid columns={2}>
|
|
11
|
+
*/
|
|
12
|
+
columns?: number | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* The number of gap in the grid, expressed in rem.
|
|
15
|
+
* @default 1
|
|
16
|
+
* @type {number}
|
|
17
|
+
* @example <Grid gap={2}>
|
|
18
|
+
*/
|
|
19
|
+
gap?: string | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The grid-auto-flow CSS property controls how the auto-placement algorithm works, specifying exactly how auto-placed items get flowed into the grid.
|
|
22
|
+
* @default 'row'
|
|
23
|
+
* @type {string}
|
|
24
|
+
* @example <Grid flow={'column'}>
|
|
25
|
+
*/
|
|
26
|
+
flow?: string | undefined;
|
|
27
|
+
} & BoxProps
|
|
28
|
+
events: {
|
|
29
|
+
[evt: string]: CustomEvent<any>;
|
|
30
|
+
};
|
|
31
|
+
slots: {
|
|
32
|
+
default: {};
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
export type GridProps = typeof __propDef.props;
|
|
36
|
+
export type GridEvents = typeof __propDef.events;
|
|
37
|
+
export type GridSlots = typeof __propDef.slots;
|
|
38
|
+
/**
|
|
39
|
+
* A grid component that can be used to create layouts.
|
|
40
|
+
* @see Docs https://sveui.org/components/grid
|
|
41
|
+
*/
|
|
42
|
+
export default class Grid extends SvelteComponentTyped<GridProps, GridEvents, GridSlots> {
|
|
43
|
+
}
|
|
44
|
+
export { Grid, GridProps };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script>export let colStart = "auto";
|
|
2
|
+
export let colEnd = "auto";
|
|
3
|
+
export let rowStart = "auto";
|
|
4
|
+
export let rowEnd = "auto";
|
|
5
|
+
export let area = "";
|
|
6
|
+
export let justifySelf = "auto";
|
|
7
|
+
export let alignSelf = "auto";
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<div
|
|
11
|
+
style="
|
|
12
|
+
grid-column-start: {colStart};
|
|
13
|
+
grid-column-end: {colEnd};
|
|
14
|
+
grid-row-start: {rowStart};
|
|
15
|
+
grid-row-end: {rowEnd};
|
|
16
|
+
grid-area: {area};
|
|
17
|
+
justify-self: {justifySelf};
|
|
18
|
+
align-self: {alignSelf};
|
|
19
|
+
"
|
|
20
|
+
>
|
|
21
|
+
<slot />
|
|
22
|
+
</div>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
import type { BoxProps } from "../Box/Box.svelte";
|
|
3
|
+
declare const __propDef: {
|
|
4
|
+
props: {
|
|
5
|
+
colStart?: string | undefined;
|
|
6
|
+
colEnd?: string | undefined;
|
|
7
|
+
rowStart?: string | undefined;
|
|
8
|
+
rowEnd?: string | undefined;
|
|
9
|
+
area?: string | undefined;
|
|
10
|
+
justifySelf?: "center" | "inherit" | "auto" | "flex-start" | "stretch" | "start" | "end" | "initial" | "unset" | "revert" | "normal" | "baseline" | "first baseline" | "last baseline" | "self-start" | "self-end" | "left" | "right" | "safe center" | "unsafe center" | "flex-end" | undefined;
|
|
11
|
+
alignSelf?: "center" | "inherit" | "auto" | "stretch" | "start" | "end" | "initial" | "unset" | "revert" | "normal" | "baseline" | "first baseline" | "last baseline" | undefined;
|
|
12
|
+
} & BoxProps
|
|
13
|
+
events: {
|
|
14
|
+
[evt: string]: CustomEvent<any>;
|
|
15
|
+
};
|
|
16
|
+
slots: {
|
|
17
|
+
default: {};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export type GridItemProps = typeof __propDef.props;
|
|
21
|
+
export type GridItemEvents = typeof __propDef.events;
|
|
22
|
+
export type GridItemSlots = typeof __propDef.slots;
|
|
23
|
+
/**
|
|
24
|
+
* A item component inside a grid layout.
|
|
25
|
+
* @see Docs https://sveui.org/components/griditem
|
|
26
|
+
*/
|
|
27
|
+
export default class GridItem extends SvelteComponentTyped<GridItemProps, GridItemEvents, GridItemSlots> {
|
|
28
|
+
}
|
|
29
|
+
export { GridItem, GridItemProps };
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script>import { theme } from "../../theme";
|
|
2
|
+
export let size = 14;
|
|
3
|
+
export let color = "white";
|
|
4
|
+
export let speed = "1.2";
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<div
|
|
8
|
+
class="dot-pulse"
|
|
9
|
+
style="
|
|
10
|
+
--sve-size: {theme.spacing[size]};
|
|
11
|
+
--sve-speed: {speed}s;
|
|
12
|
+
--sve-color: {color};
|
|
13
|
+
"
|
|
14
|
+
>
|
|
15
|
+
<div class="dot-pulse__dot" />
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<style>
|
|
19
|
+
.dot-pulse {
|
|
20
|
+
position: relative;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: space-between;
|
|
24
|
+
width: var(--sve-size);
|
|
25
|
+
height: calc(var(--sve-size) * 0.27);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.dot-pulse__dot,
|
|
29
|
+
.dot-pulse::before,
|
|
30
|
+
.dot-pulse::after {
|
|
31
|
+
content: '';
|
|
32
|
+
display: block;
|
|
33
|
+
height: calc(var(--sve-size) * 0.18);
|
|
34
|
+
width: calc(var(--sve-size) * 0.18);
|
|
35
|
+
border-radius: 50%;
|
|
36
|
+
background-color: var(--sve-color);
|
|
37
|
+
transform: scale(0);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.dot-pulse::before {
|
|
41
|
+
animation: pulse var(--sve-speed) ease-in-out infinite;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.dot-pulse__dot {
|
|
45
|
+
animation: pulse var(--sve-speed) ease-in-out calc(var(--sve-speed) * 0.125) infinite both;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.dot-pulse::after {
|
|
49
|
+
animation: pulse var(--sve-speed) ease-in-out calc(var(--sve-speed) * 0.25) infinite;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@keyframes pulse {
|
|
53
|
+
0%,
|
|
54
|
+
100% {
|
|
55
|
+
transform: scale(0);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
50% {
|
|
59
|
+
transform: scale(1.5);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
</style>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { SvelteComponentTyped } from "svelte";
|
|
2
|
+
declare const __propDef: {
|
|
3
|
+
props: {
|
|
4
|
+
/**
|
|
5
|
+
* The size of the dots, expressed in rem style system.
|
|
6
|
+
* @default 14
|
|
7
|
+
* @type {1 | 1.5 | "px" | 0.5 | 2 | 2.5 | 3 | 3.5 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96}
|
|
8
|
+
* @example <DotPulse size={20}>
|
|
9
|
+
*/
|
|
10
|
+
size?: 1 | 1.5 | "px" | 0.5 | 2 | 2.5 | 3 | 3.5 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 12 | 14 | 16 | 20 | 24 | 28 | 32 | 36 | 40 | 44 | 48 | 52 | 56 | 60 | 64 | 72 | 80 | 96 | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* The color of the dots.
|
|
13
|
+
* @default 'white'
|
|
14
|
+
* @type {string}
|
|
15
|
+
* @example <DotPulse color={'black'}>
|
|
16
|
+
*/
|
|
17
|
+
color?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* The speed of the animation, expressed in seconds.
|
|
20
|
+
* @default '1.2'
|
|
21
|
+
* @type {string}
|
|
22
|
+
* @example <DotPulse speed={'.8'}>
|
|
23
|
+
*/
|
|
24
|
+
speed?: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
events: {
|
|
27
|
+
[evt: string]: CustomEvent<any>;
|
|
28
|
+
};
|
|
29
|
+
slots: {};
|
|
30
|
+
};
|
|
31
|
+
export type DotPulseProps = typeof __propDef.props;
|
|
32
|
+
export type DotPulseEvents = typeof __propDef.events;
|
|
33
|
+
export type DotPulseSlots = typeof __propDef.slots;
|
|
34
|
+
/**
|
|
35
|
+
* A dot pulse loader.
|
|
36
|
+
* @see Docs https://sveui.org/components/loaders/dot-pulse
|
|
37
|
+
*/
|
|
38
|
+
export default class DotPulse extends SvelteComponentTyped<DotPulseProps, DotPulseEvents, DotPulseSlots> {
|
|
39
|
+
}
|
|
40
|
+
export { DotPulse, DotPulseProps };
|