@axel669/zephyr 0.1.17 → 0.2.0-beta.1
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/LICENSE +21 -21
- package/package.json +10 -7
- package/readme.md +55 -44
- package/src/async/button.svelte +31 -0
- package/src/async/load-zone.svelte +17 -0
- package/src/composed/data-table/th.svelte +60 -0
- package/src/composed/data-table.md +83 -0
- package/src/composed/data-table.svelte +136 -150
- package/src/composed/entry-button.md +34 -0
- package/src/composed/entry-button.svelte +29 -68
- package/src/composed/table-functions.js +13 -0
- package/src/composed/toast/message.svelte +56 -44
- package/src/composed/toast.md +36 -0
- package/src/composed/toast.svelte +68 -108
- package/src/control/button.md +37 -0
- package/src/control/button.svelte +25 -0
- package/src/control/input.svelte +107 -0
- package/src/control/label.md +45 -0
- package/src/control/label.svelte +36 -0
- package/src/control/link.md +46 -0
- package/src/control/link.svelte +28 -0
- package/src/control/radio.md +56 -0
- package/src/control/radio.svelte +26 -0
- package/src/control/select.md +68 -0
- package/src/control/select.svelte +62 -0
- package/src/control/tabs.md +45 -0
- package/src/control/tabs.svelte +39 -0
- package/src/control/toggle.md +55 -0
- package/src/control/toggle.svelte +47 -0
- package/src/data-display/avatar.md +32 -0
- package/src/data-display/avatar.svelte +23 -0
- package/src/data-display/badge.md +24 -0
- package/src/data-display/badge.svelte +12 -0
- package/src/data-display/chip.md +32 -0
- package/src/data-display/chip.svelte +26 -0
- package/src/data-display/details.md +3 -0
- package/src/{details.svelte → data-display/details.svelte} +3 -3
- package/src/data-display/popover.md +28 -0
- package/src/data-display/popover.svelte +23 -0
- package/src/data-display/progress.md +42 -0
- package/src/data-display/progress.svelte +25 -0
- package/src/data-display/table.md +7 -0
- package/src/data-display/table.svelte +36 -0
- package/src/data-display/tooltip.md +25 -0
- package/src/data-display/tooltip.svelte +15 -0
- package/src/dialogs/alert.md +3 -0
- package/src/dialogs/alert.svelte +4 -4
- package/src/dialogs/confirm.md +3 -0
- package/src/dialogs/confirm.svelte +5 -5
- package/src/functions.md +77 -0
- package/src/handler$.mjs +20 -68
- package/src/index.mjs +58 -92
- package/src/info/icon.md +17 -0
- package/src/info/icon.svelte +9 -0
- package/src/info/notification.md +32 -0
- package/src/info/notification.svelte +16 -0
- package/src/info/titlebar.md +49 -0
- package/src/info/titlebar.svelte +18 -0
- package/src/info/toaster.md +22 -0
- package/src/info/toaster.svelte +14 -0
- package/src/inline-dialog.svelte +23 -23
- package/src/layout/dialog.md +34 -0
- package/src/layout/dialog.svelte +24 -0
- package/src/layout/drawer.md +61 -0
- package/src/layout/drawer.svelte +47 -0
- package/src/layout/flex.md +39 -0
- package/src/layout/flex.svelte +22 -0
- package/src/layout/grid.md +57 -0
- package/src/layout/grid.svelte +26 -0
- package/src/layout/modal.md +47 -0
- package/src/layout/modal.svelte +58 -0
- package/src/layout/paper.md +90 -0
- package/src/layout/paper.svelte +45 -0
- package/src/layout/screen.md +28 -0
- package/src/layout/screen.svelte +32 -0
- package/src/{circle-spinner.svelte → spinner/circle-spinner.svelte} +2 -2
- package/src/{hexagon-spinner.svelte → spinner/hexagon-spinner.svelte} +2 -2
- package/src/spinner/spinners.md +3 -0
- package/src/text.md +34 -0
- package/src/text.svelte +20 -49
- package/src/variant.mjs +12 -12
- package/src/wsx.mjs +24 -45
- package/src/avatar.svelte +0 -54
- package/src/badge.svelte +0 -40
- package/src/button.svelte +0 -86
- package/src/chip.svelte +0 -56
- package/src/dialog.svelte +0 -54
- package/src/drawer.svelte +0 -121
- package/src/flex.svelte +0 -57
- package/src/grid.svelte +0 -66
- package/src/icon.svelte +0 -34
- package/src/input/area.svelte +0 -98
- package/src/input/elems.mjs +0 -7
- package/src/input/email.svelte +0 -104
- package/src/input/file.svelte +0 -82
- package/src/input/number.svelte +0 -104
- package/src/input/password.svelte +0 -101
- package/src/input/search.svelte +0 -104
- package/src/input/text.svelte +0 -104
- package/src/link.svelte +0 -67
- package/src/modal.svelte +0 -73
- package/src/notification.svelte +0 -57
- package/src/paper.svelte +0 -127
- package/src/popover.svelte +0 -60
- package/src/progress.svelte +0 -60
- package/src/radio.svelte +0 -82
- package/src/screen.svelte +0 -69
- package/src/select.svelte +0 -122
- package/src/table.svelte +0 -69
- package/src/tabs.svelte +0 -78
- package/src/titlebar.svelte +0 -69
- package/src/toaster.svelte +0 -42
- package/src/toggle.svelte +0 -94
- package/src/tooltip.svelte +0 -45
- package/src/vars.mjs +0 -61
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
<script context="module">
|
|
2
|
+
const groupOptions = (options) => options.reduce(
|
|
3
|
+
({grouped, target = grouped}, item, pos) => {
|
|
4
|
+
const opt = { ... item, pos }
|
|
5
|
+
if (item.group === undefined) {
|
|
6
|
+
target.push(opt)
|
|
7
|
+
return { grouped, target }
|
|
8
|
+
}
|
|
9
|
+
const next = [opt]
|
|
10
|
+
grouped.push(next)
|
|
11
|
+
return { grouped, target: next }
|
|
12
|
+
},
|
|
13
|
+
{ grouped: [] }
|
|
14
|
+
).grouped
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<script>
|
|
18
|
+
import wsx from "../wsx.mjs"
|
|
19
|
+
|
|
20
|
+
export let options = []
|
|
21
|
+
export let value
|
|
22
|
+
export let color = "default"
|
|
23
|
+
export let outline = false
|
|
24
|
+
export let label = null
|
|
25
|
+
export let disabled = false
|
|
26
|
+
|
|
27
|
+
const update = (evt) => value = options[evt.target.value].value
|
|
28
|
+
|
|
29
|
+
$: indexValue = options.findIndex(item => item.value === value)
|
|
30
|
+
|
|
31
|
+
$: grouped = groupOptions(options)
|
|
32
|
+
|
|
33
|
+
$: wind = {
|
|
34
|
+
"$control": true,
|
|
35
|
+
"$outline": outline,
|
|
36
|
+
"$color": color,
|
|
37
|
+
...$$restProps,
|
|
38
|
+
}
|
|
39
|
+
</script>
|
|
40
|
+
|
|
41
|
+
<label use:wsx={wind}>
|
|
42
|
+
{#if label}
|
|
43
|
+
<span ws-x="$text">{label}</span>
|
|
44
|
+
{/if}
|
|
45
|
+
<select value={indexValue} on:input={update} {disabled}>
|
|
46
|
+
{#each grouped as item, index}
|
|
47
|
+
{#if Array.isArray(item) === false}
|
|
48
|
+
<option value={item.pos}>
|
|
49
|
+
{item.label}
|
|
50
|
+
</option>
|
|
51
|
+
{:else}
|
|
52
|
+
<optgroup label={item[0].group}>
|
|
53
|
+
{#each item.slice(1) as subitem, subindex}
|
|
54
|
+
<option value={subitem.pos}>
|
|
55
|
+
{subitem.label}
|
|
56
|
+
</option>
|
|
57
|
+
{/each}
|
|
58
|
+
</optgroup>
|
|
59
|
+
{/if}
|
|
60
|
+
{/each}
|
|
61
|
+
</select>
|
|
62
|
+
</label>
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Tabs
|
|
2
|
+
|
|
3
|
+
It's tabs, everyone knows what tabs are at this point.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
### color
|
|
8
|
+
`string`
|
|
9
|
+
|
|
10
|
+
Sets `$color`
|
|
11
|
+
|
|
12
|
+
### options
|
|
13
|
+
`Array[Object]`
|
|
14
|
+
|
|
15
|
+
An array of options where each item is `{ label, value }`. `label`
|
|
16
|
+
should be a string, `value` can be of any type.
|
|
17
|
+
|
|
18
|
+
### vertical
|
|
19
|
+
`bool`
|
|
20
|
+
|
|
21
|
+
Sets `$vert`
|
|
22
|
+
|
|
23
|
+
### solid
|
|
24
|
+
`bool`
|
|
25
|
+
|
|
26
|
+
Sets `$solid`
|
|
27
|
+
|
|
28
|
+
### value
|
|
29
|
+
`any`
|
|
30
|
+
|
|
31
|
+
The value of the currently selected tab. Can be bound to react to
|
|
32
|
+
changes and set to control which tab is selected.
|
|
33
|
+
|
|
34
|
+
## Example
|
|
35
|
+
```svelte
|
|
36
|
+
<script>
|
|
37
|
+
const options = [
|
|
38
|
+
{ label: "Left", value: "left" },
|
|
39
|
+
{ label: "Right", value: 2 },
|
|
40
|
+
]
|
|
41
|
+
</script>
|
|
42
|
+
|
|
43
|
+
<Tab {options} bind:value color="primary" />
|
|
44
|
+
<Tab {options} bind:value color="secondary" solid vertical />
|
|
45
|
+
```
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import wsx from "../wsx.mjs"
|
|
3
|
+
import { handler$ } from "../handler$.mjs"
|
|
4
|
+
|
|
5
|
+
export let color = "primary"
|
|
6
|
+
export let options = []
|
|
7
|
+
export let vertical = false
|
|
8
|
+
export let solid = false
|
|
9
|
+
export let value
|
|
10
|
+
|
|
11
|
+
$: index = options.findIndex(item => item.value === value)
|
|
12
|
+
|
|
13
|
+
const set = handler$(
|
|
14
|
+
(next) => {
|
|
15
|
+
if (value === next) {
|
|
16
|
+
return
|
|
17
|
+
}
|
|
18
|
+
value = next
|
|
19
|
+
}
|
|
20
|
+
)
|
|
21
|
+
|
|
22
|
+
$: wind = {
|
|
23
|
+
"@solid": solid,
|
|
24
|
+
"$color": color,
|
|
25
|
+
$vert: vertical,
|
|
26
|
+
...$$restProps,
|
|
27
|
+
}
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
31
|
+
<ws-tabs use:wsx={wind} role="tablist">
|
|
32
|
+
{#each options as tab, i}
|
|
33
|
+
<!-- svelte-ignore a11y-interactive-supports-focus -->
|
|
34
|
+
<ws-tab use:wsx={{"$tab-selected": index === i}}
|
|
35
|
+
on:click={set(tab.value)} role="tab">
|
|
36
|
+
{tab.label}
|
|
37
|
+
</ws-tab>
|
|
38
|
+
{/each}
|
|
39
|
+
</ws-tabs>
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Toggle
|
|
2
|
+
|
|
3
|
+
The Toggle component is used to display checkboxes and switches.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
### color
|
|
8
|
+
`string`
|
|
9
|
+
|
|
10
|
+
Sets `$color`
|
|
11
|
+
|
|
12
|
+
### checkbox
|
|
13
|
+
`bool`
|
|
14
|
+
|
|
15
|
+
If true, the toggle is displayed as a checkbox. Default is false
|
|
16
|
+
(shown as a switch)
|
|
17
|
+
|
|
18
|
+
### checked
|
|
19
|
+
`bool`
|
|
20
|
+
|
|
21
|
+
Controls if the toggle is checked or not. Can be bound.
|
|
22
|
+
|
|
23
|
+
### group
|
|
24
|
+
Used for binding, see the
|
|
25
|
+
[Svelte bind:group](https://svelte.dev/docs/element-directives#bind-group)
|
|
26
|
+
for details.
|
|
27
|
+
|
|
28
|
+
### label
|
|
29
|
+
`string`
|
|
30
|
+
|
|
31
|
+
The text to use for the label
|
|
32
|
+
|
|
33
|
+
### flat
|
|
34
|
+
`bool`
|
|
35
|
+
|
|
36
|
+
Sets `$flat`
|
|
37
|
+
|
|
38
|
+
### reverse
|
|
39
|
+
`bool`
|
|
40
|
+
|
|
41
|
+
If true, the input being toggled will be on the left instead of the
|
|
42
|
+
right. Default is false (label is on the left)
|
|
43
|
+
|
|
44
|
+
### value
|
|
45
|
+
`any`
|
|
46
|
+
|
|
47
|
+
Only used in conjunction with bind:group, see Svelte docs
|
|
48
|
+
|
|
49
|
+
## Example
|
|
50
|
+
```svelte
|
|
51
|
+
<Toggle label="Active" bind:checked />
|
|
52
|
+
<Toggle label="Active" checkbox bind:checked />
|
|
53
|
+
<Toggle label="Active" checkbox reverse bind:checked />
|
|
54
|
+
<Toggle label="Active" checkbox flat color="danger" bind:checked />
|
|
55
|
+
```
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import wsx from "../wsx.mjs"
|
|
3
|
+
|
|
4
|
+
export let label = ""
|
|
5
|
+
export let color = "default"
|
|
6
|
+
export let checked = false
|
|
7
|
+
export let flat = false
|
|
8
|
+
export let value
|
|
9
|
+
export let group = []
|
|
10
|
+
export let checkbox = false
|
|
11
|
+
export let reverse = false
|
|
12
|
+
|
|
13
|
+
$: container = {
|
|
14
|
+
"$toggle": true,
|
|
15
|
+
"$flat": flat,
|
|
16
|
+
"$color": color,
|
|
17
|
+
"fl.dir": reverse ? "row-reverse" : false,
|
|
18
|
+
...$$restProps,
|
|
19
|
+
}
|
|
20
|
+
$: input = {
|
|
21
|
+
"$switch": checkbox === false
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const updateGroup = (checked) => {
|
|
25
|
+
if (checked === true) {
|
|
26
|
+
if (group.includes(value) === true) {
|
|
27
|
+
return
|
|
28
|
+
}
|
|
29
|
+
group = [...group, value]
|
|
30
|
+
return
|
|
31
|
+
}
|
|
32
|
+
if (group.includes(value) === false) {
|
|
33
|
+
return
|
|
34
|
+
}
|
|
35
|
+
group = group.filter(item => item !== value)
|
|
36
|
+
}
|
|
37
|
+
$: updateGroup(checked)
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<label use:wsx={container}>
|
|
41
|
+
<div>
|
|
42
|
+
<slot>
|
|
43
|
+
{label}
|
|
44
|
+
</slot>
|
|
45
|
+
</div>
|
|
46
|
+
<input type="checkbox" bind:checked use:wsx={input} />
|
|
47
|
+
</label>
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Avatar
|
|
2
|
+
|
|
3
|
+
Displays an image or text in a circular container.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
### alt
|
|
8
|
+
`string`
|
|
9
|
+
|
|
10
|
+
Alt text for the image. Has no effect if image prop is not used.
|
|
11
|
+
|
|
12
|
+
### color
|
|
13
|
+
`string`
|
|
14
|
+
|
|
15
|
+
Sets `$color`
|
|
16
|
+
|
|
17
|
+
### image
|
|
18
|
+
`string`
|
|
19
|
+
|
|
20
|
+
An image url. If no url is provided the text property is displayed.
|
|
21
|
+
|
|
22
|
+
### text
|
|
23
|
+
`string`
|
|
24
|
+
|
|
25
|
+
Text to show in the avatar area if image is not used.
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
```svelte
|
|
29
|
+
<Avatar image="url" />
|
|
30
|
+
<Avatar image="url" alt="text" />
|
|
31
|
+
<Avatar text="Hi" color="primary" />
|
|
32
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import wsx from "../wsx.mjs"
|
|
3
|
+
|
|
4
|
+
export let alt = ""
|
|
5
|
+
export let image = null
|
|
6
|
+
|
|
7
|
+
export let text = ""
|
|
8
|
+
|
|
9
|
+
export let color = false
|
|
10
|
+
|
|
11
|
+
$: wind = {
|
|
12
|
+
"$color": color,
|
|
13
|
+
...$$restProps
|
|
14
|
+
}
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<ws-avatar use:wsx={wind}>
|
|
18
|
+
{#if image !== null}
|
|
19
|
+
<img src={image} {alt} />
|
|
20
|
+
{:else}
|
|
21
|
+
{text}
|
|
22
|
+
{/if}
|
|
23
|
+
</ws-avatar>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# Badge
|
|
2
|
+
Adds a small badge over the upper-right corner of some content.
|
|
3
|
+
|
|
4
|
+
## Props
|
|
5
|
+
|
|
6
|
+
### color
|
|
7
|
+
`string`
|
|
8
|
+
|
|
9
|
+
Sets `$color`
|
|
10
|
+
|
|
11
|
+
### text
|
|
12
|
+
`string`
|
|
13
|
+
|
|
14
|
+
The badge text.
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
```svelte
|
|
18
|
+
<Badge text="100">
|
|
19
|
+
Unread Messages
|
|
20
|
+
</Badge>
|
|
21
|
+
<Badge text="1k+" color="warning">
|
|
22
|
+
<button>Clickable Content</button>
|
|
23
|
+
</Badge>
|
|
24
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Chip
|
|
2
|
+
|
|
3
|
+
Shows a small piece of information that is separate from the surrounding
|
|
4
|
+
info and optionally allows interaction.
|
|
5
|
+
|
|
6
|
+
## Props
|
|
7
|
+
|
|
8
|
+
### color
|
|
9
|
+
`string`
|
|
10
|
+
|
|
11
|
+
Sets `$color`
|
|
12
|
+
|
|
13
|
+
### clickable
|
|
14
|
+
`bool`
|
|
15
|
+
|
|
16
|
+
If true, the chip will have the button ripple effect when clicked.
|
|
17
|
+
|
|
18
|
+
### fill
|
|
19
|
+
`bool`
|
|
20
|
+
|
|
21
|
+
If true, sets $fill on the chip. If false $outline is set instead.
|
|
22
|
+
|
|
23
|
+
## Events
|
|
24
|
+
- click
|
|
25
|
+
|
|
26
|
+
## Example
|
|
27
|
+
```svelte
|
|
28
|
+
Emails:
|
|
29
|
+
<Chip clickable>admin@site.com</Chip>
|
|
30
|
+
<Chip clickable color="warning">weirdge@site.com</Chip>
|
|
31
|
+
<Chip color="primary" fill>required@site.io</Chip>
|
|
32
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import wsx from "../wsx.mjs"
|
|
3
|
+
import variant from "../variant.mjs"
|
|
4
|
+
|
|
5
|
+
export let color = "default"
|
|
6
|
+
export let clickable = false
|
|
7
|
+
|
|
8
|
+
export let fill = false
|
|
9
|
+
export let outline = false
|
|
10
|
+
export let flat = false
|
|
11
|
+
|
|
12
|
+
$: type = variant({ fill, flat, outline }, "$outline")
|
|
13
|
+
|
|
14
|
+
$: wind = {
|
|
15
|
+
[type]: true,
|
|
16
|
+
"$color": color,
|
|
17
|
+
$click: clickable,
|
|
18
|
+
...$$restProps
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
23
|
+
<!-- svelte-ignore a11y-interactive-supports-focus -->
|
|
24
|
+
<ws-chip use:wsx={wind} on:click role="button">
|
|
25
|
+
<slot />
|
|
26
|
+
</ws-chip>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import wsx from "
|
|
2
|
+
import wsx from "../wsx.mjs"
|
|
3
3
|
|
|
4
4
|
export let label
|
|
5
5
|
export let outline
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
export let open = false
|
|
8
8
|
|
|
9
9
|
$: wind = {
|
|
10
|
-
$color: color,
|
|
11
|
-
"
|
|
10
|
+
"$color": color,
|
|
11
|
+
"$outline": outline,
|
|
12
12
|
...$$restProps,
|
|
13
13
|
}
|
|
14
14
|
</script>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# Popover
|
|
2
|
+
|
|
3
|
+
The Popover component is for displaying content over something without it
|
|
4
|
+
being modal (you can interact with things under it still).
|
|
5
|
+
|
|
6
|
+
## Variables
|
|
7
|
+
- show
|
|
8
|
+
- hide
|
|
9
|
+
The Popover exposes 2 variables for use: `show` and `hide`. These functions
|
|
10
|
+
are given to the content so that it can control when to display the popover
|
|
11
|
+
content without needing to bind to the parent.
|
|
12
|
+
|
|
13
|
+
> Beacuse the hide function is given to a named slot, the `let:hide` declaration
|
|
14
|
+
> needs to be on the slotted element.
|
|
15
|
+
|
|
16
|
+
## Example
|
|
17
|
+
```svelte
|
|
18
|
+
<Popover let:show>
|
|
19
|
+
<Button on:click={show}>
|
|
20
|
+
Show
|
|
21
|
+
</Button>
|
|
22
|
+
<div ws-x="inset-x[0px] y[0px] h[100px] bg[teal]" slot="content" let:hide>
|
|
23
|
+
<Button on:click={hide}>
|
|
24
|
+
Hide
|
|
25
|
+
</Button>
|
|
26
|
+
</div>
|
|
27
|
+
</Popover>
|
|
28
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { fade } from "svelte/transition"
|
|
3
|
+
import wsx from "../wsx.mjs"
|
|
4
|
+
|
|
5
|
+
let visible = false
|
|
6
|
+
const show = () => visible = true
|
|
7
|
+
const hide = () => visible = false
|
|
8
|
+
const anim = { duration: 250 }
|
|
9
|
+
|
|
10
|
+
$: wind = {
|
|
11
|
+
$show: true,
|
|
12
|
+
...$$restProps,
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<ws-popover use:wsx={wind}>
|
|
17
|
+
<slot {show} />
|
|
18
|
+
{#if visible}
|
|
19
|
+
<wind-content slot="content" ws-x="inset[0px]" transition:fade={anim}>
|
|
20
|
+
<slot name="content" {hide} />
|
|
21
|
+
</wind-content>
|
|
22
|
+
{/if}
|
|
23
|
+
</ws-popover>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# Progress
|
|
2
|
+
|
|
3
|
+
Displays progress bar with an optional label.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
### color
|
|
8
|
+
`string`
|
|
9
|
+
|
|
10
|
+
Sets `$color`
|
|
11
|
+
|
|
12
|
+
### label
|
|
13
|
+
`string`
|
|
14
|
+
|
|
15
|
+
The label for the bar
|
|
16
|
+
|
|
17
|
+
### max
|
|
18
|
+
`number`
|
|
19
|
+
|
|
20
|
+
Sets the max value for the progress bar. Default is 1
|
|
21
|
+
|
|
22
|
+
### outline
|
|
23
|
+
`bool`
|
|
24
|
+
|
|
25
|
+
Sets `$outline`
|
|
26
|
+
|
|
27
|
+
### row
|
|
28
|
+
`bool`
|
|
29
|
+
|
|
30
|
+
Sets `$row`
|
|
31
|
+
|
|
32
|
+
### value
|
|
33
|
+
`number`
|
|
34
|
+
|
|
35
|
+
Sets the value of the progress bar. Combined with max to determine how
|
|
36
|
+
filled the bar is.
|
|
37
|
+
|
|
38
|
+
## Example
|
|
39
|
+
```svelte
|
|
40
|
+
<Progress color="primary" value={0.1} />
|
|
41
|
+
<Progress color="primary" value={5} max={10} />
|
|
42
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import wsx from "../wsx.mjs"
|
|
3
|
+
|
|
4
|
+
export let value = 0
|
|
5
|
+
export let max = 1
|
|
6
|
+
export let color = "default"
|
|
7
|
+
export let outline = false
|
|
8
|
+
export let row = false
|
|
9
|
+
export let label = null
|
|
10
|
+
|
|
11
|
+
$: wind = {
|
|
12
|
+
"@progress": true,
|
|
13
|
+
"$outline": outline,
|
|
14
|
+
"$color": color,
|
|
15
|
+
$row: row,
|
|
16
|
+
...$$restProps,
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<label use:wsx={wind}>
|
|
21
|
+
{#if label}
|
|
22
|
+
<span ws-x="$text t-ws[nowrap]">{label}</span>
|
|
23
|
+
{/if}
|
|
24
|
+
<progress {value} {max} />
|
|
25
|
+
</label>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import wsx from "../wsx.mjs"
|
|
3
|
+
|
|
4
|
+
export let color = false
|
|
5
|
+
export let fillHeader = false
|
|
6
|
+
export let data = []
|
|
7
|
+
|
|
8
|
+
$: wind = {
|
|
9
|
+
"$color": color,
|
|
10
|
+
"$header-fill": fillHeader,
|
|
11
|
+
...$$restProps,
|
|
12
|
+
}
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<table use:wsx={wind}>
|
|
16
|
+
<thead>
|
|
17
|
+
<slot name="header">
|
|
18
|
+
<tr>
|
|
19
|
+
<th>No Header Template</th>
|
|
20
|
+
</tr>
|
|
21
|
+
</slot>
|
|
22
|
+
</thead>
|
|
23
|
+
<tbody>
|
|
24
|
+
{#each data as row, rowNum}
|
|
25
|
+
{#if row === undefined}
|
|
26
|
+
<slot name="empty-row" {rowNum} />
|
|
27
|
+
{:else}
|
|
28
|
+
<slot name="row" {row} {rowNum}>
|
|
29
|
+
<tr>
|
|
30
|
+
<td>No Row Template</td>
|
|
31
|
+
</tr>
|
|
32
|
+
</slot>
|
|
33
|
+
{/if}
|
|
34
|
+
{/each}
|
|
35
|
+
</tbody>
|
|
36
|
+
</table>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Tooltip
|
|
2
|
+
|
|
3
|
+
Displays a tooltip above (or below) some content when it's hovered.
|
|
4
|
+
|
|
5
|
+
## Props
|
|
6
|
+
|
|
7
|
+
### text
|
|
8
|
+
`string`
|
|
9
|
+
|
|
10
|
+
The text to display in the tooltip.
|
|
11
|
+
|
|
12
|
+
### bottom
|
|
13
|
+
`bool`
|
|
14
|
+
|
|
15
|
+
If true, the tooltip will be shown under the content instead of over.
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
```svelte
|
|
19
|
+
<Tooltip text="This is a button">
|
|
20
|
+
<Button>Do Thing</Button>
|
|
21
|
+
</Tooltip>
|
|
22
|
+
<Tooltip text="This shows under" bottom>
|
|
23
|
+
Just some text content
|
|
24
|
+
</Tooltip>
|
|
25
|
+
```
|
package/src/dialogs/alert.svelte
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Button from "../button.svelte"
|
|
3
|
-
import Dialog from "../dialog.svelte"
|
|
4
|
-
import Icon from "../icon.svelte"
|
|
2
|
+
import Button from "../control/button.svelte"
|
|
3
|
+
import Dialog from "../layout/dialog.svelte"
|
|
4
|
+
import Icon from "../info/icon.svelte"
|
|
5
5
|
import Text from "../text.svelte"
|
|
6
|
-
import Titlebar from "../titlebar.svelte"
|
|
6
|
+
import Titlebar from "../info/titlebar.svelte"
|
|
7
7
|
|
|
8
8
|
export let close
|
|
9
9
|
export let title = "Alert"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script>
|
|
2
|
-
import Button from "../button.svelte"
|
|
3
|
-
import Dialog from "../dialog.svelte"
|
|
4
|
-
import Grid from "../grid.svelte"
|
|
5
|
-
import Icon from "../icon.svelte"
|
|
2
|
+
import Button from "../control/button.svelte"
|
|
3
|
+
import Dialog from "../layout/dialog.svelte"
|
|
4
|
+
import Grid from "../layout/grid.svelte"
|
|
5
|
+
import Icon from "../info/icon.svelte"
|
|
6
6
|
import Text from "../text.svelte"
|
|
7
|
-
import Titlebar from "../titlebar.svelte"
|
|
7
|
+
import Titlebar from "../info/titlebar.svelte"
|
|
8
8
|
|
|
9
9
|
import { handler$ } from "../handler$.mjs"
|
|
10
10
|
|