@axel669/zephyr 0.3.4-beta.0 → 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 -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/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
|
-
"@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
|
+
<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
|
-
"@size": size,
|
|
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
|
-
"@size": size,
|
|
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,22 +1,22 @@
|
|
|
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
|
-
```
|
|
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
|
+
}
|
package/src/wsx.mjs
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import ws from "@axel669/windstorm"
|
|
2
|
-
|
|
3
|
-
// ws.custom("outline", (o) => ws.prop("outline", o))
|
|
4
|
-
|
|
5
|
-
export default (node, props) => {
|
|
6
|
-
const update = (props) => {
|
|
7
|
-
const { slot = null, ...goodProps } = props ?? {}
|
|
8
|
-
if (goodProps === null || goodProps === undefined) {
|
|
9
|
-
node.setAttribute("ws-x", null)
|
|
10
|
-
return
|
|
11
|
-
}
|
|
12
|
-
node.setAttribute(
|
|
13
|
-
"ws-x",
|
|
14
|
-
ws.x(goodProps)
|
|
15
|
-
)
|
|
16
|
-
if (slot === null) {
|
|
17
|
-
node.removeAttribute("slot")
|
|
18
|
-
return
|
|
19
|
-
}
|
|
20
|
-
node.setAttribute("slot", slot)
|
|
21
|
-
}
|
|
22
|
-
update(props)
|
|
23
|
-
return { update }
|
|
24
|
-
}
|
|
1
|
+
import ws from "@axel669/windstorm"
|
|
2
|
+
|
|
3
|
+
// ws.custom("outline", (o) => ws.prop("outline", o))
|
|
4
|
+
|
|
5
|
+
export default (node, props) => {
|
|
6
|
+
const update = (props) => {
|
|
7
|
+
const { slot = null, ...goodProps } = props ?? {}
|
|
8
|
+
if (goodProps === null || goodProps === undefined) {
|
|
9
|
+
node.setAttribute("ws-x", null)
|
|
10
|
+
return
|
|
11
|
+
}
|
|
12
|
+
node.setAttribute(
|
|
13
|
+
"ws-x",
|
|
14
|
+
ws.x(goodProps)
|
|
15
|
+
)
|
|
16
|
+
if (slot === null) {
|
|
17
|
+
node.removeAttribute("slot")
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
node.setAttribute("slot", slot)
|
|
21
|
+
}
|
|
22
|
+
update(props)
|
|
23
|
+
return { update }
|
|
24
|
+
}
|