@axel669/zephyr 0.1.3 → 0.1.17
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 +30 -30
- package/src/button.svelte +13 -8
- package/src/chip.svelte +9 -6
- package/src/details.svelte +23 -0
- package/src/dialog.svelte +2 -1
- package/src/index.mjs +1 -0
- package/src/link.svelte +12 -7
- package/src/tabs.svelte +2 -1
- package/src/toggle.svelte +10 -6
- package/src/variant.mjs +12 -0
package/package.json
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@axel669/zephyr",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "",
|
|
5
|
-
"main": "src/index.mjs",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"scripts": {
|
|
8
|
-
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
-
"demo": "rollup -c test/rollup.config.mjs"
|
|
10
|
-
},
|
|
11
|
-
"keywords": [],
|
|
12
|
-
"author": "",
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"dependencies": {
|
|
15
|
-
"@axel669/windstorm": "0.1.
|
|
16
|
-
"@labyrinthos/asuid": "^0.2.0",
|
|
17
|
-
"svelte": "^3.58.0"
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@axel669/ipsen": "^0.3.1",
|
|
21
|
-
"@axel669/rollup-html-input": "^0.1.2",
|
|
22
|
-
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
23
|
-
"@rollup/plugin-terser": "^0.4.0",
|
|
24
|
-
"rollup": "^3.20.2",
|
|
25
|
-
"rollup-plugin-svelte": "^7.1.4"
|
|
26
|
-
},
|
|
27
|
-
"files": [
|
|
28
|
-
"src/"
|
|
29
|
-
]
|
|
30
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@axel669/zephyr",
|
|
3
|
+
"version": "0.1.17",
|
|
4
|
+
"description": "",
|
|
5
|
+
"main": "src/index.mjs",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
9
|
+
"demo": "rollup -c test/rollup.config.mjs"
|
|
10
|
+
},
|
|
11
|
+
"keywords": [],
|
|
12
|
+
"author": "",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"@axel669/windstorm": "0.1.17",
|
|
16
|
+
"@labyrinthos/asuid": "^0.2.0",
|
|
17
|
+
"svelte": "^3.58.0"
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@axel669/ipsen": "^0.3.1",
|
|
21
|
+
"@axel669/rollup-html-input": "^0.1.2",
|
|
22
|
+
"@rollup/plugin-node-resolve": "^15.0.2",
|
|
23
|
+
"@rollup/plugin-terser": "^0.4.0",
|
|
24
|
+
"rollup": "^3.20.2",
|
|
25
|
+
"rollup-plugin-svelte": "^7.1.4"
|
|
26
|
+
},
|
|
27
|
+
"files": [
|
|
28
|
+
"src/"
|
|
29
|
+
]
|
|
30
|
+
}
|
package/src/button.svelte
CHANGED
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
- ### label `string`
|
|
24
24
|
If true, the button will be displayed in the DOM using a `<label>`
|
|
25
25
|
element instead of a `<button>`.
|
|
26
|
-
- ###
|
|
27
|
-
Sets the button type to
|
|
28
|
-
|
|
26
|
+
- ### fill / outline `bool`
|
|
27
|
+
Sets the button type to @fill if fill is true, @outline if outline
|
|
28
|
+
is true, or @flat if neither is true.
|
|
29
29
|
|
|
30
30
|
## Events
|
|
31
31
|
- click
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
<Button on:click={action}>
|
|
36
36
|
Flat Button
|
|
37
37
|
</Button>
|
|
38
|
-
<Button on:click={action}
|
|
38
|
+
<Button on:click={action} outline>
|
|
39
39
|
Outlined Button
|
|
40
40
|
</Button>
|
|
41
|
-
<Button on:click={action}
|
|
41
|
+
<Button on:click={action} fill color="danger">
|
|
42
42
|
Filled Button
|
|
43
43
|
</Button>
|
|
44
44
|
|
|
@@ -50,18 +50,23 @@
|
|
|
50
50
|
*/
|
|
51
51
|
|
|
52
52
|
import wsx from "./wsx.mjs"
|
|
53
|
+
import variant from "./variant.mjs"
|
|
53
54
|
|
|
54
|
-
export let color =
|
|
55
|
+
export let color = false
|
|
55
56
|
export let compact = false
|
|
56
|
-
export let variant = "flat"
|
|
57
57
|
export let disabled
|
|
58
58
|
|
|
59
|
+
export let fill = false
|
|
60
|
+
export let outline = false
|
|
61
|
+
|
|
59
62
|
let _for = ""
|
|
60
63
|
export { _for as for }
|
|
61
64
|
export let label = false
|
|
62
65
|
|
|
66
|
+
$: type = variant({ fill, outline })
|
|
67
|
+
|
|
63
68
|
$: wind = {
|
|
64
|
-
[
|
|
69
|
+
[type]: true,
|
|
65
70
|
$color: color,
|
|
66
71
|
$compact: compact,
|
|
67
72
|
"@button": label,
|
package/src/chip.svelte
CHANGED
|
@@ -17,9 +17,8 @@
|
|
|
17
17
|
Sets `$color`
|
|
18
18
|
- ### clickable `bool`
|
|
19
19
|
If true, the chip will have the button ripple effect when clicked.
|
|
20
|
-
- ###
|
|
21
|
-
|
|
22
|
-
variant is "outline". Currently supports "fill", "outline".
|
|
20
|
+
- ### fill `bool`
|
|
21
|
+
If true, sets @fill on the chip. If false @outline is set instead.
|
|
23
22
|
|
|
24
23
|
## Events
|
|
25
24
|
- click
|
|
@@ -29,18 +28,22 @@
|
|
|
29
28
|
Emails:
|
|
30
29
|
<Chip clickable>admin@site.com</Chip>
|
|
31
30
|
<Chip clickable color="warning">weirdge@site.com</Chip>
|
|
32
|
-
<Chip color="primary">required@site.io</Chip>
|
|
31
|
+
<Chip color="primary" fill>required@site.io</Chip>
|
|
33
32
|
```
|
|
34
33
|
*/
|
|
35
34
|
|
|
36
35
|
import wsx from "./wsx.mjs"
|
|
36
|
+
import variant from "./variant.mjs"
|
|
37
37
|
|
|
38
38
|
export let color = "default"
|
|
39
39
|
export let clickable = false
|
|
40
|
-
|
|
40
|
+
|
|
41
|
+
export let fill = false
|
|
42
|
+
|
|
43
|
+
$: type = variant({ fill }, "@outline")
|
|
41
44
|
|
|
42
45
|
$: wind = {
|
|
43
|
-
[
|
|
46
|
+
[type]: true,
|
|
44
47
|
$color: color,
|
|
45
48
|
$click: clickable,
|
|
46
49
|
...$$restProps
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import wsx from "./wsx.mjs"
|
|
3
|
+
|
|
4
|
+
export let label
|
|
5
|
+
export let outline
|
|
6
|
+
export let color = "default"
|
|
7
|
+
export let open = false
|
|
8
|
+
|
|
9
|
+
$: wind = {
|
|
10
|
+
$color: color,
|
|
11
|
+
"@outline": outline,
|
|
12
|
+
...$$restProps,
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<details use:wsx={wind} bind:open>
|
|
17
|
+
<summary>
|
|
18
|
+
<slot name="label">
|
|
19
|
+
{label}
|
|
20
|
+
</slot>
|
|
21
|
+
</summary>
|
|
22
|
+
<slot />
|
|
23
|
+
</details>
|
package/src/dialog.svelte
CHANGED
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
import Paper from "./paper.svelte"
|
|
45
45
|
</script>
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
48
|
+
<wind-wrapper transition:fade={{ duration: 200 }} ws-x="@dialog grid" on:click|stopPropagation>
|
|
48
49
|
<Paper {...$$props}>
|
|
49
50
|
<slot name="header" slot="header" />
|
|
50
51
|
<slot />
|
package/src/index.mjs
CHANGED
|
@@ -49,6 +49,7 @@ export { default as Avatar } from "./avatar.svelte"
|
|
|
49
49
|
export { default as Badge } from "./badge.svelte"
|
|
50
50
|
export { default as Button } from "./button.svelte"
|
|
51
51
|
export { default as Chip } from "./chip.svelte"
|
|
52
|
+
export { default as Details } from "./details.svelte"
|
|
52
53
|
export { default as Dialog } from "./dialog.svelte"
|
|
53
54
|
export { default as Drawer } from "./drawer.svelte"
|
|
54
55
|
export { default as Flex } from "./flex.svelte"
|
package/src/link.svelte
CHANGED
|
@@ -24,34 +24,39 @@
|
|
|
24
24
|
Sets the rel attribute.
|
|
25
25
|
- ### target `string`
|
|
26
26
|
Sets the target attribute
|
|
27
|
-
- ###
|
|
28
|
-
Sets the link-button type to
|
|
29
|
-
|
|
27
|
+
- ### fill / outline `bool`
|
|
28
|
+
Sets the link-button type to @fill if fill is true, @outline if outline
|
|
29
|
+
is true, or @flat if neither is true.
|
|
30
30
|
|
|
31
31
|
## Usage
|
|
32
32
|
```svelte
|
|
33
33
|
<Link color="primary" href="test" target="_blank">
|
|
34
34
|
Test
|
|
35
35
|
</Link>
|
|
36
|
-
<Link color="primary" href="logout" button
|
|
36
|
+
<Link color="primary" href="logout" button outline>
|
|
37
37
|
Logout
|
|
38
38
|
</Link>
|
|
39
39
|
```
|
|
40
40
|
*/
|
|
41
41
|
|
|
42
42
|
import wsx from "./wsx.mjs"
|
|
43
|
+
import variant from "./variant.mjs"
|
|
43
44
|
|
|
44
45
|
export let button = false
|
|
45
|
-
export let
|
|
46
|
-
export let color = "default"
|
|
46
|
+
export let color = false
|
|
47
47
|
|
|
48
48
|
export let href = ""
|
|
49
49
|
export let rel = "noreferrer"
|
|
50
50
|
export let target = null
|
|
51
51
|
|
|
52
|
+
export let fill = false
|
|
53
|
+
export let outline = false
|
|
54
|
+
|
|
55
|
+
$: type = variant({ fill, outline })
|
|
56
|
+
|
|
52
57
|
$: wind = {
|
|
53
58
|
"@button": button,
|
|
54
|
-
[
|
|
59
|
+
[type]: true,
|
|
55
60
|
$color: color,
|
|
56
61
|
...$$restProps
|
|
57
62
|
}
|
package/src/tabs.svelte
CHANGED
|
@@ -70,7 +70,8 @@
|
|
|
70
70
|
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
71
71
|
<ws-tabs use:wsx={wind}>
|
|
72
72
|
{#each options as tab, i}
|
|
73
|
-
<ws-tab tab-selected
|
|
73
|
+
<ws-tab use:wsx={{"$tab-selected": index === i}}
|
|
74
|
+
on:click={set(tab.value)}>
|
|
74
75
|
{tab.label}
|
|
75
76
|
</ws-tab>
|
|
76
77
|
{/each}
|
package/src/toggle.svelte
CHANGED
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
Used for binding, see the Svelte bind:group for details
|
|
26
26
|
- ### label `string`
|
|
27
27
|
The text to use for the label
|
|
28
|
-
- ###
|
|
29
|
-
Sets
|
|
28
|
+
- ### flat `bool`
|
|
29
|
+
Sets `@flat`
|
|
30
30
|
- ### reverse `bool`
|
|
31
31
|
If true, the input being toggled will be on the left instead of the
|
|
32
32
|
right. Default is false (label is on the left)
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
<Toggle label="Active" bind:checked />
|
|
39
39
|
<Toggle label="Active" checkbox bind:checked />
|
|
40
40
|
<Toggle label="Active" checkbox reverse bind:checked />
|
|
41
|
-
<Toggle label="Active" checkbox
|
|
41
|
+
<Toggle label="Active" checkbox flat color="danger" bind:checked />
|
|
42
42
|
```
|
|
43
43
|
*/
|
|
44
44
|
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
export let label = ""
|
|
48
48
|
export let color = "default"
|
|
49
49
|
export let checked = false
|
|
50
|
-
export let
|
|
50
|
+
export let flat = false
|
|
51
51
|
export let value
|
|
52
52
|
export let group = []
|
|
53
53
|
export let checkbox = false
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
|
|
56
56
|
$: container = {
|
|
57
57
|
"@toggle": true,
|
|
58
|
-
"@
|
|
58
|
+
"@flat": flat,
|
|
59
59
|
$color: color,
|
|
60
60
|
...$$restProps,
|
|
61
61
|
}
|
|
@@ -81,7 +81,11 @@
|
|
|
81
81
|
|
|
82
82
|
<label use:wsx={container}>
|
|
83
83
|
{#if reverse !== true}
|
|
84
|
-
|
|
84
|
+
{#if $$slots.default}
|
|
85
|
+
<slot />
|
|
86
|
+
{:else}
|
|
87
|
+
<span>{label}</span>
|
|
88
|
+
{/if}
|
|
85
89
|
{/if}
|
|
86
90
|
<input type="checkbox" bind:checked use:wsx={input} />
|
|
87
91
|
{#if reverse === true}
|