@axel669/zephyr 0.2.0-beta.0 → 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.
Files changed (41) hide show
  1. package/package.json +3 -4
  2. package/readme.md +12 -12
  3. package/src/async/button.svelte +31 -0
  4. package/src/async/load-zone.svelte +17 -0
  5. package/src/composed/data-table.md +17 -5
  6. package/src/composed/entry-button.md +1 -1
  7. package/src/composed/toast/message.svelte +16 -4
  8. package/src/composed/toast.md +1 -1
  9. package/src/control/button.md +2 -2
  10. package/src/control/label.md +45 -0
  11. package/src/control/link.md +20 -11
  12. package/src/control/radio.md +29 -22
  13. package/src/control/radio.svelte +1 -3
  14. package/src/control/select.md +39 -26
  15. package/src/control/tabs.md +36 -26
  16. package/src/control/toggle.md +44 -27
  17. package/src/data-display/avatar.md +20 -14
  18. package/src/data-display/badge.md +9 -9
  19. package/src/data-display/chip.md +16 -12
  20. package/src/data-display/details.md +3 -0
  21. package/src/data-display/popover.md +6 -10
  22. package/src/data-display/progress.md +33 -21
  23. package/src/data-display/table.md +4 -26
  24. package/src/data-display/tooltip.md +10 -10
  25. package/src/dialogs/alert.md +3 -0
  26. package/src/dialogs/confirm.md +3 -0
  27. package/src/functions.md +3 -3
  28. package/src/index.mjs +3 -0
  29. package/src/info/icon.md +5 -8
  30. package/src/info/notification.md +3 -8
  31. package/src/info/titlebar.md +20 -17
  32. package/src/info/toaster.md +7 -8
  33. package/src/layout/dialog.md +3 -2
  34. package/src/layout/drawer.md +31 -17
  35. package/src/layout/flex.md +27 -18
  36. package/src/layout/grid.md +39 -18
  37. package/src/layout/modal.md +18 -6
  38. package/src/layout/paper.md +47 -34
  39. package/src/layout/screen.md +5 -8
  40. package/src/spinner/spinners.md +3 -0
  41. package/src/text.md +22 -10
@@ -2,21 +2,27 @@
2
2
 
3
3
  Displays an image or text in a circular container.
4
4
 
5
- ## Base
6
- [Windstorm Avatar](https://axel669.github.io/lib.windstorm/#components-avatar)
7
-
8
5
  ## Props
9
- All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
10
- are supported.
11
-
12
- - ### alt `string`
13
- Alt text for the image. Has no effect if image prop is not used.
14
- - ### color `string`
15
- Sets `$color`
16
- - ### image `string`
17
- An image url. If no url is provided the text property is displayed.
18
- - ### text `string`
19
- Text to show in the avatar area if image is not used.
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.
20
26
 
21
27
  ## Example
22
28
  ```svelte
@@ -1,17 +1,17 @@
1
1
  # Badge
2
2
  Adds a small badge over the upper-right corner of some content.
3
3
 
4
- ## Base
5
- [Windstorm Badge](https://axel669.github.io/lib.windstorm/#components-badge)
6
-
7
4
  ## Props
8
- All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
9
- are supported.
10
5
 
11
- - ### color `string`
12
- Sets `$color`
13
- - ### text `string`
14
- The badge text.
6
+ ### color
7
+ `string`
8
+
9
+ Sets `$color`
10
+
11
+ ### text
12
+ `string`
13
+
14
+ The badge text.
15
15
 
16
16
  ## Example
17
17
  ```svelte
@@ -1,20 +1,24 @@
1
1
  # Chip
2
+
2
3
  Shows a small piece of information that is separate from the surrounding
3
4
  info and optionally allows interaction.
4
5
 
5
- ## Base
6
- [Windstorm Chip](https://axel669.github.io/lib.windstorm/#components-chip)
7
-
8
6
  ## Props
9
- All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
10
- are supported.
11
-
12
- - ### color `string`
13
- Sets `$color`
14
- - ### clickable `bool`
15
- If true, the chip will have the button ripple effect when clicked.
16
- - ### fill `bool`
17
- If true, sets $fill on the chip. If false $outline is set instead.
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.
18
22
 
19
23
  ## Events
20
24
  - click
@@ -0,0 +1,3 @@
1
+ # Details
2
+
3
+ Still working on this one.
@@ -3,13 +3,6 @@
3
3
  The Popover component is for displaying content over something without it
4
4
  being modal (you can interact with things under it still).
5
5
 
6
- ## Base
7
- [Windstorm Popover](https://axel669.github.io/lib.windstorm/#components-popover)
8
-
9
- ## Props
10
- All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
11
- are supported.
12
-
13
6
  ## Variables
14
7
  - show
15
8
  - hide
@@ -17,13 +10,16 @@ The Popover exposes 2 variables for use: `show` and `hide`. These functions
17
10
  are given to the content so that it can control when to display the popover
18
11
  content without needing to bind to the parent.
19
12
 
20
- ## Usage
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
21
17
  ```svelte
22
- <Popover let:show let:hide>
18
+ <Popover let:show>
23
19
  <Button on:click={show}>
24
20
  Show
25
21
  </Button>
26
- <div ws-x="inset-x[0px] y[0px] h[100px] bg[teal]" slot="content">
22
+ <div ws-x="inset-x[0px] y[0px] h[100px] bg[teal]" slot="content" let:hide>
27
23
  <Button on:click={hide}>
28
24
  Hide
29
25
  </Button>
@@ -2,28 +2,40 @@
2
2
 
3
3
  Displays progress bar with an optional label.
4
4
 
5
- ## Base
6
- [Windstorm Progress Bar](https://axel669.github.io/lib.windstorm/#components-progress-bar)
7
-
8
5
  ## Props
9
- All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
10
- are supported.
11
-
12
- - ### color `string`
13
- Sets `$color`
14
- - ### label `string`
15
- The label for the bar
16
- - ### max `number`
17
- Sets the max value for the progress bar. Default is 1
18
- - ### outline `bool`
19
- Sets `$outline`
20
- - ### row `bool`
21
- Sets `$row`
22
- - ### value `number`
23
- Sets the value of the progress bar. Combined with max to determine how
24
- filled the bar is.
25
-
26
- ## Usage
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
27
39
  ```svelte
28
40
  <Progress color="primary" value={0.1} />
29
41
  <Progress color="primary" value={5} max={10} />
@@ -1,29 +1,7 @@
1
1
  # Table
2
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)
3
+ Under construction.
9
4
 
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)`.
5
+ <!-- Displays data using html tables with some nice styling. This version of the
6
+ table is fairly simple and intended for basic data displays. For more
7
+ complex data displays the DataTable should be used. -->
@@ -2,19 +2,19 @@
2
2
 
3
3
  Displays a tooltip above (or below) some content when it's hovered.
4
4
 
5
- ## Base
6
- [Windstorm Tooltip](https://axel669.github.io/lib.windstorm/#components-tooltip)
7
-
8
5
  ## Props
9
- All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
10
- are supported.
11
6
 
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.
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
16
 
17
- ## Usage
17
+ ## Example
18
18
  ```svelte
19
19
  <Tooltip text="This is a button">
20
20
  <Button>Do Thing</Button>
@@ -0,0 +1,3 @@
1
+ # Alert Dialog
2
+
3
+ Under construction.
@@ -0,0 +1,3 @@
1
+ # Confirm Dialog
2
+
3
+ Under construction.
package/src/functions.md CHANGED
@@ -8,7 +8,7 @@ library.
8
8
  Wraps a function for currying as an event handler. The curried function does
9
9
  not pass the event into final function call.
10
10
 
11
- ### Usage
11
+ ### Example
12
12
  ```svelte
13
13
  <script>
14
14
  const clicked = handler$(
@@ -31,7 +31,7 @@ not pass the event into final function call.
31
31
  Wraps a function for currying as an event handler. Unlike the `handler$`
32
32
  function, the event is passed to the curried function.
33
33
 
34
- ### Usage
34
+ ### Example
35
35
 
36
36
  ```svelte
37
37
  <script>
@@ -60,7 +60,7 @@ directly.
60
60
  - any string value will insert the wind function with the arguments formatted
61
61
  for the parser (replace spaces and underscores as needed).
62
62
 
63
- ### Usage
63
+ ### Example
64
64
  ```svelte
65
65
  <script>
66
66
  // will generate ws-x="grid gr-col[1fr 1fr]"
package/src/index.mjs CHANGED
@@ -41,6 +41,9 @@ export { default as Confirm } from "./dialogs/confirm.svelte"
41
41
  export { default as EntryButton } from "./composed/entry-button.svelte"
42
42
  export { default as Toast } from "./composed/toast.svelte"
43
43
 
44
+ export { default as AsyncButton } from "./async/button.svelte"
45
+ export { default as LoadZone } from "./async/load-zone.svelte"
46
+
44
47
  import DataTable from "./composed/data-table.svelte"
45
48
  import th from "./composed/data-table/th.svelte"
46
49
  DataTable.th = th
package/src/info/icon.md CHANGED
@@ -3,17 +3,14 @@
3
3
  Displays a [Tabler Icon](https://tabler-icons.io/) and some optional text.
4
4
  The icon will appear at the beginning of the text.
5
5
 
6
- ## Base
7
- [Windstorm Icon](https://axel669.github.io/lib.windstorm/#components-icon)
8
-
9
6
  ## Props
10
- All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
11
- are supported.
12
7
 
13
- - ### name `string`
14
- The name of the icon. Use the tabler icon class name without the "ti-".
8
+ ### name
9
+ `string`
10
+
11
+ The name of the icon. Use the tabler icon class name without the "ti-".
15
12
 
16
- ## Usage
13
+ ## Example
17
14
  ```svelte
18
15
  <Icon name="hexagon" />
19
16
  <Icon name="hexagons">Are the bestagons</Icon>
@@ -8,17 +8,12 @@ Expects 1-2 child nodes and will display them on the sides of the
8
8
  notification with space between them. This means that reversing the order
9
9
  of the child nodes will flip which sides they appear on.
10
10
 
11
- ## Base
12
- [Windstorm Notification](https://axel669.github.io/lib.windstorm/#components-notification)
13
-
14
11
  ## Props
15
- All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
16
- are supported.
17
12
 
18
- - ### color
19
- Sets `$color` and uses the fill style for coloration.
13
+ ### color
14
+ Sets `$color` and uses the fill style for coloration.
20
15
 
21
- ## Usage
16
+ ## Example
22
17
  ```svelte
23
18
  <Notification>
24
19
  <Icon name="info-hexagon">
@@ -4,27 +4,30 @@ The titlebar is used to set section titles with some style, and provides
4
4
  slots for buttons on either side of the title text. Works well as a header
5
5
  for Paper components.
6
6
 
7
- ## Base
8
- [Windstorm Titlebar](https://axel669.github.io/lib.windstorm/#components-titlebar)
9
-
10
7
  ## Props
11
- All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
12
- are supported.
13
8
 
14
- - ### color `string`
15
- Sets `$color`
16
- - ### fill `bool`
17
- Sets `$fill`
9
+ ### color
10
+ `string`
11
+
12
+ Sets `$color`
13
+
14
+ ### fill
15
+ `bool`
16
+
17
+ Sets `$fill`
18
18
 
19
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
20
+
21
+ ### title
22
+ The center of the titlebar, where the text usually goes
23
+
24
+ ### menu
25
+ The area on the left of the titlebar (where drawer menus tend to open)
26
+
27
+ ### action
28
+ The area on the right of the titlebar
29
+
30
+ ## Example
28
31
  ```svelte
29
32
  <Titlebar color="primary" fill>
30
33
  <Text title slot="title">
@@ -3,17 +3,15 @@
3
3
  The Toaster component is used for building popup notifications along the
4
4
  edges of the window.
5
5
 
6
- ## Base
7
- [Windstorm Toaster](https://axel669.github.io/lib.windstorm/#components-toaster)
8
-
9
6
  ## 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
7
 
13
- - ### position
14
- Sets position of the toaster. See the windstorm base for values.
8
+ ### position
9
+ Sets position of the toaster. See the
10
+ [windstorm base](https://windstorm.axel669.net/lib/css/component/toaster)
11
+ for values.
15
12
 
16
- ## Usage
13
+ ## Example
14
+ ```svelte
17
15
  <Toaster position="$tc">
18
16
  <Notification>
19
17
  <Icon name="info">
@@ -21,3 +19,4 @@ are supported, but probably not very meaningful for this container.
21
19
  </Icon>
22
20
  </Notification>
23
21
  </Toaster>
22
+ ```
@@ -8,9 +8,10 @@ The Dialog component is used as a wrapper for content and is used in
8
8
  conjunction with the Modal component to be controlled on screen.
9
9
 
10
10
  ## Props
11
- See the Paper component props.
11
+ This component just wraps a [Paper](./paper.md) component with some extra parts,
12
+ and passes the props to a `Paper`.
12
13
 
13
- ## Usage
14
+ ## Example
14
15
  `cool-dialog.svelte`
15
16
  ```svelte
16
17
  <Dialog>
@@ -8,23 +8,37 @@ The Drawer component is used as a wrapper for content and is used in
8
8
  conjunction with the Modal component to be controlled on screen.
9
9
 
10
10
  ## Props
11
- - ### close `function`
12
- If passed, this function will be called when the user clicks in the
13
- empty area outside of the drawer contents.
14
- - ### height `string`
15
- Sets the height of the select drawer, no effect for menu and action
16
- drawers which default to full height of the window.
17
- - ### type `string`
18
- The type of drawer. Default is "menu"
19
- - #### "menu"
20
- Makes a drawer that slides in on the left side of the screen
21
- - #### "action"
22
- Makes a drawer that slides in on the right side of the screen
23
- - #### "select"
24
- Makes a drawer that is centered horizontally and slides in from
25
- the top of the screen
26
-
27
- ## Usage
11
+
12
+ ### close
13
+ `function`
14
+
15
+ If passed, this function will be called when the user clicks in the
16
+ empty area outside of the drawer contents.
17
+
18
+ ### height
19
+ `string`
20
+
21
+ Sets the height of the select drawer, no effect for menu and action
22
+ drawers which default to full height of the window.
23
+
24
+ ### type
25
+ `string`
26
+
27
+ The type of drawer. Default is "menu"
28
+ #### "menu"
29
+
30
+ Makes a drawer that slides in on the left side of the screen
31
+
32
+ #### "action"
33
+
34
+ Makes a drawer that slides in on the right side of the screen
35
+
36
+ #### "select"
37
+
38
+ Makes a drawer that is centered horizontally and slides in from
39
+ the top of the screen
40
+
41
+ ## Example
28
42
  `cool-drawer.svelte`
29
43
  ```svelte
30
44
  <Drawer>
@@ -2,25 +2,34 @@
2
2
 
3
3
  Container that uses flex layout by default with some nice default values.
4
4
 
5
- ## Base
6
- [Windstorm Flex](https://axel669.github.io/lib.windstorm/#components-flex)
7
-
8
5
  ## Props
9
- All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
10
- are supported.
11
-
12
- - ### direction `string`
13
- Sets `fl-dir`
14
- - ### pad `string`
15
- Sets `p`
16
- - ### gap `string`
17
- Sets `gap`
18
- - ### cross `string`
19
- Sets `fl-cr-a`, default is `"stretch"`
20
- - ### main `string`
21
- Sets `fl-m-a`, default is `"start"`
22
-
23
- ## Usage
6
+
7
+ ### direction
8
+ `string`
9
+
10
+ Sets `fl.dir`
11
+
12
+ ### pad
13
+ `string`
14
+
15
+ Sets `p`
16
+
17
+ ### gap
18
+ `string`
19
+
20
+ Sets `gap`
21
+
22
+ ### cross
23
+ `string`
24
+
25
+ Sets `fl.cross`, default is `"stretch"`
26
+
27
+ ### main
28
+ `string`
29
+
30
+ Sets `fl.main`, default is `"start"`
31
+
32
+ ## Example
24
33
  ```svelte
25
34
  <Flex cross="stretch">
26
35
  <Text>Content</Text>
@@ -9,24 +9,45 @@ Container that uses grid layout by default with some nice default values.
9
9
  All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
10
10
  are supported.
11
11
 
12
- - ### direction `string`
13
- Sets `gr-dir`
14
- - ### pad `string`
15
- Sets `p`
16
- - ### gap `string`
17
- Sets `gap`
18
- - ### cols `string|Array`
19
- Sets `gr-col`. Accepts either an array of values that are joined by " "
20
- or a regular string value.
21
- - ### rows `string|Array`
22
- Sets `gr-row`. Accepts either an array of values that are joined by " "
23
- or a regular string value.
24
- - ### autoCol `string`
25
- Sets `gr-acol`
26
- - ### autoRow `string`
27
- Sets `gr-arow`
28
-
29
- ## Usage
12
+
13
+ ### direction
14
+ `string`
15
+
16
+ Sets `gr.flow`
17
+
18
+ ### pad
19
+ `string`
20
+
21
+ Sets `p`
22
+
23
+ ### gap
24
+ `string`
25
+
26
+ Sets `gap`
27
+
28
+ ### cols
29
+ `string|Array`
30
+
31
+ Sets `gr.cols`. Accepts either an array of values that are joined by " "
32
+ or a regular string value.
33
+
34
+ ### rows
35
+ `string|Array`
36
+
37
+ Sets `gr.rows`. Accepts either an array of values that are joined by " "
38
+ or a regular string value.
39
+
40
+ ### autoCol
41
+ `string`
42
+
43
+ Sets `gr.cols.a`
44
+
45
+ ### autoRow
46
+ `string`
47
+
48
+ Sets `gr.rows.a`
49
+
50
+ ## Example
30
51
  ```svelte
31
52
  <Grid cross="stretch">
32
53
  <Text>Content</Text>
@@ -19,17 +19,29 @@ closes in response to that event.
19
19
  Because the Modal does not render content of its own, it does not support
20
20
  any wind functions.
21
21
 
22
- - ### component `Component`
23
- The component to display when `show` is called
22
+
23
+ ### component
24
+ `Component`
25
+
26
+ The component to display when `show` is called
24
27
 
25
28
  ## Functions
26
- - ### `show(props?) -> Promise`
27
- Shows the given component and passes any props provided.
28
29
 
29
- ## Usage
30
+ ### `show(props?) -> Promise`
31
+ Shows the given component and passes any props provided.
32
+
33
+ ## Example
30
34
  ```svelte
35
+ <script>
36
+ let dialog = null
37
+ const dialogThing = async () => {
38
+ const value = await dialog.show({ a: 10, b: 12 })
39
+ console.log(value)
40
+ }
41
+ </script>
42
+
31
43
  <Modal component={CoolDialog} bind:this={dialog} />
32
- <Button on:click={() => dialog.show({ a: 10, b: 12 })}>
44
+ <Button on:click={dialogThing}>
33
45
  Open Dialog
34
46
  </Button>
35
47
  ```