@axel669/zephyr 0.2.0-beta.3 → 0.3.6
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/package.json +33 -33
- package/readme.md +63 -63
- package/src/async/button.md +27 -0
- package/src/async/button.svelte +29 -31
- package/src/async/load-zone.md +42 -0
- package/src/async/load-zone.svelte +22 -20
- package/src/composed/data-table/th.md +21 -0
- package/src/composed/data-table/th.svelte +61 -61
- package/src/composed/data-table.md +86 -85
- package/src/composed/data-table.svelte +199 -149
- package/src/composed/entry-button.md +44 -34
- package/src/composed/entry-button.svelte +31 -31
- package/src/composed/table-functions.js +13 -13
- package/src/composed/toast/message.svelte +56 -56
- package/src/composed/toast.md +45 -36
- package/src/composed/toast.svelte +70 -70
- package/src/control/button.md +41 -41
- package/src/control/button.svelte +27 -27
- package/src/control/input.md +87 -0
- package/src/control/input.svelte +109 -109
- package/src/control/label.md +48 -49
- package/src/control/label.svelte +38 -38
- package/src/control/link.md +50 -50
- package/src/control/link.svelte +32 -30
- package/src/control/radio.md +58 -58
- package/src/control/radio.svelte +28 -28
- package/src/control/select.md +70 -70
- package/src/control/select.svelte +64 -64
- package/src/control/tabs.md +47 -47
- package/src/control/tabs.svelte +43 -41
- package/src/control/toggle.md +61 -61
- package/src/control/toggle.svelte +49 -49
- package/src/data-display/avatar.md +36 -36
- package/src/data-display/avatar.svelte +25 -25
- package/src/data-display/badge.md +30 -30
- package/src/data-display/badge.svelte +14 -14
- package/src/data-display/chip.md +36 -36
- package/src/data-display/chip.svelte +28 -28
- package/src/data-display/details.md +42 -3
- package/src/data-display/details.svelte +25 -25
- package/src/data-display/popover.md +32 -32
- package/src/data-display/popover.svelte +25 -25
- package/src/data-display/progress.md +46 -46
- package/src/data-display/progress.svelte +27 -27
- package/src/data-display/table.md +59 -7
- package/src/data-display/table.svelte +38 -38
- package/src/data-display/tooltip.md +29 -29
- package/src/data-display/tooltip.svelte +17 -17
- package/src/dialogs/alert.md +42 -3
- package/src/dialogs/alert.svelte +34 -34
- package/src/dialogs/confirm.md +56 -3
- package/src/dialogs/confirm.svelte +45 -45
- package/src/functions.md +108 -83
- package/src/handler$.mjs +20 -20
- package/src/hash.js +14 -0
- package/src/index.mjs +53 -52
- package/src/info/icon.md +21 -21
- package/src/info/icon.svelte +9 -9
- package/src/info/notification.md +36 -36
- package/src/info/notification.svelte +16 -16
- package/src/info/titlebar.md +75 -75
- package/src/info/titlebar.svelte +18 -18
- package/src/info/toaster.md +26 -26
- package/src/info/toaster.svelte +14 -14
- package/src/inline-dialog.svelte +23 -23
- package/src/layout/dialog.md +43 -43
- package/src/layout/dialog.svelte +26 -26
- package/src/layout/drawer.md +70 -70
- package/src/layout/drawer.svelte +49 -49
- package/src/layout/flex.md +43 -43
- package/src/layout/flex.svelte +26 -24
- package/src/layout/grid.md +61 -61
- package/src/layout/grid.svelte +30 -28
- package/src/layout/modal.md +50 -50
- package/src/layout/modal.svelte +60 -60
- package/src/layout/paper.md +94 -94
- package/src/layout/paper.svelte +47 -47
- package/src/layout/screen.md +33 -33
- package/src/layout/screen.svelte +34 -34
- package/src/spinner/circle-spinner.svelte +15 -15
- package/src/spinner/hexagon-spinner.svelte +15 -15
- package/src/spinner/spinners.md +22 -3
- package/src/text.md +34 -34
- package/src/text.svelte +22 -22
- package/src/variant.mjs +12 -12
- package/src/wsx.mjs +24 -24
package/src/layout/paper.md
CHANGED
|
@@ -1,94 +1,94 @@
|
|
|
1
|
-
# Paper
|
|
2
|
-
|
|
3
|
-
The Paper component is a container that has slots for header and footer
|
|
4
|
-
content that is independant from the regular content scrolling. It also uses
|
|
5
|
-
Flex as a default layout for its slotted content, but allows any container
|
|
6
|
-
to be used as a layout without increasing the indentation of all the content
|
|
7
|
-
needlessly.
|
|
8
|
-
|
|
9
|
-
## Props
|
|
10
|
-
|
|
11
|
-
### color
|
|
12
|
-
`string`
|
|
13
|
-
|
|
14
|
-
Sets `$color`
|
|
15
|
-
|
|
16
|
-
### card
|
|
17
|
-
`bool`
|
|
18
|
-
|
|
19
|
-
Sets `$outline`
|
|
20
|
-
|
|
21
|
-
### square
|
|
22
|
-
`bool`
|
|
23
|
-
|
|
24
|
-
Sets `r[0px]`
|
|
25
|
-
|
|
26
|
-
### layout
|
|
27
|
-
`Component`
|
|
28
|
-
|
|
29
|
-
Sets the layout the card will use to display content. Default is Flex.
|
|
30
|
-
|
|
31
|
-
### scrollable
|
|
32
|
-
`bool`
|
|
33
|
-
|
|
34
|
-
Sets `over[auto]` on the layout component
|
|
35
|
-
|
|
36
|
-
### l-*
|
|
37
|
-
Any prop that is prefixed with `l-` will be passed to the layout
|
|
38
|
-
component, with the remaining props acting as the normal wind functions
|
|
39
|
-
on the paper itself
|
|
40
|
-
|
|
41
|
-
## Slots
|
|
42
|
-
|
|
43
|
-
### header
|
|
44
|
-
The header content for the Paper. Header content does not scroll with
|
|
45
|
-
the regular content of the component (acts sticky)
|
|
46
|
-
|
|
47
|
-
### footer
|
|
48
|
-
The footer content for the Paper. Same scrolling properties as the
|
|
49
|
-
header slot
|
|
50
|
-
|
|
51
|
-
### content/default
|
|
52
|
-
The default slot (unnamed) for Paper will be rendered in the layout
|
|
53
|
-
component defined in the props. As an alternative, a content slot may
|
|
54
|
-
be used that will be rendered directly in the content slot of the Paper
|
|
55
|
-
without the layout component/props being rendered (useful when nesting
|
|
56
|
-
papers for example)
|
|
57
|
-
|
|
58
|
-
## Example
|
|
59
|
-
```svelte
|
|
60
|
-
<script>
|
|
61
|
-
import { Paper, Tabs, Text, Titlebar } from "@axel669/zephyr"
|
|
62
|
-
</script>
|
|
63
|
-
|
|
64
|
-
<Paper>
|
|
65
|
-
<Titlebar slot="header">
|
|
66
|
-
<Text slot="title" title>
|
|
67
|
-
Some Title
|
|
68
|
-
</Text>
|
|
69
|
-
</Titlebar>
|
|
70
|
-
|
|
71
|
-
<div>Content 1</div>
|
|
72
|
-
<div>Content 2</div>
|
|
73
|
-
<div>Content 3</div>
|
|
74
|
-
</Paper>
|
|
75
|
-
<Paper l-pad="0px" m="4px">
|
|
76
|
-
<Titlebar slot="header">
|
|
77
|
-
<Text slot="title" title>
|
|
78
|
-
Some Screen
|
|
79
|
-
</Text>
|
|
80
|
-
</Titlebar>
|
|
81
|
-
|
|
82
|
-
<Paper slot="content">
|
|
83
|
-
<Tabs slot="header" {options} bind:value />
|
|
84
|
-
|
|
85
|
-
<div>Content 1</div>
|
|
86
|
-
<div>Content 2</div>
|
|
87
|
-
<div>Content 3</div>
|
|
88
|
-
</Paper>
|
|
89
|
-
|
|
90
|
-
<div slot="footer">
|
|
91
|
-
Wat
|
|
92
|
-
</div>
|
|
93
|
-
</Paper>
|
|
94
|
-
```
|
|
1
|
+
# Paper
|
|
2
|
+
|
|
3
|
+
The Paper component is a container that has slots for header and footer
|
|
4
|
+
content that is independant from the regular content scrolling. It also uses
|
|
5
|
+
Flex as a default layout for its slotted content, but allows any container
|
|
6
|
+
to be used as a layout without increasing the indentation of all the content
|
|
7
|
+
needlessly.
|
|
8
|
+
|
|
9
|
+
## Props
|
|
10
|
+
|
|
11
|
+
### color
|
|
12
|
+
`string`
|
|
13
|
+
|
|
14
|
+
Sets `$color`
|
|
15
|
+
|
|
16
|
+
### card
|
|
17
|
+
`bool`
|
|
18
|
+
|
|
19
|
+
Sets `$outline`
|
|
20
|
+
|
|
21
|
+
### square
|
|
22
|
+
`bool`
|
|
23
|
+
|
|
24
|
+
Sets `r[0px]`
|
|
25
|
+
|
|
26
|
+
### layout
|
|
27
|
+
`Component`
|
|
28
|
+
|
|
29
|
+
Sets the layout the card will use to display content. Default is Flex.
|
|
30
|
+
|
|
31
|
+
### scrollable
|
|
32
|
+
`bool`
|
|
33
|
+
|
|
34
|
+
Sets `over[auto]` on the layout component
|
|
35
|
+
|
|
36
|
+
### l-*
|
|
37
|
+
Any prop that is prefixed with `l-` will be passed to the layout
|
|
38
|
+
component, with the remaining props acting as the normal wind functions
|
|
39
|
+
on the paper itself
|
|
40
|
+
|
|
41
|
+
## Slots
|
|
42
|
+
|
|
43
|
+
### header
|
|
44
|
+
The header content for the Paper. Header content does not scroll with
|
|
45
|
+
the regular content of the component (acts sticky)
|
|
46
|
+
|
|
47
|
+
### footer
|
|
48
|
+
The footer content for the Paper. Same scrolling properties as the
|
|
49
|
+
header slot
|
|
50
|
+
|
|
51
|
+
### content/default
|
|
52
|
+
The default slot (unnamed) for Paper will be rendered in the layout
|
|
53
|
+
component defined in the props. As an alternative, a content slot may
|
|
54
|
+
be used that will be rendered directly in the content slot of the Paper
|
|
55
|
+
without the layout component/props being rendered (useful when nesting
|
|
56
|
+
papers for example)
|
|
57
|
+
|
|
58
|
+
## Example
|
|
59
|
+
```svelte
|
|
60
|
+
<script>
|
|
61
|
+
import { Paper, Tabs, Text, Titlebar } from "@axel669/zephyr"
|
|
62
|
+
</script>
|
|
63
|
+
|
|
64
|
+
<Paper>
|
|
65
|
+
<Titlebar slot="header">
|
|
66
|
+
<Text slot="title" title>
|
|
67
|
+
Some Title
|
|
68
|
+
</Text>
|
|
69
|
+
</Titlebar>
|
|
70
|
+
|
|
71
|
+
<div>Content 1</div>
|
|
72
|
+
<div>Content 2</div>
|
|
73
|
+
<div>Content 3</div>
|
|
74
|
+
</Paper>
|
|
75
|
+
<Paper l-pad="0px" m="4px">
|
|
76
|
+
<Titlebar slot="header">
|
|
77
|
+
<Text slot="title" title>
|
|
78
|
+
Some Screen
|
|
79
|
+
</Text>
|
|
80
|
+
</Titlebar>
|
|
81
|
+
|
|
82
|
+
<Paper slot="content">
|
|
83
|
+
<Tabs slot="header" {options} bind:value />
|
|
84
|
+
|
|
85
|
+
<div>Content 1</div>
|
|
86
|
+
<div>Content 2</div>
|
|
87
|
+
<div>Content 3</div>
|
|
88
|
+
</Paper>
|
|
89
|
+
|
|
90
|
+
<div slot="footer">
|
|
91
|
+
Wat
|
|
92
|
+
</div>
|
|
93
|
+
</Paper>
|
|
94
|
+
```
|
package/src/layout/paper.svelte
CHANGED
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import Flex from "./flex.svelte"
|
|
5
|
-
import wsx from "../wsx.mjs"
|
|
6
|
-
|
|
7
|
-
export let color
|
|
8
|
-
export let card = false
|
|
9
|
-
export let square = false
|
|
10
|
-
export let layout = Flex
|
|
11
|
-
export let scrollable = true
|
|
12
|
-
|
|
13
|
-
$: props = Object.entries($$restProps).reduce(
|
|
14
|
-
(p, [key, value]) => {
|
|
15
|
-
const [target, name] =
|
|
16
|
-
(key.startsWith("l-") === true)
|
|
17
|
-
? [ p.layout, key.slice(2) ]
|
|
18
|
-
: [ p.paper, key ]
|
|
19
|
-
target[name] = value
|
|
20
|
-
return p
|
|
21
|
-
},
|
|
22
|
-
{ layout: {}, paper: {} }
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
$: layoutProps = {
|
|
26
|
-
over: scrollable ? "auto" : false,
|
|
27
|
-
...props.layout,
|
|
28
|
-
}
|
|
29
|
-
$: wind = {
|
|
30
|
-
"$color": color,
|
|
31
|
-
"$outline": card,
|
|
32
|
-
r: square && "0px",
|
|
33
|
-
...props.paper,
|
|
34
|
-
}
|
|
35
|
-
</script>
|
|
36
|
-
|
|
37
|
-
<ws-paper use:wsx={wind}>
|
|
38
|
-
<slot name="header" />
|
|
39
|
-
{#if $$slots.content}
|
|
40
|
-
<slot name="content" slot="content" />
|
|
41
|
-
{:else}
|
|
42
|
-
<svelte:component this={layout} {...layoutProps} slot="content">
|
|
43
|
-
<slot />
|
|
44
|
-
</svelte:component>
|
|
45
|
-
{/if}
|
|
46
|
-
<slot name="footer" />
|
|
47
|
-
</ws-paper>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import Flex from "./flex.svelte"
|
|
5
|
+
import wsx from "../wsx.mjs"
|
|
6
|
+
|
|
7
|
+
export let color
|
|
8
|
+
export let card = false
|
|
9
|
+
export let square = false
|
|
10
|
+
export let layout = Flex
|
|
11
|
+
export let scrollable = true
|
|
12
|
+
|
|
13
|
+
$: props = Object.entries($$restProps).reduce(
|
|
14
|
+
(p, [key, value]) => {
|
|
15
|
+
const [target, name] =
|
|
16
|
+
(key.startsWith("l-") === true)
|
|
17
|
+
? [ p.layout, key.slice(2) ]
|
|
18
|
+
: [ p.paper, key ]
|
|
19
|
+
target[name] = value
|
|
20
|
+
return p
|
|
21
|
+
},
|
|
22
|
+
{ layout: {}, paper: {} }
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
$: layoutProps = {
|
|
26
|
+
over: scrollable ? "auto" : false,
|
|
27
|
+
...props.layout,
|
|
28
|
+
}
|
|
29
|
+
$: wind = {
|
|
30
|
+
"$color": color,
|
|
31
|
+
"$outline": card,
|
|
32
|
+
r: square && "0px",
|
|
33
|
+
...props.paper,
|
|
34
|
+
}
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<ws-paper use:wsx={wind}>
|
|
38
|
+
<slot name="header" />
|
|
39
|
+
{#if $$slots.content}
|
|
40
|
+
<slot name="content" slot="content" />
|
|
41
|
+
{:else}
|
|
42
|
+
<svelte:component this={layout} {...layoutProps} slot="content">
|
|
43
|
+
<slot />
|
|
44
|
+
</svelte:component>
|
|
45
|
+
{/if}
|
|
46
|
+
<slot name="footer" />
|
|
47
|
+
</ws-paper>
|
package/src/layout/screen.md
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
# Screen
|
|
2
|
-
|
|
3
|
-
The screen is a container component that is used for displaying content
|
|
4
|
-
over its parent and stacks as more screens are displayed. Screens that stack
|
|
5
|
-
on top of a parent screen use the Modal to control when they are shown and
|
|
6
|
-
pass values back from child screens. The stacking effect of the Screen is
|
|
7
|
-
controlled by internally tracked svelte context, so no manual effort is
|
|
8
|
-
required to get stacking screens to have the effect.
|
|
9
|
-
|
|
10
|
-
## Props
|
|
11
|
-
|
|
12
|
-
### width
|
|
13
|
-
`string`
|
|
14
|
-
|
|
15
|
-
The width of the screen before stack-based padding is applied
|
|
16
|
-
|
|
17
|
-
## Example
|
|
18
|
-
```svelte
|
|
19
|
-
<script>
|
|
20
|
-
import { Scren, Button, Paper } from "@axel669/zephyr"
|
|
21
|
-
|
|
22
|
-
export let close
|
|
23
|
-
</script>
|
|
24
|
-
|
|
25
|
-
<Screen width="70%">
|
|
26
|
-
<Paper>
|
|
27
|
-
This screen is pretty cool I swear
|
|
28
|
-
<Button on:click={() => close("hi")}>
|
|
29
|
-
Close
|
|
30
|
-
</Button>
|
|
31
|
-
</Paper>
|
|
32
|
-
</Screen>
|
|
33
|
-
```
|
|
1
|
+
# Screen
|
|
2
|
+
|
|
3
|
+
The screen is a container component that is used for displaying content
|
|
4
|
+
over its parent and stacks as more screens are displayed. Screens that stack
|
|
5
|
+
on top of a parent screen use the Modal to control when they are shown and
|
|
6
|
+
pass values back from child screens. The stacking effect of the Screen is
|
|
7
|
+
controlled by internally tracked svelte context, so no manual effort is
|
|
8
|
+
required to get stacking screens to have the effect.
|
|
9
|
+
|
|
10
|
+
## Props
|
|
11
|
+
|
|
12
|
+
### width
|
|
13
|
+
`string`
|
|
14
|
+
|
|
15
|
+
The width of the screen before stack-based padding is applied
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
```svelte
|
|
19
|
+
<script>
|
|
20
|
+
import { Scren, Button, Paper } from "@axel669/zephyr"
|
|
21
|
+
|
|
22
|
+
export let close
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<Screen width="70%">
|
|
26
|
+
<Paper>
|
|
27
|
+
This screen is pretty cool I swear
|
|
28
|
+
<Button on:click={() => close("hi")}>
|
|
29
|
+
Close
|
|
30
|
+
</Button>
|
|
31
|
+
</Paper>
|
|
32
|
+
</Screen>
|
|
33
|
+
```
|
package/src/layout/screen.svelte
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script context="module">
|
|
4
|
-
const ctxStack = Symbol("stack context")
|
|
5
|
-
const ctxClose = Symbol("close context")
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<script>
|
|
9
|
-
import { getContext, setContext } from "svelte"
|
|
10
|
-
import { fly } from "svelte/transition"
|
|
11
|
-
|
|
12
|
-
import wsx from "../wsx.mjs"
|
|
13
|
-
|
|
14
|
-
export let width = false
|
|
15
|
-
|
|
16
|
-
const stack = getContext(ctxStack) ?? 0
|
|
17
|
-
const animation = {
|
|
18
|
-
y: window.innerHeight,
|
|
19
|
-
duration: 350
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
setContext(ctxStack, stack + 1)
|
|
23
|
-
|
|
24
|
-
$: wind = {
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
"bg.c": "transparent",
|
|
28
|
-
...$$restProps
|
|
29
|
-
}
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<ws-screen use:wsx={wind} transition:fly={animation}>
|
|
33
|
-
<slot />
|
|
34
|
-
</ws-screen>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script context="module">
|
|
4
|
+
const ctxStack = Symbol("stack context")
|
|
5
|
+
const ctxClose = Symbol("close context")
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<script>
|
|
9
|
+
import { getContext, setContext } from "svelte"
|
|
10
|
+
import { fly } from "svelte/transition"
|
|
11
|
+
|
|
12
|
+
import wsx from "../wsx.mjs"
|
|
13
|
+
|
|
14
|
+
export let width = false
|
|
15
|
+
|
|
16
|
+
const stack = getContext(ctxStack) ?? 0
|
|
17
|
+
const animation = {
|
|
18
|
+
y: window.innerHeight,
|
|
19
|
+
duration: 350
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
setContext(ctxStack, stack + 1)
|
|
23
|
+
|
|
24
|
+
$: wind = {
|
|
25
|
+
"@stack": stack.toString(),
|
|
26
|
+
"@screen-width": width,
|
|
27
|
+
"bg.c": "transparent",
|
|
28
|
+
...$$restProps
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<ws-screen use:wsx={wind} transition:fly={animation}>
|
|
33
|
+
<slot />
|
|
34
|
+
</ws-screen>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import wsx from "../wsx.mjs"
|
|
5
|
-
|
|
6
|
-
export let size = "100px"
|
|
7
|
-
export let color = "primary"
|
|
8
|
-
|
|
9
|
-
$: wind = {
|
|
10
|
-
"
|
|
11
|
-
"$color": color,
|
|
12
|
-
}
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<ws-circle-spinner use:wsx={wind} />
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import wsx from "../wsx.mjs"
|
|
5
|
+
|
|
6
|
+
export let size = "100px"
|
|
7
|
+
export let color = "@primary"
|
|
8
|
+
|
|
9
|
+
$: wind = {
|
|
10
|
+
"@size": size,
|
|
11
|
+
"$color": color,
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<ws-circle-spinner use:wsx={wind} />
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import wsx from "../wsx.mjs"
|
|
5
|
-
|
|
6
|
-
export let size = "100px"
|
|
7
|
-
export let color = "primary"
|
|
8
|
-
|
|
9
|
-
$: wind = {
|
|
10
|
-
"
|
|
11
|
-
"$color": color,
|
|
12
|
-
}
|
|
13
|
-
</script>
|
|
14
|
-
|
|
15
|
-
<ws-hexagon-spinner use:wsx={wind} />
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import wsx from "../wsx.mjs"
|
|
5
|
+
|
|
6
|
+
export let size = "100px"
|
|
7
|
+
export let color = "@primary"
|
|
8
|
+
|
|
9
|
+
$: wind = {
|
|
10
|
+
"@size": size,
|
|
11
|
+
"$color": color,
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<ws-hexagon-spinner use:wsx={wind} />
|
package/src/spinner/spinners.md
CHANGED
|
@@ -1,3 +1,22 @@
|
|
|
1
|
-
# Spinners
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# Spinners
|
|
2
|
+
Zephyr exports the CircleSpinner and HexagonSpinner components as wrappers for
|
|
3
|
+
windstorms spinners of the same name. Both spinners are svgs with a bit of code
|
|
4
|
+
setup as web components.
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
### color
|
|
9
|
+
Sets the $color macro.
|
|
10
|
+
|
|
11
|
+
### size
|
|
12
|
+
The size of the spinner (width and height). Uses css units.
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
```svelte
|
|
16
|
+
<script>
|
|
17
|
+
import { HexagonSpinner } from "@axel669/zephyr"
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<HexagonSpinner size="50px" />
|
|
21
|
+
<HexagonSpinner size="500px" color="@secondary" />
|
|
22
|
+
```
|
package/src/text.md
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
# Text
|
|
2
|
-
|
|
3
|
-
Simple component with some common props for types of text.
|
|
4
|
-
|
|
5
|
-
## Props
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
### adorn
|
|
9
|
-
`bool`
|
|
10
|
-
|
|
11
|
-
Sets `$adorn`
|
|
12
|
-
|
|
13
|
-
### block
|
|
14
|
-
`bool`
|
|
15
|
-
|
|
16
|
-
Sets `block`
|
|
17
|
-
|
|
18
|
-
### subtitle
|
|
19
|
-
`bool`
|
|
20
|
-
|
|
21
|
-
Sets `$subtitle`
|
|
22
|
-
|
|
23
|
-
### title
|
|
24
|
-
`bool`
|
|
25
|
-
|
|
26
|
-
Sets `$title`
|
|
27
|
-
|
|
28
|
-
## Example
|
|
29
|
-
```svelte
|
|
30
|
-
<Text>Some text</Text>
|
|
31
|
-
<Text title>Bigger text</Text>
|
|
32
|
-
<Text subtitle>Smaller text</Text>
|
|
33
|
-
<Text block>Text on its own line</Text>
|
|
34
|
-
```
|
|
1
|
+
# Text
|
|
2
|
+
|
|
3
|
+
Simple component with some common props for types of text.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### adorn
|
|
9
|
+
`bool`
|
|
10
|
+
|
|
11
|
+
Sets `$adorn`
|
|
12
|
+
|
|
13
|
+
### block
|
|
14
|
+
`bool`
|
|
15
|
+
|
|
16
|
+
Sets `block`
|
|
17
|
+
|
|
18
|
+
### subtitle
|
|
19
|
+
`bool`
|
|
20
|
+
|
|
21
|
+
Sets `$subtitle`
|
|
22
|
+
|
|
23
|
+
### title
|
|
24
|
+
`bool`
|
|
25
|
+
|
|
26
|
+
Sets `$title`
|
|
27
|
+
|
|
28
|
+
## Example
|
|
29
|
+
```svelte
|
|
30
|
+
<Text>Some text</Text>
|
|
31
|
+
<Text title>Bigger text</Text>
|
|
32
|
+
<Text subtitle>Smaller text</Text>
|
|
33
|
+
<Text block>Text on its own line</Text>
|
|
34
|
+
```
|
package/src/text.svelte
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import wsx from "./wsx.mjs"
|
|
5
|
-
|
|
6
|
-
export let title = false
|
|
7
|
-
export let subtitle = false
|
|
8
|
-
export let block = false
|
|
9
|
-
export let adorn = false
|
|
10
|
-
|
|
11
|
-
$: wind = {
|
|
12
|
-
"$title": title,
|
|
13
|
-
"$subtitle": subtitle,
|
|
14
|
-
"$adorn": adorn,
|
|
15
|
-
block,
|
|
16
|
-
...$$restProps
|
|
17
|
-
}
|
|
18
|
-
</script>
|
|
19
|
-
|
|
20
|
-
<span use:wsx={wind}>
|
|
21
|
-
<slot />
|
|
22
|
-
</span>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import wsx from "./wsx.mjs"
|
|
5
|
+
|
|
6
|
+
export let title = false
|
|
7
|
+
export let subtitle = false
|
|
8
|
+
export let block = false
|
|
9
|
+
export let adorn = false
|
|
10
|
+
|
|
11
|
+
$: wind = {
|
|
12
|
+
"$title": title,
|
|
13
|
+
"$subtitle": subtitle,
|
|
14
|
+
"$adorn": adorn,
|
|
15
|
+
block,
|
|
16
|
+
...$$restProps
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<span use:wsx={wind}>
|
|
21
|
+
<slot />
|
|
22
|
+
</span>
|
package/src/variant.mjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export default ({ flat, fill, outline }, def = "$flat") => {
|
|
2
|
-
if (outline === true) {
|
|
3
|
-
return "$outline"
|
|
4
|
-
}
|
|
5
|
-
if (fill === true) {
|
|
6
|
-
return "$fill"
|
|
7
|
-
}
|
|
8
|
-
if (flat === true) {
|
|
9
|
-
return "$flat"
|
|
10
|
-
}
|
|
11
|
-
return def
|
|
12
|
-
}
|
|
1
|
+
export default ({ flat, fill, outline }, def = "$flat") => {
|
|
2
|
+
if (outline === true) {
|
|
3
|
+
return "$outline"
|
|
4
|
+
}
|
|
5
|
+
if (fill === true) {
|
|
6
|
+
return "$fill"
|
|
7
|
+
}
|
|
8
|
+
if (flat === true) {
|
|
9
|
+
return "$flat"
|
|
10
|
+
}
|
|
11
|
+
return def
|
|
12
|
+
}
|