@axel669/zephyr 0.1.17 → 0.2.0-beta.0

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 (113) hide show
  1. package/LICENSE +21 -21
  2. package/package.json +11 -7
  3. package/readme.md +55 -44
  4. package/src/composed/data-table/th.svelte +60 -0
  5. package/src/composed/data-table.md +71 -0
  6. package/src/composed/data-table.svelte +136 -150
  7. package/src/composed/entry-button.md +34 -0
  8. package/src/composed/entry-button.svelte +29 -68
  9. package/src/composed/table-functions.js +13 -0
  10. package/src/composed/toast/message.svelte +44 -44
  11. package/src/composed/toast.md +36 -0
  12. package/src/composed/toast.svelte +68 -108
  13. package/src/control/button.md +37 -0
  14. package/src/control/button.svelte +25 -0
  15. package/src/control/input.svelte +107 -0
  16. package/src/control/label.md +0 -0
  17. package/src/control/label.svelte +36 -0
  18. package/src/control/link.md +37 -0
  19. package/src/control/link.svelte +28 -0
  20. package/src/control/radio.md +49 -0
  21. package/src/control/radio.svelte +28 -0
  22. package/src/control/select.md +55 -0
  23. package/src/control/select.svelte +62 -0
  24. package/src/control/tabs.md +35 -0
  25. package/src/control/tabs.svelte +39 -0
  26. package/src/control/toggle.md +38 -0
  27. package/src/control/toggle.svelte +47 -0
  28. package/src/data-display/avatar.md +26 -0
  29. package/src/data-display/avatar.svelte +23 -0
  30. package/src/data-display/badge.md +24 -0
  31. package/src/data-display/badge.svelte +12 -0
  32. package/src/data-display/chip.md +28 -0
  33. package/src/data-display/chip.svelte +26 -0
  34. package/src/data-display/details.md +0 -0
  35. package/src/{details.svelte → data-display/details.svelte} +3 -3
  36. package/src/data-display/popover.md +32 -0
  37. package/src/data-display/popover.svelte +23 -0
  38. package/src/data-display/progress.md +30 -0
  39. package/src/data-display/progress.svelte +25 -0
  40. package/src/data-display/table.md +29 -0
  41. package/src/data-display/table.svelte +36 -0
  42. package/src/data-display/tooltip.md +25 -0
  43. package/src/data-display/tooltip.svelte +15 -0
  44. package/src/dialogs/alert.md +0 -0
  45. package/src/dialogs/alert.svelte +4 -4
  46. package/src/dialogs/confirm.md +0 -0
  47. package/src/dialogs/confirm.svelte +5 -5
  48. package/src/functions.md +77 -0
  49. package/src/handler$.mjs +20 -68
  50. package/src/index.mjs +55 -92
  51. package/src/info/icon.md +20 -0
  52. package/src/info/icon.svelte +9 -0
  53. package/src/info/notification.md +37 -0
  54. package/src/info/notification.svelte +16 -0
  55. package/src/info/titlebar.md +46 -0
  56. package/src/info/titlebar.svelte +18 -0
  57. package/src/info/toaster.md +23 -0
  58. package/src/info/toaster.svelte +14 -0
  59. package/src/inline-dialog.svelte +23 -23
  60. package/src/layout/dialog.md +33 -0
  61. package/src/layout/dialog.svelte +24 -0
  62. package/src/layout/drawer.md +47 -0
  63. package/src/layout/drawer.svelte +47 -0
  64. package/src/layout/flex.md +30 -0
  65. package/src/layout/flex.svelte +22 -0
  66. package/src/layout/grid.md +36 -0
  67. package/src/layout/grid.svelte +26 -0
  68. package/src/layout/modal.md +35 -0
  69. package/src/layout/modal.svelte +58 -0
  70. package/src/layout/paper.md +77 -0
  71. package/src/layout/paper.svelte +45 -0
  72. package/src/layout/screen.md +31 -0
  73. package/src/layout/screen.svelte +32 -0
  74. package/src/{circle-spinner.svelte → spinner/circle-spinner.svelte} +2 -2
  75. package/src/{hexagon-spinner.svelte → spinner/hexagon-spinner.svelte} +2 -2
  76. package/src/spinner/spinners.md +0 -0
  77. package/src/text.md +22 -0
  78. package/src/text.svelte +20 -49
  79. package/src/variant.mjs +12 -12
  80. package/src/wsx.mjs +24 -45
  81. package/src/avatar.svelte +0 -54
  82. package/src/badge.svelte +0 -40
  83. package/src/button.svelte +0 -86
  84. package/src/chip.svelte +0 -56
  85. package/src/dialog.svelte +0 -54
  86. package/src/drawer.svelte +0 -121
  87. package/src/flex.svelte +0 -57
  88. package/src/grid.svelte +0 -66
  89. package/src/icon.svelte +0 -34
  90. package/src/input/area.svelte +0 -98
  91. package/src/input/elems.mjs +0 -7
  92. package/src/input/email.svelte +0 -104
  93. package/src/input/file.svelte +0 -82
  94. package/src/input/number.svelte +0 -104
  95. package/src/input/password.svelte +0 -101
  96. package/src/input/search.svelte +0 -104
  97. package/src/input/text.svelte +0 -104
  98. package/src/link.svelte +0 -67
  99. package/src/modal.svelte +0 -73
  100. package/src/notification.svelte +0 -57
  101. package/src/paper.svelte +0 -127
  102. package/src/popover.svelte +0 -60
  103. package/src/progress.svelte +0 -60
  104. package/src/radio.svelte +0 -82
  105. package/src/screen.svelte +0 -69
  106. package/src/select.svelte +0 -122
  107. package/src/table.svelte +0 -69
  108. package/src/tabs.svelte +0 -78
  109. package/src/titlebar.svelte +0 -69
  110. package/src/toaster.svelte +0 -42
  111. package/src/toggle.svelte +0 -94
  112. package/src/tooltip.svelte +0 -45
  113. package/src/vars.mjs +0 -61
@@ -0,0 +1,29 @@
1
+ # Table
2
+
3
+ Displays data using html tables with some nice styling. This version of the
4
+ table is fairly simple and intended for basic data displays. For more
5
+ complex data displays the DataTable should be used.
6
+
7
+ ## Base
8
+ [Windstorm Table](https://axel669.github.io/lib.windstorm/#components-table)
9
+
10
+ ## Props
11
+ All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
12
+ are supported.
13
+
14
+ - ### color `string`
15
+ Sets `$color`
16
+ - ### cols `Array`
17
+ The columns that should be displayed. Should be in the format of
18
+ `{ label, width? }`
19
+ - ### data `Array[Array]`
20
+ The data to display. The data should be an array where each item is a
21
+ row, and each item in the row is the value for a column.
22
+ - ### cellWSX `function`
23
+ If given, this function will be called for each cell, and should return
24
+ an object that will be passed to the `wsx` action for each <td>
25
+ generated. The function is passed `(cellValue, rowNum, colNum)`.
26
+ - ### rowWSX `function`
27
+ If given, this function will be called for each row, and should return
28
+ an object that will be passed to the `wsx` action for each <tr>
29
+ generated. The function is passed `(rowValue, rowNum)`.
@@ -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
+ ## Base
6
+ [Windstorm Tooltip](https://axel669.github.io/lib.windstorm/#components-tooltip)
7
+
8
+ ## Props
9
+ All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
10
+ are supported.
11
+
12
+ - ### text `string`
13
+ The text to display in the tooltip.
14
+ - ### bottom `bool`
15
+ If true, the tooltip will be shown under the content instead of over.
16
+
17
+ ## Usage
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
+ ```
@@ -0,0 +1,15 @@
1
+ <script>
2
+ import wsx from "../wsx.mjs"
3
+
4
+ export let text = ""
5
+ export let bottom = false
6
+
7
+ $: wind = {
8
+ $bottom: bottom,
9
+ ...$$restProps,
10
+ }
11
+ </script>
12
+
13
+ <ws-tooltip ws-text={text} use:wsx={wind}>
14
+ <slot />
15
+ </ws-tooltip>
File without changes
@@ -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"
File without changes
@@ -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
 
@@ -0,0 +1,77 @@
1
+ # Library Functions/Actions
2
+
3
+ Zephyr has a few functions to make some tasks easier for working with the
4
+ library.
5
+
6
+ ## handler$
7
+
8
+ Wraps a function for currying as an event handler. The curried function does
9
+ not pass the event into final function call.
10
+
11
+ ### Usage
12
+ ```svelte
13
+ <script>
14
+ const clicked = handler$(
15
+ (buttonName) => console.log(buttonName)
16
+ )
17
+ </script>
18
+
19
+ <!-- logs "first" when clicked -->
20
+ <Button on:click={clicked("first")}>
21
+ First
22
+ </Button>
23
+ <!-- logs "second" when clicked -->
24
+ <Button on:click={clicked("second")}>
25
+ Second
26
+ </Button>
27
+ ```
28
+
29
+ ## eventHandler$
30
+
31
+ Wraps a function for currying as an event handler. Unlike the `handler$`
32
+ function, the event is passed to the curried function.
33
+
34
+ ### Usage
35
+
36
+ ```svelte
37
+ <script>
38
+ const clicked = eventHandler$(
39
+ (event, buttonName) => console.log(event, buttonName)
40
+ )
41
+ </script>
42
+
43
+ <!-- logs the event and "first" when clicked -->
44
+ <Button on:click={clicked("first")}>
45
+ First
46
+ </Button>
47
+ <!-- logs the event and "second" when clicked -->
48
+ <Button on:click={clicked("second")}>
49
+ Second
50
+ </Button>
51
+ ```
52
+
53
+ ## wsx Action
54
+
55
+ The wsx action can be used to set the `ws-x` attribute on a DOM element by using
56
+ an object as the source rather than trying to do the string manipulation
57
+ directly.
58
+ - `null`, `undefined`, and `false` will not insert the wind function
59
+ - `true` will insert the wind function with no args
60
+ - any string value will insert the wind function with the arguments formatted
61
+ for the parser (replace spaces and underscores as needed).
62
+
63
+ ### Usage
64
+ ```svelte
65
+ <script>
66
+ // will generate ws-x="grid gr-col[1fr 1fr]"
67
+ const wsxProps = {
68
+ grid: true,
69
+ "gr.cols": "1fr 1fr",
70
+ bg: null
71
+ }
72
+ </script>
73
+
74
+ <div use:wsx={wsxProps}>
75
+ <span>Content</span>
76
+ </div>
77
+ ```
package/src/handler$.mjs CHANGED
@@ -1,68 +1,20 @@
1
- /*md
2
- [@] Event Handlers
3
-
4
- # Event Handlers
5
-
6
- Zephyr provides a couple of functions to help make event handlers look
7
- nicer and bind arguments easier.
8
- */
9
-
10
-
11
- /*md
12
- ## handler$
13
-
14
- Wraps a function for currying as an event handler. The curried function does
15
- not pass the event into final function call.
16
-
17
- ### Usage
18
- ```js
19
- const clicked = handler$(
20
- (buttonName) => console.log(buttonName)
21
- )
22
- ```
23
- ```svelte
24
- <!-- logs "first" when clicked -->
25
- <Button on:click={clicked("first")}>
26
- First
27
- </Button>
28
- <!-- logs "second" when clicked -->
29
- <Button on:click={clicked("second")}>
30
- Second
31
- </Button>
32
- ```
33
- */
34
- const handler$ = (func) =>
35
- (...args) =>
36
- (_, ...extra) => func(...args, ...extra)
37
-
38
- /*md
39
- ## eventHandler$
40
-
41
- Wraps a function for currying as an event handler. Unlike the `handler$`
42
- function, the event is passed to the curried function.
43
-
44
- ### Usage
45
- In the following example, "first" is logged each time the first button is
46
- clicked, and "second" is logged when the second button is clicked. In both
47
- cases the click event is also logged.
48
- ```js
49
- const clicked = eventHandler$(
50
- (event, buttonName) => console.log(event, buttonName)
51
- )
52
- ```
53
- ```svelte
54
- <!-- logs the event and "first" when clicked -->
55
- <Button on:click={clicked("first")}>
56
- First
57
- </Button>
58
- <!-- logs the event and "second" when clicked -->
59
- <Button on:click={clicked("second")}>
60
- Second
61
- </Button>
62
- ```
63
- */
64
- const eventHandler$ = (func) =>
65
- (...args) =>
66
- (...extra) => func(...extra, ...args)
67
-
68
- export { handler$, eventHandler$ }
1
+ /**
2
+ Wraps a handler function for easy reuse.
3
+
4
+ @param {Function} func The handler function to wrap
5
+ */
6
+ const handler$ = (func) =>
7
+ (...args) =>
8
+ (_, ...extra) => func(...args, ...extra)
9
+
10
+ /**
11
+ Wraps a handler function for easy reuse, and doesn't throw away the event arg
12
+ passed by events firing.
13
+
14
+ @param {Function} func The handler function to wrap
15
+ */
16
+ const eventHandler$ = (func) =>
17
+ (...args) =>
18
+ (...extra) => func(...extra, ...args)
19
+
20
+ export { handler$, eventHandler$ }
package/src/index.mjs CHANGED
@@ -1,92 +1,55 @@
1
- /*md
2
- [@] Home
3
-
4
- # Zephyr
5
- Zephyr is a svelte binding for the
6
- [Windstorm](https://www.npmjs.com/package/@axel669/windstorm)
7
- library.
8
-
9
- [Docs Here](https://svelte-wind.axel669.net)
10
-
11
- ## Installation
12
- Zephyr can be installed through npm (or the variants like yarn, pnpm, etc).
13
-
14
- ```bash
15
- npm install @axel669/svelte-wind
16
- ```
17
-
18
- ## Usage
19
- Components can be imported individually from the library for tree-shaking, or
20
- the entire lib can imported at once, but I dunno how big that bundle will be.
21
-
22
- ```svelte
23
- <script>
24
- // individual import for tree shaking
25
- import { Button } from "@axel69/svelte-wind"
26
-
27
- // bring the whole thing to keep it simple
28
- import * as Wind from "@axel69/svelte-wind"
29
- </script>
30
-
31
- <!-- the wsx action can be used to setup the ws-x needed for the body -->
32
- <svelte:body use:wsx={{theme, "@app": true}} />
33
-
34
- <Button on:click={stuff}>
35
- I'm a button!
36
- </Button>
37
-
38
- <Wind.Button on:click={stuff}>
39
- I'm also button!
40
- </Wind.Button>
41
- ```
42
-
43
- ### Svelte Config
44
- No special configuration of svelte is required, nor is there a separate plugin
45
- that needs to be added. Just have svelte and you're good to go.
46
- */
47
-
48
- export { default as Avatar } from "./avatar.svelte"
49
- export { default as Badge } from "./badge.svelte"
50
- export { default as Button } from "./button.svelte"
51
- export { default as Chip } from "./chip.svelte"
52
- export { default as Details } from "./details.svelte"
53
- export { default as Dialog } from "./dialog.svelte"
54
- export { default as Drawer } from "./drawer.svelte"
55
- export { default as Flex } from "./flex.svelte"
56
- export { default as Grid } from "./grid.svelte"
57
- export { default as Icon } from "./icon.svelte"
58
- export { default as InlineDialog } from "./inline-dialog.svelte"
59
- export { default as Link } from "./link.svelte"
60
- export { default as Modal } from "./modal.svelte"
61
- export { default as Notification } from "./notification.svelte"
62
- export { default as Paper } from "./paper.svelte"
63
- export { default as Popover } from "./popover.svelte"
64
- export { default as Progress } from "./progress.svelte"
65
- export { default as Radio } from "./radio.svelte"
66
- export { default as Screen } from "./screen.svelte"
67
- export { default as Select } from "./select.svelte"
68
- export { default as Table } from "./table.svelte"
69
- export { default as Tabs } from "./tabs.svelte"
70
- export { default as Text } from "./text.svelte"
71
- export { default as Titlebar } from "./titlebar.svelte"
72
- export { default as Toaster } from "./toaster.svelte"
73
- export { default as Toggle } from "./toggle.svelte"
74
- export { default as Tooltip } from "./tooltip.svelte"
75
-
76
- export { default as CircleSpinner } from "./circle-spinner.svelte"
77
- export { default as HexagonSpinner } from "./hexagon-spinner.svelte"
78
-
79
- export { default as Alert } from "./dialogs/alert.svelte"
80
- export { default as Confirm } from "./dialogs/confirm.svelte"
81
-
82
- export { default as DataTable } from "./composed/data-table.svelte"
83
- export { default as EntryButton } from "./composed/entry-button.svelte"
84
- export { default as Toast } from "./composed/toast.svelte"
85
-
86
- export { default as wsx } from "./wsx.mjs"
87
-
88
- export * as Input from "./input/elems.mjs"
89
-
90
- export * from "./handler$.mjs"
91
-
92
- export { default as TheLastAirbender } from "./avatar.svelte"
1
+ export { default as Button } from "./control/button.svelte"
2
+ export { default as Input } from "./control/input.svelte"
3
+ export { default as Link } from "./control/link.svelte"
4
+ export { default as Radio } from "./control/radio.svelte"
5
+ export { default as Select } from "./control/select.svelte"
6
+ export { default as Tabs } from "./control/tabs.svelte"
7
+ export { default as Toggle } from "./control/toggle.svelte"
8
+
9
+ export { default as Avatar } from "./data-display/avatar.svelte"
10
+ export { default as TheLastAirbender } from "./data-display/avatar.svelte"
11
+ export { default as Badge } from "./data-display/badge.svelte"
12
+ export { default as Chip } from "./data-display/chip.svelte"
13
+ export { default as Details } from "./data-display/details.svelte"
14
+ export { default as Popover } from "./data-display/popover.svelte"
15
+ export { default as Progress } from "./data-display/progress.svelte"
16
+ export { default as Table } from "./data-display/table.svelte"
17
+ export { default as Tooltip } from "./data-display/tooltip.svelte"
18
+
19
+ export { default as Icon } from "./info/icon.svelte"
20
+ export { default as Notification } from "./info/notification.svelte"
21
+ export { default as Titlebar } from "./info/titlebar.svelte"
22
+ export { default as Toaster } from "./info/toaster.svelte"
23
+
24
+ export { default as Dialog } from "./layout/dialog.svelte"
25
+ export { default as Drawer } from "./layout/drawer.svelte"
26
+ export { default as Flex } from "./layout/flex.svelte"
27
+ export { default as Grid } from "./layout/grid.svelte"
28
+ export { default as Modal } from "./layout/modal.svelte"
29
+ export { default as Paper } from "./layout/paper.svelte"
30
+ export { default as Screen } from "./layout/screen.svelte"
31
+
32
+ // export { default as InlineDialog } from "./inline-dialog.svelte"
33
+ export { default as Text } from "./text.svelte"
34
+
35
+ export { default as CircleSpinner } from "./spinner/circle-spinner.svelte"
36
+ export { default as HexagonSpinner } from "./spinner/hexagon-spinner.svelte"
37
+
38
+ export { default as Alert } from "./dialogs/alert.svelte"
39
+ export { default as Confirm } from "./dialogs/confirm.svelte"
40
+
41
+ export { default as EntryButton } from "./composed/entry-button.svelte"
42
+ export { default as Toast } from "./composed/toast.svelte"
43
+
44
+ import DataTable from "./composed/data-table.svelte"
45
+ import th from "./composed/data-table/th.svelte"
46
+ DataTable.th = th
47
+
48
+ export { DataTable, th }
49
+ // export { default as DataTable } from "./composed/data-table.svelte"
50
+
51
+ export { default as wsx } from "./wsx.mjs"
52
+
53
+
54
+ export * from "./handler$.mjs"
55
+ export * from "./composed/table-functions.js"
@@ -0,0 +1,20 @@
1
+ # Icon
2
+
3
+ Displays a [Tabler Icon](https://tabler-icons.io/) and some optional text.
4
+ The icon will appear at the beginning of the text.
5
+
6
+ ## Base
7
+ [Windstorm Icon](https://axel669.github.io/lib.windstorm/#components-icon)
8
+
9
+ ## Props
10
+ All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
11
+ are supported.
12
+
13
+ - ### name `string`
14
+ The name of the icon. Use the tabler icon class name without the "ti-".
15
+
16
+ ## Usage
17
+ ```svelte
18
+ <Icon name="hexagon" />
19
+ <Icon name="hexagons">Are the bestagons</Icon>
20
+ ```
@@ -0,0 +1,9 @@
1
+ <script>
2
+ import wsx from "../wsx.mjs"
3
+
4
+ export let name
5
+ </script>
6
+
7
+ <ws-icon class="ti-{name}" use:wsx={$$restProps}>
8
+ <slot />
9
+ </ws-icon>
@@ -0,0 +1,37 @@
1
+ # Notification
2
+
3
+ Displays a piece of content that stands out from the surrounding content and
4
+ can also be used for toast messages. Optionally has some interactable
5
+ elements embedded.
6
+
7
+ Expects 1-2 child nodes and will display them on the sides of the
8
+ notification with space between them. This means that reversing the order
9
+ of the child nodes will flip which sides they appear on.
10
+
11
+ ## Base
12
+ [Windstorm Notification](https://axel669.github.io/lib.windstorm/#components-notification)
13
+
14
+ ## Props
15
+ All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
16
+ are supported.
17
+
18
+ - ### color
19
+ Sets `$color` and uses the fill style for coloration.
20
+
21
+ ## Usage
22
+ ```svelte
23
+ <Notification>
24
+ <Icon name="info-hexagon">
25
+ Some kind of information
26
+ </Icon>
27
+ </Notification>
28
+ <Notification color="danger">
29
+ <Icon name="alert-hexagon">
30
+ Something broke
31
+ </Icon>
32
+
33
+ <Button>
34
+ Cancel
35
+ </Button>
36
+ </Notification>
37
+ ```
@@ -0,0 +1,16 @@
1
+ <script>
2
+ import wsx from "../wsx.mjs"
3
+
4
+ export let color = false
5
+
6
+ $: wind = {
7
+ "$color": color,
8
+ ...$$restProps,
9
+ }
10
+ </script>
11
+
12
+ <!-- svelte-ignore a11y-click-events-have-key-events -->
13
+ <!-- svelte-ignore a11y-interactive-supports-focus -->
14
+ <ws-notification use:wsx={wind} on:click role="button">
15
+ <slot />
16
+ </ws-notification>
@@ -0,0 +1,46 @@
1
+ # Titlebar
2
+
3
+ The titlebar is used to set section titles with some style, and provides
4
+ slots for buttons on either side of the title text. Works well as a header
5
+ for Paper components.
6
+
7
+ ## Base
8
+ [Windstorm Titlebar](https://axel669.github.io/lib.windstorm/#components-titlebar)
9
+
10
+ ## Props
11
+ All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
12
+ are supported.
13
+
14
+ - ### color `string`
15
+ Sets `$color`
16
+ - ### fill `bool`
17
+ Sets `$fill`
18
+
19
+ ## Slots
20
+ - title\\
21
+ The center of the titlebar, where the text usually goes
22
+ - menu\\
23
+ The area on the left of the titlebar (where drawer menus tend to open)
24
+ - action\\
25
+ The area on the right of the titlebar
26
+
27
+ ## Usage
28
+ ```svelte
29
+ <Titlebar color="primary" fill>
30
+ <Text title slot="title">
31
+ Some Title
32
+ </Text>
33
+
34
+ <Button slot="menu" color={false}>
35
+ <Icon name="menu" />
36
+ </Button>
37
+ </Titlebar>
38
+
39
+ <Paper>
40
+ <Titlebar color="secondary" slot="header">
41
+ <Text title slot="title">
42
+ Paper Title
43
+ </Text>
44
+ </Titlebar>
45
+ </Paper>
46
+ ```
@@ -0,0 +1,18 @@
1
+ <script>
2
+ import wsx from "../wsx.mjs"
3
+
4
+ export let color
5
+ export let fill = false
6
+
7
+ $: wind = {
8
+ "$color": color,
9
+ "$fill": fill,
10
+ ...$$restProps
11
+ }
12
+ </script>
13
+
14
+ <ws-titlebar use:wsx={wind}>
15
+ <slot name="menu" />
16
+ <slot name="title" />
17
+ <slot name="action" />
18
+ </ws-titlebar>
@@ -0,0 +1,23 @@
1
+ # Toaster
2
+
3
+ The Toaster component is used for building popup notifications along the
4
+ edges of the window.
5
+
6
+ ## Base
7
+ [Windstorm Toaster](https://axel669.github.io/lib.windstorm/#components-toaster)
8
+
9
+ ## Props
10
+ All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
11
+ are supported, but probably not very meaningful for this container.
12
+
13
+ - ### position
14
+ Sets position of the toaster. See the windstorm base for values.
15
+
16
+ ## Usage
17
+ <Toaster position="$tc">
18
+ <Notification>
19
+ <Icon name="info">
20
+ Some kind of notification of things
21
+ </Icon>
22
+ </Notification>
23
+ </Toaster>
@@ -0,0 +1,14 @@
1
+ <script>
2
+ import wsx from "../wsx.mjs"
3
+
4
+ export let position = "tc"
5
+
6
+ $: wind = {
7
+ [`$${position}`]: true,
8
+ ...$$restProps,
9
+ }
10
+ </script>
11
+
12
+ <ws-toaster use:wsx={wind}>
13
+ <slot />
14
+ </ws-toaster>