@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.
Files changed (86) hide show
  1. package/package.json +33 -33
  2. package/readme.md +63 -63
  3. package/src/async/button.md +27 -27
  4. package/src/async/button.svelte +29 -29
  5. package/src/async/load-zone.md +42 -42
  6. package/src/async/load-zone.svelte +22 -22
  7. package/src/composed/data-table/th.md +21 -21
  8. package/src/composed/data-table/th.svelte +61 -61
  9. package/src/composed/data-table.md +86 -86
  10. package/src/composed/data-table.svelte +199 -199
  11. package/src/composed/entry-button.md +44 -44
  12. package/src/composed/entry-button.svelte +31 -31
  13. package/src/composed/table-functions.js +13 -13
  14. package/src/composed/toast/message.svelte +56 -56
  15. package/src/composed/toast.md +45 -45
  16. package/src/composed/toast.svelte +70 -70
  17. package/src/control/button.md +41 -41
  18. package/src/control/button.svelte +27 -27
  19. package/src/control/input.md +87 -87
  20. package/src/control/input.svelte +109 -109
  21. package/src/control/label.md +48 -48
  22. package/src/control/label.svelte +38 -38
  23. package/src/control/link.md +50 -50
  24. package/src/control/link.svelte +32 -32
  25. package/src/control/radio.md +58 -58
  26. package/src/control/radio.svelte +28 -28
  27. package/src/control/select.md +70 -70
  28. package/src/control/select.svelte +64 -64
  29. package/src/control/tabs.md +47 -47
  30. package/src/control/tabs.svelte +43 -43
  31. package/src/control/toggle.md +61 -61
  32. package/src/control/toggle.svelte +49 -49
  33. package/src/data-display/avatar.md +36 -36
  34. package/src/data-display/avatar.svelte +25 -25
  35. package/src/data-display/badge.md +30 -30
  36. package/src/data-display/badge.svelte +14 -14
  37. package/src/data-display/chip.md +36 -36
  38. package/src/data-display/chip.svelte +28 -28
  39. package/src/data-display/details.md +42 -42
  40. package/src/data-display/details.svelte +25 -25
  41. package/src/data-display/popover.md +32 -32
  42. package/src/data-display/popover.svelte +25 -25
  43. package/src/data-display/progress.md +46 -46
  44. package/src/data-display/progress.svelte +27 -27
  45. package/src/data-display/table.md +59 -59
  46. package/src/data-display/table.svelte +38 -38
  47. package/src/data-display/tooltip.md +29 -29
  48. package/src/data-display/tooltip.svelte +17 -17
  49. package/src/dialogs/alert.md +42 -42
  50. package/src/dialogs/alert.svelte +34 -34
  51. package/src/dialogs/confirm.md +56 -56
  52. package/src/dialogs/confirm.svelte +45 -45
  53. package/src/functions.md +108 -108
  54. package/src/handler$.mjs +20 -20
  55. package/src/hash.js +14 -14
  56. package/src/index.mjs +53 -53
  57. package/src/info/icon.md +21 -21
  58. package/src/info/icon.svelte +9 -9
  59. package/src/info/notification.md +36 -36
  60. package/src/info/notification.svelte +16 -16
  61. package/src/info/titlebar.md +75 -75
  62. package/src/info/titlebar.svelte +18 -18
  63. package/src/info/toaster.md +26 -26
  64. package/src/info/toaster.svelte +14 -14
  65. package/src/inline-dialog.svelte +23 -23
  66. package/src/layout/dialog.md +43 -43
  67. package/src/layout/dialog.svelte +26 -26
  68. package/src/layout/drawer.md +70 -70
  69. package/src/layout/drawer.svelte +49 -49
  70. package/src/layout/flex.md +43 -43
  71. package/src/layout/flex.svelte +26 -26
  72. package/src/layout/grid.md +61 -61
  73. package/src/layout/grid.svelte +30 -30
  74. package/src/layout/modal.md +50 -50
  75. package/src/layout/modal.svelte +60 -60
  76. package/src/layout/paper.md +94 -94
  77. package/src/layout/paper.svelte +47 -47
  78. package/src/layout/screen.md +33 -33
  79. package/src/layout/screen.svelte +34 -34
  80. package/src/spinner/circle-spinner.svelte +15 -15
  81. package/src/spinner/hexagon-spinner.svelte +15 -15
  82. package/src/spinner/spinners.md +22 -22
  83. package/src/text.md +34 -34
  84. package/src/text.svelte +22 -22
  85. package/src/variant.mjs +12 -12
  86. package/src/wsx.mjs +24 -24
@@ -1,42 +1,42 @@
1
- # Details
2
- A component that has some baseline content that is shown, then expands to reveal
3
- more content (like the html details element).
4
-
5
- ## Props
6
-
7
- ### color
8
- Sets the $color macro.
9
-
10
- ### label
11
- The text for the content that is always shown.
12
-
13
- ### open
14
- Controls whether the Details is showing the extended content. Can be bound to.
15
-
16
- ### outline
17
- If true, will put an outline around the component, including the extended
18
- content.
19
-
20
- ## Slots
21
-
22
- ### default
23
- The content to show when the Details is open.
24
-
25
- ### label
26
- Can be used for more complex labels (things that need nested elements). If used,
27
- the label prop will be ignored.
28
-
29
- ## Example
30
-
31
- ```svelte
32
- <script>
33
- import { Details } from "@axel669/zephyr"
34
-
35
- let open = false
36
- </script>
37
-
38
- <div>Open: {open}</div>
39
- <Details label="Info" bind:open>
40
- Look, more info could go here!
41
- </Details>
42
- ```
1
+ # Details
2
+ A component that has some baseline content that is shown, then expands to reveal
3
+ more content (like the html details element).
4
+
5
+ ## Props
6
+
7
+ ### color
8
+ Sets the $color macro.
9
+
10
+ ### label
11
+ The text for the content that is always shown.
12
+
13
+ ### open
14
+ Controls whether the Details is showing the extended content. Can be bound to.
15
+
16
+ ### outline
17
+ If true, will put an outline around the component, including the extended
18
+ content.
19
+
20
+ ## Slots
21
+
22
+ ### default
23
+ The content to show when the Details is open.
24
+
25
+ ### label
26
+ Can be used for more complex labels (things that need nested elements). If used,
27
+ the label prop will be ignored.
28
+
29
+ ## Example
30
+
31
+ ```svelte
32
+ <script>
33
+ import { Details } from "@axel669/zephyr"
34
+
35
+ let open = false
36
+ </script>
37
+
38
+ <div>Open: {open}</div>
39
+ <Details label="Info" bind:open>
40
+ Look, more info could go here!
41
+ </Details>
42
+ ```
@@ -1,25 +1,25 @@
1
- <svelte:options immutable />
2
-
3
- <script>
4
- import wsx from "../wsx.mjs"
5
-
6
- export let label
7
- export let outline
8
- export let color = "@default"
9
- export let open = false
10
-
11
- $: wind = {
12
- "$color": color,
13
- "$outline": outline,
14
- ...$$restProps,
15
- }
16
- </script>
17
-
18
- <details use:wsx={wind} bind:open>
19
- <summary>
20
- <slot name="label">
21
- {label}
22
- </slot>
23
- </summary>
24
- <slot />
25
- </details>
1
+ <svelte:options immutable />
2
+
3
+ <script>
4
+ import wsx from "../wsx.mjs"
5
+
6
+ export let label
7
+ export let outline
8
+ export let color = "@default"
9
+ export let open = false
10
+
11
+ $: wind = {
12
+ "$color": color,
13
+ "$outline": outline,
14
+ ...$$restProps,
15
+ }
16
+ </script>
17
+
18
+ <details use:wsx={wind} bind:open>
19
+ <summary>
20
+ <slot name="label">
21
+ {label}
22
+ </slot>
23
+ </summary>
24
+ <slot />
25
+ </details>
@@ -1,32 +1,32 @@
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
- <script>
19
- import { Popover, Button } from "@axel669/zephyr"
20
- </script>
21
-
22
- <Popover let:show>
23
- <Button on:click={show}>
24
- Show
25
- </Button>
26
- <div ws-x="inset-x[0px] y[0px] h[100px] bg[teal]" slot="content" let:hide>
27
- <Button on:click={hide}>
28
- Hide
29
- </Button>
30
- </div>
31
- </Popover>
32
- ```
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
+ <script>
19
+ import { Popover, Button } from "@axel669/zephyr"
20
+ </script>
21
+
22
+ <Popover let:show>
23
+ <Button on:click={show}>
24
+ Show
25
+ </Button>
26
+ <div ws-x="inset-x[0px] y[0px] h[100px] bg[teal]" slot="content" let:hide>
27
+ <Button on:click={hide}>
28
+ Hide
29
+ </Button>
30
+ </div>
31
+ </Popover>
32
+ ```
@@ -1,25 +1,25 @@
1
- <svelte:options immutable />
2
-
3
- <script>
4
- import { fade } from "svelte/transition"
5
- import wsx from "../wsx.mjs"
6
-
7
- let visible = false
8
- const show = () => visible = true
9
- const hide = () => visible = false
10
- const anim = { duration: 250 }
11
-
12
- $: wind = {
13
- $show: true,
14
- ...$$restProps,
15
- }
16
- </script>
17
-
18
- <ws-popover use:wsx={wind}>
19
- <slot {show} />
20
- {#if visible}
21
- <wind-content slot="content" ws-x="[inset 0px]" transition:fade={anim}>
22
- <slot name="content" {hide} />
23
- </wind-content>
24
- {/if}
25
- </ws-popover>
1
+ <svelte:options immutable />
2
+
3
+ <script>
4
+ import { fade } from "svelte/transition"
5
+ import wsx from "../wsx.mjs"
6
+
7
+ let visible = false
8
+ const show = () => visible = true
9
+ const hide = () => visible = false
10
+ const anim = { duration: 250 }
11
+
12
+ $: wind = {
13
+ $show: true,
14
+ ...$$restProps,
15
+ }
16
+ </script>
17
+
18
+ <ws-popover use:wsx={wind}>
19
+ <slot {show} />
20
+ {#if visible}
21
+ <wind-content slot="content" ws-x="[inset 0px]" transition:fade={anim}>
22
+ <slot name="content" {hide} />
23
+ </wind-content>
24
+ {/if}
25
+ </ws-popover>
@@ -1,46 +1,46 @@
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
- <script>
41
- import { Progress } from "@axel669/zephyr"
42
- </script>
43
-
44
- <Progress color="primary" value={0.1} />
45
- <Progress color="primary" value={5} max={10} />
46
- ```
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
+ <script>
41
+ import { Progress } from "@axel669/zephyr"
42
+ </script>
43
+
44
+ <Progress color="primary" value={0.1} />
45
+ <Progress color="primary" value={5} max={10} />
46
+ ```
@@ -1,27 +1,27 @@
1
- <svelte:options immutable />
2
-
3
- <script>
4
- import wsx from "../wsx.mjs"
5
-
6
- export let value = 0
7
- export let max = 1
8
- export let color = "default"
9
- export let outline = false
10
- export let row = false
11
- export let label = null
12
-
13
- $: wind = {
14
- "@progress": true,
15
- "$outline": outline,
16
- "$color": color,
17
- $row: row,
18
- ...$$restProps,
19
- }
20
- </script>
21
-
22
- <label use:wsx={wind}>
23
- {#if label}
24
- <span ws-x="[$progress-label] [t-ws nowrap]">{label}</span>
25
- {/if}
26
- <progress {value} {max} />
27
- </label>
1
+ <svelte:options immutable />
2
+
3
+ <script>
4
+ import wsx from "../wsx.mjs"
5
+
6
+ export let value = 0
7
+ export let max = 1
8
+ export let color = "default"
9
+ export let outline = false
10
+ export let row = false
11
+ export let label = null
12
+
13
+ $: wind = {
14
+ "@progress": true,
15
+ "$outline": outline,
16
+ "$color": color,
17
+ $row: row,
18
+ ...$$restProps,
19
+ }
20
+ </script>
21
+
22
+ <label use:wsx={wind}>
23
+ {#if label}
24
+ <span ws-x="[$progress-label] [t-ws nowrap]">{label}</span>
25
+ {/if}
26
+ <progress {value} {max} />
27
+ </label>
@@ -1,59 +1,59 @@
1
- # Table
2
- Wrapper for making tables in a way that is easy to maintain.
3
-
4
- ## Props
5
-
6
- ### color
7
- `string`
8
-
9
- Sets the $color macro.
10
-
11
- ### data
12
- `Array`
13
-
14
- The data to display in the table.
15
-
16
- ### fillHeader
17
- `bool`
18
-
19
- If true, the header row will have the background filled instead of just the
20
- colored border.
21
-
22
- ## Slots
23
-
24
- ### header
25
- Used to render the header for the table. Needs to include the `tr`.
26
-
27
- ### row
28
- Used to render an item that is not `undefined`. Needs to include the `tr`. Uses
29
- `let:row` for the row data, and `let:rowNum` for the row number (0-based).
30
-
31
- ### empty-row
32
- If given, will render when the item in the array is `undefined`. Uses
33
- `let:rowNum` for the row number (0-based).
34
-
35
- ## Example
36
- ```svelte
37
- <script>
38
- import { Table } from "@axel669/zephyr"
39
-
40
- const data = Array.from(
41
- { length: 20 },
42
- (_, i) => [i, i ** 2, i ** 3]
43
- )
44
- </script>
45
-
46
- <Table>
47
- <tr slot="header">
48
- <th>N</th>
49
- <th>Squared</th>
50
- <th>Cubed</th>
51
- </tr>
52
-
53
- <tr slot="row" let:row>
54
- <td>{row[0]}</td>
55
- <td>{row[1]}</td>
56
- <td>{row[2]}</td>
57
- </tr>
58
- </Table>
59
- ```
1
+ # Table
2
+ Wrapper for making tables in a way that is easy to maintain.
3
+
4
+ ## Props
5
+
6
+ ### color
7
+ `string`
8
+
9
+ Sets the $color macro.
10
+
11
+ ### data
12
+ `Array`
13
+
14
+ The data to display in the table.
15
+
16
+ ### fillHeader
17
+ `bool`
18
+
19
+ If true, the header row will have the background filled instead of just the
20
+ colored border.
21
+
22
+ ## Slots
23
+
24
+ ### header
25
+ Used to render the header for the table. Needs to include the `tr`.
26
+
27
+ ### row
28
+ Used to render an item that is not `undefined`. Needs to include the `tr`. Uses
29
+ `let:row` for the row data, and `let:rowNum` for the row number (0-based).
30
+
31
+ ### empty-row
32
+ If given, will render when the item in the array is `undefined`. Uses
33
+ `let:rowNum` for the row number (0-based).
34
+
35
+ ## Example
36
+ ```svelte
37
+ <script>
38
+ import { Table } from "@axel669/zephyr"
39
+
40
+ const data = Array.from(
41
+ { length: 20 },
42
+ (_, i) => [i, i ** 2, i ** 3]
43
+ )
44
+ </script>
45
+
46
+ <Table>
47
+ <tr slot="header">
48
+ <th>N</th>
49
+ <th>Squared</th>
50
+ <th>Cubed</th>
51
+ </tr>
52
+
53
+ <tr slot="row" let:row>
54
+ <td>{row[0]}</td>
55
+ <td>{row[1]}</td>
56
+ <td>{row[2]}</td>
57
+ </tr>
58
+ </Table>
59
+ ```
@@ -1,38 +1,38 @@
1
- <svelte:options immutable />
2
-
3
- <script>
4
- import wsx from "../wsx.mjs"
5
-
6
- export let color = false
7
- export let fillHeader = false
8
- export let data = []
9
-
10
- $: wind = {
11
- "$color": color,
12
- "$header-fill": fillHeader,
13
- ...$$restProps,
14
- }
15
- </script>
16
-
17
- <table use:wsx={wind}>
18
- <thead>
19
- <slot name="header">
20
- <tr>
21
- <th>No Header Template</th>
22
- </tr>
23
- </slot>
24
- </thead>
25
- <tbody>
26
- {#each data as row, rowNum}
27
- {#if row === undefined}
28
- <slot name="empty-row" {rowNum} />
29
- {:else}
30
- <slot name="row" {row} {rowNum}>
31
- <tr>
32
- <td>No Row Template</td>
33
- </tr>
34
- </slot>
35
- {/if}
36
- {/each}
37
- </tbody>
38
- </table>
1
+ <svelte:options immutable />
2
+
3
+ <script>
4
+ import wsx from "../wsx.mjs"
5
+
6
+ export let color = false
7
+ export let fillHeader = false
8
+ export let data = []
9
+
10
+ $: wind = {
11
+ "$color": color,
12
+ "$header-fill": fillHeader,
13
+ ...$$restProps,
14
+ }
15
+ </script>
16
+
17
+ <table use:wsx={wind}>
18
+ <thead>
19
+ <slot name="header">
20
+ <tr>
21
+ <th>No Header Template</th>
22
+ </tr>
23
+ </slot>
24
+ </thead>
25
+ <tbody>
26
+ {#each data as row, rowNum}
27
+ {#if row === undefined}
28
+ <slot name="empty-row" {rowNum} />
29
+ {:else}
30
+ <slot name="row" {row} {rowNum}>
31
+ <tr>
32
+ <td>No Row Template</td>
33
+ </tr>
34
+ </slot>
35
+ {/if}
36
+ {/each}
37
+ </tbody>
38
+ </table>
@@ -1,29 +1,29 @@
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
- <script>
20
- import { Tooltip, Button } from "@axel669/zephyr"
21
- </script>
22
-
23
- <Tooltip text="This is a button">
24
- <Button>Do Thing</Button>
25
- </Tooltip>
26
- <Tooltip text="This shows under" bottom>
27
- Just some text content
28
- </Tooltip>
29
- ```
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
+ <script>
20
+ import { Tooltip, Button } from "@axel669/zephyr"
21
+ </script>
22
+
23
+ <Tooltip text="This is a button">
24
+ <Button>Do Thing</Button>
25
+ </Tooltip>
26
+ <Tooltip text="This shows under" bottom>
27
+ Just some text content
28
+ </Tooltip>
29
+ ```