@axel669/zephyr 0.2.0-beta.0 → 0.2.0-beta.2

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 (42) hide show
  1. package/package.json +3 -4
  2. package/readme.md +23 -15
  3. package/src/async/button.svelte +31 -0
  4. package/src/async/load-zone.svelte +17 -0
  5. package/src/composed/data-table.md +19 -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 +6 -2
  10. package/src/control/label.md +49 -0
  11. package/src/control/link.md +24 -11
  12. package/src/control/link.svelte +1 -1
  13. package/src/control/radio.md +32 -23
  14. package/src/control/radio.svelte +1 -3
  15. package/src/control/select.md +41 -26
  16. package/src/control/tabs.md +38 -26
  17. package/src/control/toggle.md +50 -27
  18. package/src/data-display/avatar.md +24 -14
  19. package/src/data-display/badge.md +17 -11
  20. package/src/data-display/chip.md +19 -11
  21. package/src/data-display/details.md +3 -0
  22. package/src/data-display/popover.md +10 -10
  23. package/src/data-display/progress.md +37 -21
  24. package/src/data-display/table.md +4 -26
  25. package/src/data-display/tooltip.md +14 -10
  26. package/src/dialogs/alert.md +3 -0
  27. package/src/dialogs/confirm.md +3 -0
  28. package/src/functions.md +9 -3
  29. package/src/index.mjs +4 -7
  30. package/src/info/icon.md +9 -8
  31. package/src/info/notification.md +7 -8
  32. package/src/info/titlebar.md +47 -18
  33. package/src/info/toaster.md +11 -8
  34. package/src/layout/dialog.md +12 -2
  35. package/src/layout/drawer.md +40 -17
  36. package/src/layout/flex.md +31 -18
  37. package/src/layout/grid.md +44 -19
  38. package/src/layout/modal.md +21 -6
  39. package/src/layout/paper.md +51 -34
  40. package/src/layout/screen.md +11 -9
  41. package/src/spinner/spinners.md +3 -0
  42. package/src/text.md +22 -10
@@ -8,11 +8,16 @@ 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
17
+ <script>
18
+ import { Dialog, Titlebar, Text } from "@axel669/zephyr"
19
+ </script>
20
+
16
21
  <Dialog>
17
22
  <Titlebar slot="header">
18
23
  <Text slot="title" title>
@@ -26,6 +31,11 @@ See the Paper component props.
26
31
 
27
32
  `app.svelte`
28
33
  ```svelte
34
+ <script>
35
+ import { Modal, EntryButton } from "@axel669/zephyr"
36
+ import CoolDialog from "./cool-dialog.svelte"
37
+ </script>
38
+
29
39
  <Modal component={CoolDialog} />
30
40
  <EntryButton this={Modal} component={CoolDialog}>
31
41
  Open Cool Dialog
@@ -8,25 +8,43 @@ 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
44
+ <script>
45
+ import { Drawer, Titlebar, Text } from "@axel669/zephyr"
46
+ </script>
47
+
30
48
  <Drawer>
31
49
  <Titlebar slot="header">
32
50
  <Text slot="title" title>
@@ -40,6 +58,11 @@ conjunction with the Modal component to be controlled on screen.
40
58
 
41
59
  `app.svelte`
42
60
  ```svelte
61
+ <script>
62
+ import { Modal, EntryButton } from "@axel669/zephyr"
63
+ import CoolDrawer from "./cool-drawer.svelte"
64
+ </script>
65
+
43
66
  <Modal component={CoolDrawer} />
44
67
  <EntryButton this={Modal} component={CoolDrawer}>
45
68
  Open Cool Dialog
@@ -2,26 +2,39 @@
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
34
+ <script>
35
+ import { Flex, Text } from "@axel669/zephyr"
36
+ </script>
37
+
25
38
  <Flex cross="stretch">
26
39
  <Text>Content</Text>
27
40
  <Text>More content</Text>
@@ -9,26 +9,51 @@ 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
- <Grid cross="stretch">
52
+ <script>
53
+ import { Grid, Text } from "@axel669/zephyr"
54
+ </script>
55
+
56
+ <Grid cols="1fr 1fr">
32
57
  <Text>Content</Text>
33
58
  <Text>More content</Text>
34
59
  <Text>Event more content</Text>
@@ -19,17 +19,32 @@ 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
+ import { Modal, Button } from "@axel669/zephyr"
37
+ import CoolDialog from "./cool-dialog.svelte"
38
+
39
+ let dialog = null
40
+ const dialogThing = async () => {
41
+ const value = await dialog.show({ a: 10, b: 12 })
42
+ console.log(value)
43
+ }
44
+ </script>
45
+
31
46
  <Modal component={CoolDialog} bind:this={dialog} />
32
- <Button on:click={() => dialog.show({ a: 10, b: 12 })}>
47
+ <Button on:click={dialogThing}>
33
48
  Open Dialog
34
49
  </Button>
35
50
  ```
@@ -6,44 +6,61 @@ Flex as a default layout for its slotted content, but allows any container
6
6
  to be used as a layout without increasing the indentation of all the content
7
7
  needlessly.
8
8
 
9
- ## Base
10
- [Windstorm Paper](https://axel669.github.io/lib.windstorm/#components-paper)
11
-
12
9
  ## Props
13
- All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
14
- are supported.
15
-
16
- - ### color `string`
17
- Sets `$color`
18
- - ### card `bool`
19
- Sets `$outline`
20
- - ### square `bool`
21
- Sets `r[0px]`
22
- - ### layout `Component`
23
- Sets the layout the card will use to display content. Default is Flex.
24
- - ### scrollable `bool`
25
- Sets `over[auto]` on the layout component
26
- - ### l-*
27
- Any prop that is prefixed with `l-` will be passed to the layout
28
- component, with the remaining props acting as the normal wind functions
29
- on the paper itself
10
+
11
+ ### color
12
+ `string`
13
+
14
+ Sets `$color`
15
+
16
+ ### card
17
+ `bool`
18
+
19
+ Sets `$outline`
20
+
21
+ ### square
22
+ `bool`
23
+
24
+ Sets `r[0px]`
25
+
26
+ ### layout
27
+ `Component`
28
+
29
+ Sets the layout the card will use to display content. Default is Flex.
30
+
31
+ ### scrollable
32
+ `bool`
33
+
34
+ Sets `over[auto]` on the layout component
35
+
36
+ ### l-*
37
+ Any prop that is prefixed with `l-` will be passed to the layout
38
+ component, with the remaining props acting as the normal wind functions
39
+ on the paper itself
30
40
 
31
41
  ## Slots
32
- - ### header
33
- The header content for the Paper. Header content does not scroll with
34
- the regular content of the component (acts sticky)
35
- - ### footer
36
- The footer content for the Paper. Same scrolling properties as the
37
- header slot
38
- - ### content/default
39
- The default slot (unnamed) for Paper will be rendered in the layout
40
- component defined in the props. As an alternative, a content slot may
41
- be used that will be rendered directly in the content slot of the Paper
42
- without the layout component/props being rendered (useful when nesting
43
- papers for example)
44
-
45
- ## Usage
42
+
43
+ ### header
44
+ The header content for the Paper. Header content does not scroll with
45
+ the regular content of the component (acts sticky)
46
+
47
+ ### footer
48
+ The footer content for the Paper. Same scrolling properties as the
49
+ header slot
50
+
51
+ ### content/default
52
+ The default slot (unnamed) for Paper will be rendered in the layout
53
+ component defined in the props. As an alternative, a content slot may
54
+ be used that will be rendered directly in the content slot of the Paper
55
+ without the layout component/props being rendered (useful when nesting
56
+ papers for example)
57
+
58
+ ## Example
46
59
  ```svelte
60
+ <script>
61
+ import { Paper, Tabs, Text, Titlebar } from "@axel669/zephyr"
62
+ </script>
63
+
47
64
  <Paper>
48
65
  <Titlebar slot="header">
49
66
  <Text slot="title" title>
@@ -7,19 +7,21 @@ pass values back from child screens. The stacking effect of the Screen is
7
7
  controlled by internally tracked svelte context, so no manual effort is
8
8
  required to get stacking screens to have the effect.
9
9
 
10
- ## Base
11
- [Windstorm Screen](https://axel669.github.io/lib.windstorm/#components-screen)
12
-
13
10
  ## Props
14
- All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
15
- are supported, but they probably won't help much with this component.
16
11
 
17
- - ### width `string`
18
- The width of the screen before stack-based padding is applied
12
+ ### width
13
+ `string`
14
+
15
+ The width of the screen before stack-based padding is applied
19
16
 
20
- ## Usage
21
- `cool-screen.svelte`
17
+ ## Example
22
18
  ```svelte
19
+ <script>
20
+ import { Scren, Button, Paper } from "@axel669/zephyr"
21
+
22
+ export let close
23
+ </script>
24
+
23
25
  <Screen width="70%">
24
26
  <Paper>
25
27
  This screen is pretty cool I swear
@@ -0,0 +1,3 @@
1
+ # Spinners
2
+
3
+ Under construction.
package/src/text.md CHANGED
@@ -4,16 +4,28 @@ Simple component with some common props for types of text.
4
4
 
5
5
  ## Props
6
6
 
7
- - ### adorn `bool`
8
- Sets `$adorn`
9
- - ### block `bool`
10
- Sets `block`
11
- - ### subtitle `bool`
12
- Sets `$subtitle`
13
- - ### title `bool`
14
- Sets `$title`
15
-
16
- ## Usage
7
+
8
+ ### adorn
9
+ `bool`
10
+
11
+ Sets `$adorn`
12
+
13
+ ### block
14
+ `bool`
15
+
16
+ Sets `block`
17
+
18
+ ### subtitle
19
+ `bool`
20
+
21
+ Sets `$subtitle`
22
+
23
+ ### title
24
+ `bool`
25
+
26
+ Sets `$title`
27
+
28
+ ## Example
17
29
  ```svelte
18
30
  <Text>Some text</Text>
19
31
  <Text title>Bigger text</Text>