@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/control/tabs.svelte
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import wsx from "../wsx.mjs"
|
|
5
|
-
import { handler$ } from "../handler$.mjs"
|
|
6
|
-
|
|
7
|
-
export let color = "@primary"
|
|
8
|
-
export let options = []
|
|
9
|
-
export let vertical = false
|
|
10
|
-
export let solid = false
|
|
11
|
-
export let value
|
|
12
|
-
|
|
13
|
-
$: index = options.findIndex(item => item.value === value)
|
|
14
|
-
|
|
15
|
-
const set = handler$(
|
|
16
|
-
(next) => {
|
|
17
|
-
if (value === next) {
|
|
18
|
-
return
|
|
19
|
-
}
|
|
20
|
-
value = next
|
|
21
|
-
}
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
$: wind = {
|
|
25
|
-
"$solid": solid,
|
|
26
|
-
"$color": color,
|
|
27
|
-
$vert: vertical,
|
|
28
|
-
...$$restProps,
|
|
29
|
-
}
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
33
|
-
<ws-tabs use:wsx={wind} role="tablist">
|
|
34
|
-
{#each options as tab, i}
|
|
35
|
-
<!-- svelte-ignore a11y-interactive-supports-focus -->
|
|
36
|
-
<ws-tab use:wsx={{"$tab-selected": index === i}}
|
|
37
|
-
on:click={set(tab.value)} role="tab">
|
|
38
|
-
<slot {tab} selected={index === i}>
|
|
39
|
-
{tab.label}
|
|
40
|
-
</slot>
|
|
41
|
-
</ws-tab>
|
|
42
|
-
{/each}
|
|
43
|
-
</ws-tabs>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import wsx from "../wsx.mjs"
|
|
5
|
+
import { handler$ } from "../handler$.mjs"
|
|
6
|
+
|
|
7
|
+
export let color = "@primary"
|
|
8
|
+
export let options = []
|
|
9
|
+
export let vertical = false
|
|
10
|
+
export let solid = false
|
|
11
|
+
export let value
|
|
12
|
+
|
|
13
|
+
$: index = options.findIndex(item => item.value === value)
|
|
14
|
+
|
|
15
|
+
const set = handler$(
|
|
16
|
+
(next) => {
|
|
17
|
+
if (value === next) {
|
|
18
|
+
return
|
|
19
|
+
}
|
|
20
|
+
value = next
|
|
21
|
+
}
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
$: wind = {
|
|
25
|
+
"$solid": solid,
|
|
26
|
+
"$color": color,
|
|
27
|
+
$vert: vertical,
|
|
28
|
+
...$$restProps,
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
33
|
+
<ws-tabs use:wsx={wind} role="tablist">
|
|
34
|
+
{#each options as tab, i}
|
|
35
|
+
<!-- svelte-ignore a11y-interactive-supports-focus -->
|
|
36
|
+
<ws-tab use:wsx={{"$tab-selected": index === i}}
|
|
37
|
+
on:click={set(tab.value)} role="tab">
|
|
38
|
+
<slot {tab} selected={index === i}>
|
|
39
|
+
{tab.label}
|
|
40
|
+
</slot>
|
|
41
|
+
</ws-tab>
|
|
42
|
+
{/each}
|
|
43
|
+
</ws-tabs>
|
package/src/control/toggle.md
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
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
|
-
<script>
|
|
52
|
-
import { Toggle } from "@axel669/zephyr"
|
|
53
|
-
|
|
54
|
-
let checked = false
|
|
55
|
-
</script>
|
|
56
|
-
|
|
57
|
-
<Toggle label="Active" bind:checked />
|
|
58
|
-
<Toggle label="Active" checkbox bind:checked />
|
|
59
|
-
<Toggle label="Active" checkbox reverse bind:checked />
|
|
60
|
-
<Toggle label="Active" checkbox flat color="danger" bind:checked />
|
|
61
|
-
```
|
|
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
|
+
<script>
|
|
52
|
+
import { Toggle } from "@axel669/zephyr"
|
|
53
|
+
|
|
54
|
+
let checked = false
|
|
55
|
+
</script>
|
|
56
|
+
|
|
57
|
+
<Toggle label="Active" bind:checked />
|
|
58
|
+
<Toggle label="Active" checkbox bind:checked />
|
|
59
|
+
<Toggle label="Active" checkbox reverse bind:checked />
|
|
60
|
+
<Toggle label="Active" checkbox flat color="danger" bind:checked />
|
|
61
|
+
```
|
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import wsx from "../wsx.mjs"
|
|
5
|
-
|
|
6
|
-
export let label = ""
|
|
7
|
-
export let color = "@default"
|
|
8
|
-
export let checked = false
|
|
9
|
-
export let flat = false
|
|
10
|
-
export let value
|
|
11
|
-
export let group = []
|
|
12
|
-
export let checkbox = false
|
|
13
|
-
export let reverse = false
|
|
14
|
-
|
|
15
|
-
$: container = {
|
|
16
|
-
"@toggle": true,
|
|
17
|
-
"$flat": flat,
|
|
18
|
-
"$color": color,
|
|
19
|
-
"fl.dir": reverse ? "row-reverse" : false,
|
|
20
|
-
...$$restProps,
|
|
21
|
-
}
|
|
22
|
-
$: input = {
|
|
23
|
-
"@switch": checkbox === false
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const updateGroup = (checked) => {
|
|
27
|
-
if (checked === true) {
|
|
28
|
-
if (group.includes(value) === true) {
|
|
29
|
-
return
|
|
30
|
-
}
|
|
31
|
-
group = [...group, value]
|
|
32
|
-
return
|
|
33
|
-
}
|
|
34
|
-
if (group.includes(value) === false) {
|
|
35
|
-
return
|
|
36
|
-
}
|
|
37
|
-
group = group.filter(item => item !== value)
|
|
38
|
-
}
|
|
39
|
-
$: updateGroup(checked)
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<label use:wsx={container}>
|
|
43
|
-
<div>
|
|
44
|
-
<slot>
|
|
45
|
-
{label}
|
|
46
|
-
</slot>
|
|
47
|
-
</div>
|
|
48
|
-
<input type="checkbox" bind:checked use:wsx={input} />
|
|
49
|
-
</label>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import wsx from "../wsx.mjs"
|
|
5
|
+
|
|
6
|
+
export let label = ""
|
|
7
|
+
export let color = "@default"
|
|
8
|
+
export let checked = false
|
|
9
|
+
export let flat = false
|
|
10
|
+
export let value
|
|
11
|
+
export let group = []
|
|
12
|
+
export let checkbox = false
|
|
13
|
+
export let reverse = false
|
|
14
|
+
|
|
15
|
+
$: container = {
|
|
16
|
+
"@toggle": true,
|
|
17
|
+
"$flat": flat,
|
|
18
|
+
"$color": color,
|
|
19
|
+
"fl.dir": reverse ? "row-reverse" : false,
|
|
20
|
+
...$$restProps,
|
|
21
|
+
}
|
|
22
|
+
$: input = {
|
|
23
|
+
"@switch": checkbox === false
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
const updateGroup = (checked) => {
|
|
27
|
+
if (checked === true) {
|
|
28
|
+
if (group.includes(value) === true) {
|
|
29
|
+
return
|
|
30
|
+
}
|
|
31
|
+
group = [...group, value]
|
|
32
|
+
return
|
|
33
|
+
}
|
|
34
|
+
if (group.includes(value) === false) {
|
|
35
|
+
return
|
|
36
|
+
}
|
|
37
|
+
group = group.filter(item => item !== value)
|
|
38
|
+
}
|
|
39
|
+
$: updateGroup(checked)
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<label use:wsx={container}>
|
|
43
|
+
<div>
|
|
44
|
+
<slot>
|
|
45
|
+
{label}
|
|
46
|
+
</slot>
|
|
47
|
+
</div>
|
|
48
|
+
<input type="checkbox" bind:checked use:wsx={input} />
|
|
49
|
+
</label>
|
|
@@ -1,36 +1,36 @@
|
|
|
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
|
-
<script>
|
|
30
|
-
import { Avatar } from "@axel669/zephyr"
|
|
31
|
-
</script>
|
|
32
|
-
|
|
33
|
-
<Avatar image="url" />
|
|
34
|
-
<Avatar image="url" alt="text" />
|
|
35
|
-
<Avatar text="Hi" color="primary" />
|
|
36
|
-
```
|
|
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
|
+
<script>
|
|
30
|
+
import { Avatar } from "@axel669/zephyr"
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<Avatar image="url" />
|
|
34
|
+
<Avatar image="url" alt="text" />
|
|
35
|
+
<Avatar text="Hi" color="primary" />
|
|
36
|
+
```
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import wsx from "../wsx.mjs"
|
|
5
|
-
|
|
6
|
-
export let alt = ""
|
|
7
|
-
export let image = null
|
|
8
|
-
|
|
9
|
-
export let text = ""
|
|
10
|
-
|
|
11
|
-
export let color = false
|
|
12
|
-
|
|
13
|
-
$: wind = {
|
|
14
|
-
"$color": color,
|
|
15
|
-
...$$restProps
|
|
16
|
-
}
|
|
17
|
-
</script>
|
|
18
|
-
|
|
19
|
-
<ws-avatar use:wsx={wind}>
|
|
20
|
-
{#if image !== null}
|
|
21
|
-
<img src={image} {alt} />
|
|
22
|
-
{:else}
|
|
23
|
-
{text}
|
|
24
|
-
{/if}
|
|
25
|
-
</ws-avatar>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import wsx from "../wsx.mjs"
|
|
5
|
+
|
|
6
|
+
export let alt = ""
|
|
7
|
+
export let image = null
|
|
8
|
+
|
|
9
|
+
export let text = ""
|
|
10
|
+
|
|
11
|
+
export let color = false
|
|
12
|
+
|
|
13
|
+
$: wind = {
|
|
14
|
+
"$color": color,
|
|
15
|
+
...$$restProps
|
|
16
|
+
}
|
|
17
|
+
</script>
|
|
18
|
+
|
|
19
|
+
<ws-avatar use:wsx={wind}>
|
|
20
|
+
{#if image !== null}
|
|
21
|
+
<img src={image} {alt} />
|
|
22
|
+
{:else}
|
|
23
|
+
{text}
|
|
24
|
+
{/if}
|
|
25
|
+
</ws-avatar>
|
|
@@ -1,30 +1,30 @@
|
|
|
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
|
-
<script>
|
|
19
|
-
import { Badge } from "@axel669/zephyr"
|
|
20
|
-
|
|
21
|
-
let count = 10
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<Badge text={count}>
|
|
25
|
-
Unread Messages
|
|
26
|
-
</Badge>
|
|
27
|
-
<Badge text="1k+" color="warning">
|
|
28
|
-
<button on:click={() => count += 1}>Clickable Content</button>
|
|
29
|
-
</Badge>
|
|
30
|
-
```
|
|
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
|
+
<script>
|
|
19
|
+
import { Badge } from "@axel669/zephyr"
|
|
20
|
+
|
|
21
|
+
let count = 10
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<Badge text={count}>
|
|
25
|
+
Unread Messages
|
|
26
|
+
</Badge>
|
|
27
|
+
<Badge text="1k+" color="warning">
|
|
28
|
+
<button on:click={() => count += 1}>Clickable Content</button>
|
|
29
|
+
</Badge>
|
|
30
|
+
```
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import wsx from "../wsx.mjs"
|
|
5
|
-
|
|
6
|
-
export let color = "@default"
|
|
7
|
-
export let text = ""
|
|
8
|
-
|
|
9
|
-
$: wind = { "$color": color, ...$$restProps }
|
|
10
|
-
</script>
|
|
11
|
-
|
|
12
|
-
<ws-badge ws-text={text} use:wsx={wind}>
|
|
13
|
-
<slot />
|
|
14
|
-
</ws-badge>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import wsx from "../wsx.mjs"
|
|
5
|
+
|
|
6
|
+
export let color = "@default"
|
|
7
|
+
export let text = ""
|
|
8
|
+
|
|
9
|
+
$: wind = { "$color": color, ...$$restProps }
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<ws-badge ws-text={text} use:wsx={wind}>
|
|
13
|
+
<slot />
|
|
14
|
+
</ws-badge>
|
package/src/data-display/chip.md
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
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
|
-
<script>
|
|
29
|
-
import { Chip } from "@axel669/zephyr"
|
|
30
|
-
</script>
|
|
31
|
-
|
|
32
|
-
Emails:
|
|
33
|
-
<Chip clickable>admin@site.com</Chip>
|
|
34
|
-
<Chip clickable color="warning">weirdge@site.com</Chip>
|
|
35
|
-
<Chip color="primary" fill>required@site.io</Chip>
|
|
36
|
-
```
|
|
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
|
+
<script>
|
|
29
|
+
import { Chip } from "@axel669/zephyr"
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
Emails:
|
|
33
|
+
<Chip clickable>admin@site.com</Chip>
|
|
34
|
+
<Chip clickable color="warning">weirdge@site.com</Chip>
|
|
35
|
+
<Chip color="primary" fill>required@site.io</Chip>
|
|
36
|
+
```
|
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
<svelte:options immutable />
|
|
2
|
-
|
|
3
|
-
<script>
|
|
4
|
-
import wsx from "../wsx.mjs"
|
|
5
|
-
import variant from "../variant.mjs"
|
|
6
|
-
|
|
7
|
-
export let color = "@default"
|
|
8
|
-
export let clickable = false
|
|
9
|
-
|
|
10
|
-
export let fill = false
|
|
11
|
-
export let outline = false
|
|
12
|
-
export let flat = false
|
|
13
|
-
|
|
14
|
-
$: type = variant({ fill, flat, outline }, "$outline")
|
|
15
|
-
|
|
16
|
-
$: wind = {
|
|
17
|
-
[type]: true,
|
|
18
|
-
"$color": color,
|
|
19
|
-
$click: clickable,
|
|
20
|
-
...$$restProps
|
|
21
|
-
}
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
25
|
-
<!-- svelte-ignore a11y-interactive-supports-focus -->
|
|
26
|
-
<ws-chip use:wsx={wind} on:click role="button">
|
|
27
|
-
<slot />
|
|
28
|
-
</ws-chip>
|
|
1
|
+
<svelte:options immutable />
|
|
2
|
+
|
|
3
|
+
<script>
|
|
4
|
+
import wsx from "../wsx.mjs"
|
|
5
|
+
import variant from "../variant.mjs"
|
|
6
|
+
|
|
7
|
+
export let color = "@default"
|
|
8
|
+
export let clickable = false
|
|
9
|
+
|
|
10
|
+
export let fill = false
|
|
11
|
+
export let outline = false
|
|
12
|
+
export let flat = false
|
|
13
|
+
|
|
14
|
+
$: type = variant({ fill, flat, outline }, "$outline")
|
|
15
|
+
|
|
16
|
+
$: wind = {
|
|
17
|
+
[type]: true,
|
|
18
|
+
"$color": color,
|
|
19
|
+
$click: clickable,
|
|
20
|
+
...$$restProps
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<!-- svelte-ignore a11y-click-events-have-key-events -->
|
|
25
|
+
<!-- svelte-ignore a11y-interactive-supports-focus -->
|
|
26
|
+
<ws-chip use:wsx={wind} on:click role="button">
|
|
27
|
+
<slot />
|
|
28
|
+
</ws-chip>
|