@axel669/zephyr 0.3.4-beta.0 → 0.3.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/package.json +2 -2
- package/readme.md +63 -63
- package/src/async/button.md +27 -27
- package/src/async/button.svelte +29 -29
- package/src/async/load-zone.md +42 -42
- package/src/async/load-zone.svelte +22 -22
- package/src/composed/data-table/th.md +21 -21
- package/src/composed/data-table/th.svelte +61 -61
- package/src/composed/data-table.md +86 -86
- package/src/composed/data-table.svelte +199 -199
- package/src/composed/entry-button.md +44 -44
- 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 -45
- 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 -87
- package/src/control/input.svelte +109 -109
- package/src/control/label.md +48 -48
- package/src/control/label.svelte +38 -38
- package/src/control/link.md +50 -50
- package/src/control/link.svelte +32 -32
- 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 -43
- 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 -42
- 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 -59
- 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 -42
- package/src/dialogs/alert.svelte +34 -34
- package/src/dialogs/confirm.md +56 -56
- package/src/dialogs/confirm.svelte +45 -45
- package/src/functions.md +108 -108
- package/src/handler$.mjs +20 -20
- package/src/hash.js +14 -14
- package/src/index.mjs +53 -53
- 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 -26
- package/src/layout/grid.md +61 -61
- package/src/layout/grid.svelte +30 -30
- 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 -22
- 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/grid.svelte
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import wsx from "../wsx.mjs"
|
|
5
|
-
|
|
6
|
-
export let direction = false
|
|
7
|
-
export let pad = false
|
|
8
|
-
export let gap = false
|
|
9
|
-
export let cols = null
|
|
10
|
-
export let rows = null
|
|
11
|
-
export let autoCol = false
|
|
12
|
-
export let autoRow = false
|
|
13
|
-
export let scrollable = false
|
|
14
|
-
|
|
15
|
-
$: wind = {
|
|
16
|
-
"gr.flow": direction,
|
|
17
|
-
"gr.cols": cols?.join?.(" ") ?? cols ?? false,
|
|
18
|
-
"gr.rows": rows?.join?.(" ") ?? rows ?? false,
|
|
19
|
-
"gr.cols.a": autoCol,
|
|
20
|
-
"gr.rows.a": autoRow,
|
|
21
|
-
p: pad,
|
|
22
|
-
gap: gap,
|
|
23
|
-
over: (scrollable === true) ? "auto" : null,
|
|
24
|
-
...$$restProps
|
|
25
|
-
}
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
<ws-grid use:wsx={wind}>
|
|
29
|
-
<slot />
|
|
30
|
-
</ws-grid>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import wsx from "../wsx.mjs"
|
|
5
|
+
|
|
6
|
+
export let direction = false
|
|
7
|
+
export let pad = false
|
|
8
|
+
export let gap = false
|
|
9
|
+
export let cols = null
|
|
10
|
+
export let rows = null
|
|
11
|
+
export let autoCol = false
|
|
12
|
+
export let autoRow = false
|
|
13
|
+
export let scrollable = false
|
|
14
|
+
|
|
15
|
+
$: wind = {
|
|
16
|
+
"gr.flow": direction,
|
|
17
|
+
"gr.cols": cols?.join?.(" ") ?? cols ?? false,
|
|
18
|
+
"gr.rows": rows?.join?.(" ") ?? rows ?? false,
|
|
19
|
+
"gr.cols.a": autoCol,
|
|
20
|
+
"gr.rows.a": autoRow,
|
|
21
|
+
p: pad,
|
|
22
|
+
gap: gap,
|
|
23
|
+
over: (scrollable === true) ? "auto" : null,
|
|
24
|
+
...$$restProps
|
|
25
|
+
}
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<ws-grid use:wsx={wind}>
|
|
29
|
+
<slot />
|
|
30
|
+
</ws-grid>
|
package/src/layout/modal.md
CHANGED
|
@@ -1,50 +1,50 @@
|
|
|
1
|
-
# Modal
|
|
2
|
-
|
|
3
|
-
The Modal component is used to control when content should be shown that
|
|
4
|
-
sits over the current content and prevents interaction with the content it
|
|
5
|
-
covers. It is primarily used to show drawers, dialogs, and sub screens.
|
|
6
|
-
|
|
7
|
-
The `show` function will display the component specified inside a ws-modal
|
|
8
|
-
element, and can be awaited for an optional return value. The component
|
|
9
|
-
displayed will be passed any props supplied to `show` and a `close` function
|
|
10
|
-
that can be called to hide the component again. `close` can also be given
|
|
11
|
-
an argument that will be used as the promise value from `show`.
|
|
12
|
-
|
|
13
|
-
If a component that a modal displays exports a `cancel` function, then
|
|
14
|
-
clicking the modal area outside the displayed component will call that
|
|
15
|
-
`cancel` function, allowing any modal component to decide when/if it is
|
|
16
|
-
closes in response to that event.
|
|
17
|
-
|
|
18
|
-
## Props
|
|
19
|
-
Because the Modal does not render content of its own, it does not support
|
|
20
|
-
any wind functions.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### component
|
|
24
|
-
`Component`
|
|
25
|
-
|
|
26
|
-
The component to display when `show` is called
|
|
27
|
-
|
|
28
|
-
## Functions
|
|
29
|
-
|
|
30
|
-
### `show(props?) -> Promise`
|
|
31
|
-
Shows the given component and passes any props provided.
|
|
32
|
-
|
|
33
|
-
## Example
|
|
34
|
-
```svelte
|
|
35
|
-
<script>
|
|
36
|
-
import { Modal, Button } from "@axel669/zephyr"
|
|
37
|
-
import CoolDialog from "./cool-dialog.svelte"
|
|
38
|
-
|
|
39
|
-
let dialog = null
|
|
40
|
-
const dialogThing = async () => {
|
|
41
|
-
const value = await dialog.show({ a: 10, b: 12 })
|
|
42
|
-
console.log(value)
|
|
43
|
-
}
|
|
44
|
-
</script>
|
|
45
|
-
|
|
46
|
-
<Modal component={CoolDialog} bind:this={dialog} />
|
|
47
|
-
<Button on:click={dialogThing}>
|
|
48
|
-
Open Dialog
|
|
49
|
-
</Button>
|
|
50
|
-
```
|
|
1
|
+
# Modal
|
|
2
|
+
|
|
3
|
+
The Modal component is used to control when content should be shown that
|
|
4
|
+
sits over the current content and prevents interaction with the content it
|
|
5
|
+
covers. It is primarily used to show drawers, dialogs, and sub screens.
|
|
6
|
+
|
|
7
|
+
The `show` function will display the component specified inside a ws-modal
|
|
8
|
+
element, and can be awaited for an optional return value. The component
|
|
9
|
+
displayed will be passed any props supplied to `show` and a `close` function
|
|
10
|
+
that can be called to hide the component again. `close` can also be given
|
|
11
|
+
an argument that will be used as the promise value from `show`.
|
|
12
|
+
|
|
13
|
+
If a component that a modal displays exports a `cancel` function, then
|
|
14
|
+
clicking the modal area outside the displayed component will call that
|
|
15
|
+
`cancel` function, allowing any modal component to decide when/if it is
|
|
16
|
+
closes in response to that event.
|
|
17
|
+
|
|
18
|
+
## Props
|
|
19
|
+
Because the Modal does not render content of its own, it does not support
|
|
20
|
+
any wind functions.
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### component
|
|
24
|
+
`Component`
|
|
25
|
+
|
|
26
|
+
The component to display when `show` is called
|
|
27
|
+
|
|
28
|
+
## Functions
|
|
29
|
+
|
|
30
|
+
### `show(props?) -> Promise`
|
|
31
|
+
Shows the given component and passes any props provided.
|
|
32
|
+
|
|
33
|
+
## Example
|
|
34
|
+
```svelte
|
|
35
|
+
<script>
|
|
36
|
+
import { Modal, Button } from "@axel669/zephyr"
|
|
37
|
+
import CoolDialog from "./cool-dialog.svelte"
|
|
38
|
+
|
|
39
|
+
let dialog = null
|
|
40
|
+
const dialogThing = async () => {
|
|
41
|
+
const value = await dialog.show({ a: 10, b: 12 })
|
|
42
|
+
console.log(value)
|
|
43
|
+
}
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<Modal component={CoolDialog} bind:this={dialog} />
|
|
47
|
+
<Button on:click={dialogThing}>
|
|
48
|
+
Open Dialog
|
|
49
|
+
</Button>
|
|
50
|
+
```
|
package/src/layout/modal.svelte
CHANGED
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script context="module">
|
|
4
|
-
let topClose = null
|
|
5
|
-
</script>
|
|
6
|
-
|
|
7
|
-
<script>
|
|
8
|
-
import { tick } from "svelte"
|
|
9
|
-
|
|
10
|
-
export let component
|
|
11
|
-
|
|
12
|
-
let modalProps = null
|
|
13
|
-
let resolver = null
|
|
14
|
-
let displayed = null
|
|
15
|
-
|
|
16
|
-
const close = (value) => {
|
|
17
|
-
resolver(value)
|
|
18
|
-
resolver = null
|
|
19
|
-
modalProps = null
|
|
20
|
-
visible.checked = false
|
|
21
|
-
if (topClose !== close) {
|
|
22
|
-
return
|
|
23
|
-
}
|
|
24
|
-
topClose = null
|
|
25
|
-
}
|
|
26
|
-
const closeToTop = (value) => {
|
|
27
|
-
topClose(value)
|
|
28
|
-
}
|
|
29
|
-
const cancel = () => displayed.cancel?.()
|
|
30
|
-
|
|
31
|
-
export const show = (props) => new Promise(
|
|
32
|
-
async (resolve) => {
|
|
33
|
-
modalProps = props ?? {}
|
|
34
|
-
resolver = resolve
|
|
35
|
-
topClose = topClose ?? close
|
|
36
|
-
await tick()
|
|
37
|
-
setTimeout(
|
|
38
|
-
() => visible.checked = true,
|
|
39
|
-
0
|
|
40
|
-
)
|
|
41
|
-
}
|
|
42
|
-
)
|
|
43
|
-
|
|
44
|
-
let visible = null
|
|
45
|
-
</script>
|
|
46
|
-
|
|
47
|
-
<input type="checkbox" bind:this={visible} ws-x="[disp none]" />
|
|
48
|
-
{#if resolver !== null}
|
|
49
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
50
|
-
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
|
51
|
-
<ws-modal on:click={cancel} role="dialog">
|
|
52
|
-
<svelte:component
|
|
53
|
-
bind:this={displayed}
|
|
54
|
-
this={component}
|
|
55
|
-
{...modalProps}
|
|
56
|
-
{close}
|
|
57
|
-
{closeToTop}
|
|
58
|
-
/>
|
|
59
|
-
</ws-modal>
|
|
60
|
-
{/if}
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script context="module">
|
|
4
|
+
let topClose = null
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<script>
|
|
8
|
+
import { tick } from "svelte"
|
|
9
|
+
|
|
10
|
+
export let component
|
|
11
|
+
|
|
12
|
+
let modalProps = null
|
|
13
|
+
let resolver = null
|
|
14
|
+
let displayed = null
|
|
15
|
+
|
|
16
|
+
const close = (value) => {
|
|
17
|
+
resolver(value)
|
|
18
|
+
resolver = null
|
|
19
|
+
modalProps = null
|
|
20
|
+
visible.checked = false
|
|
21
|
+
if (topClose !== close) {
|
|
22
|
+
return
|
|
23
|
+
}
|
|
24
|
+
topClose = null
|
|
25
|
+
}
|
|
26
|
+
const closeToTop = (value) => {
|
|
27
|
+
topClose(value)
|
|
28
|
+
}
|
|
29
|
+
const cancel = () => displayed.cancel?.()
|
|
30
|
+
|
|
31
|
+
export const show = (props) => new Promise(
|
|
32
|
+
async (resolve) => {
|
|
33
|
+
modalProps = props ?? {}
|
|
34
|
+
resolver = resolve
|
|
35
|
+
topClose = topClose ?? close
|
|
36
|
+
await tick()
|
|
37
|
+
setTimeout(
|
|
38
|
+
() => visible.checked = true,
|
|
39
|
+
0
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
let visible = null
|
|
45
|
+
</script>
|
|
46
|
+
|
|
47
|
+
<input type="checkbox" bind:this={visible} ws-x="[disp none]" />
|
|
48
|
+
{#if resolver !== null}
|
|
49
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
50
|
+
<!-- svelte-ignore a11y-no-noninteractive-element-interactions -->
|
|
51
|
+
<ws-modal on:click={cancel} role="dialog">
|
|
52
|
+
<svelte:component
|
|
53
|
+
bind:this={displayed}
|
|
54
|
+
this={component}
|
|
55
|
+
{...modalProps}
|
|
56
|
+
{close}
|
|
57
|
+
{closeToTop}
|
|
58
|
+
/>
|
|
59
|
+
</ws-modal>
|
|
60
|
+
{/if}
|
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
|
+
```
|