@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
@@ -2,35 +2,58 @@
2
2
 
3
3
  The Toggle component is used to display checkboxes and switches.
4
4
 
5
- ## Base
6
- [Windstorm Labeled Toggle](https://axel669.github.io/lib.windstorm/#components-labeled-toggle)
7
- using a checkbox input
8
-
9
5
  ## Props
10
- All [windstorm functions](https://axel669.github.io/lib.windstorm/#css-shorthands)
11
- are supported.
12
-
13
- - ### color `string`
14
- Sets `$color`
15
- - ### checkbox `bool`
16
- If true, the toggle is displayed as a checkbox. Default is false
17
- (shown as a switch)
18
- - ### checked `bool`
19
- Controls if the toggle is checked or not. Can be bound
20
- - ### group
21
- Used for binding, see the Svelte bind:group for details
22
- - ### label `string`
23
- The text to use for the label
24
- - ### flat `bool`
25
- Sets `$flat`
26
- - ### reverse `bool`
27
- If true, the input being toggled will be on the left instead of the
28
- right. Default is false (label is on the left)
29
- - ### value
30
- Only used in conjunction with bind:group, see Svelte docs
31
-
32
- ## Usage
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
33
50
  ```svelte
51
+ <script>
52
+ import { Toggle } from "@axel669/zephyr"
53
+
54
+ let checked = false
55
+ </script>
56
+
34
57
  <Toggle label="Active" bind:checked />
35
58
  <Toggle label="Active" checkbox bind:checked />
36
59
  <Toggle label="Active" checkbox reverse bind:checked />
@@ -2,24 +2,34 @@
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
29
+ <script>
30
+ import { Avatar } from "@axel669/zephyr"
31
+ </script>
32
+
23
33
  <Avatar image="url" />
24
34
  <Avatar image="url" alt="text" />
25
35
  <Avatar text="Hi" color="primary" />
@@ -1,24 +1,30 @@
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
18
- <Badge text="100">
18
+ <script>
19
+ import { Badge } from "@axel669/zephyr"
20
+
21
+ let count = 10
22
+ </script>
23
+
24
+ <Badge text={count}>
19
25
  Unread Messages
20
26
  </Badge>
21
27
  <Badge text="1k+" color="warning">
22
- <button>Clickable Content</button>
28
+ <button on:click={() => count += 1}>Clickable Content</button>
23
29
  </Badge>
24
30
  ```
@@ -1,26 +1,34 @@
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
7
 
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.
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
21
25
 
22
26
  ## Example
23
27
  ```svelte
28
+ <script>
29
+ import { Chip } from "@axel669/zephyr"
30
+ </script>
31
+
24
32
  Emails:
25
33
  <Chip clickable>admin@site.com</Chip>
26
34
  <Chip clickable color="warning">weirdge@site.com</Chip>
@@ -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,20 @@ 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
+ <script>
19
+ import { Popover, Button } from "@axel669/zephyr"
20
+ </script>
21
+
22
+ <Popover let:show>
23
23
  <Button on:click={show}>
24
24
  Show
25
25
  </Button>
26
- <div ws-x="inset-x[0px] y[0px] h[100px] bg[teal]" slot="content">
26
+ <div ws-x="inset-x[0px] y[0px] h[100px] bg[teal]" slot="content" let:hide>
27
27
  <Button on:click={hide}>
28
28
  Hide
29
29
  </Button>
@@ -2,29 +2,45 @@
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
40
+ <script>
41
+ import { Progress } from "@axel669/zephyr"
42
+ </script>
43
+
28
44
  <Progress color="primary" value={0.1} />
29
45
  <Progress color="primary" value={5} max={10} />
30
46
  ```
@@ -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,20 +2,24 @@
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`
16
14
 
17
- ## Usage
15
+ If true, the tooltip will be shown under the content instead of over.
16
+
17
+ ## Example
18
18
  ```svelte
19
+ <script>
20
+ import { Tooltip, Button } from "@axel669/zephyr"
21
+ </script>
22
+
19
23
  <Tooltip text="This is a button">
20
24
  <Button>Do Thing</Button>
21
25
  </Tooltip>
@@ -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,9 +8,11 @@ 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
+ import { handler$ } from "@axel669/zephyr"
15
+
14
16
  const clicked = handler$(
15
17
  (buttonName) => console.log(buttonName)
16
18
  )
@@ -31,10 +33,12 @@ not pass the event into final function call.
31
33
  Wraps a function for currying as an event handler. Unlike the `handler$`
32
34
  function, the event is passed to the curried function.
33
35
 
34
- ### Usage
36
+ ### Example
35
37
 
36
38
  ```svelte
37
39
  <script>
40
+ import { eventHandler$ } from "@axel669/zephyr"
41
+
38
42
  const clicked = eventHandler$(
39
43
  (event, buttonName) => console.log(event, buttonName)
40
44
  )
@@ -60,9 +64,11 @@ directly.
60
64
  - any string value will insert the wind function with the arguments formatted
61
65
  for the parser (replace spaces and underscores as needed).
62
66
 
63
- ### Usage
67
+ ### Example
64
68
  ```svelte
65
69
  <script>
70
+ import { wsx } from "@axel669/zephyr"
71
+
66
72
  // will generate ws-x="grid gr-col[1fr 1fr]"
67
73
  const wsxProps = {
68
74
  grid: true,
package/src/index.mjs CHANGED
@@ -29,7 +29,6 @@ export { default as Modal } from "./layout/modal.svelte"
29
29
  export { default as Paper } from "./layout/paper.svelte"
30
30
  export { default as Screen } from "./layout/screen.svelte"
31
31
 
32
- // export { default as InlineDialog } from "./inline-dialog.svelte"
33
32
  export { default as Text } from "./text.svelte"
34
33
 
35
34
  export { default as CircleSpinner } from "./spinner/circle-spinner.svelte"
@@ -38,15 +37,13 @@ export { default as HexagonSpinner } from "./spinner/hexagon-spinner.svelte"
38
37
  export { default as Alert } from "./dialogs/alert.svelte"
39
38
  export { default as Confirm } from "./dialogs/confirm.svelte"
40
39
 
40
+ export { default as DataTable } from "./composed/data-table.svelte"
41
+ export { default as Th } from "./composed/data-table/th.svelte"
41
42
  export { default as EntryButton } from "./composed/entry-button.svelte"
42
43
  export { default as Toast } from "./composed/toast.svelte"
43
44
 
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"
45
+ export { default as AsyncButton } from "./async/button.svelte"
46
+ export { default as LoadZone } from "./async/load-zone.svelte"
50
47
 
51
48
  export { default as wsx } from "./wsx.mjs"
52
49
 
package/src/info/icon.md CHANGED
@@ -3,18 +3,19 @@
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
15
+ <script>
16
+ import { Icon } from "@axel669/zephyr"
17
+ </script>
18
+
18
19
  <Icon name="hexagon" />
19
20
  <Icon name="hexagons">Are the bestagons</Icon>
20
21
  ```
@@ -8,18 +8,17 @@ 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
18
+ <script>
19
+ import { Notification, Button, Icon } from "@axel669/zephyr"
20
+ </script>
21
+
23
22
  <Notification>
24
23
  <Icon name="info-hexagon">
25
24
  Some kind of information
@@ -4,34 +4,43 @@ 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. Elements can be nested
23
+ in different ways within a parent element for different visual effects in this
24
+ slot.
25
+
26
+ ### menu
27
+ The area on the left of the titlebar (where drawer menus tend to open)
28
+
29
+ ### action
30
+ The area on the right of the titlebar
31
+
32
+ ## Example
28
33
  ```svelte
34
+ <script>
35
+ import { Titlebar, Button, Paper, Text } from "@axel669/zephyr"
36
+ </script>
37
+
29
38
  <Titlebar color="primary" fill>
30
39
  <Text title slot="title">
31
40
  Some Title
32
41
  </Text>
33
42
 
34
- <Button slot="menu" color={false}>
43
+ <Button slot="menu">
35
44
  <Icon name="menu" />
36
45
  </Button>
37
46
  </Titlebar>
@@ -40,7 +49,27 @@ are supported.
40
49
  <Titlebar color="secondary" slot="header">
41
50
  <Text title slot="title">
42
51
  Paper Title
52
+ <Text subtitle>
53
+ Indented Subtitle
54
+ </Text>
43
55
  </Text>
44
56
  </Titlebar>
45
57
  </Paper>
58
+
59
+ <Paper>
60
+ <Titlebar color="secondary" slot="header">
61
+ <Flex p="0px" slot="title">
62
+ <Text title>
63
+ Paper Title
64
+ </Text>
65
+ <Text subtitle>
66
+ Aligned Subtitle
67
+ </Text>
68
+ </Flex>
69
+
70
+ <Button slot="action">
71
+ <Icon name="menu" />
72
+ </Button>
73
+ </Titlebar>
74
+ </Paper>
46
75
  ```
@@ -3,17 +3,19 @@
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.
12
+
13
+ ## Example
14
+ ```svelte
15
+ <script>
16
+ import { Toaster, Notification, Icon } from "@axel669/zephyr"
17
+ </script>
15
18
 
16
- ## Usage
17
19
  <Toaster position="$tc">
18
20
  <Notification>
19
21
  <Icon name="info">
@@ -21,3 +23,4 @@ are supported, but probably not very meaningful for this container.
21
23
  </Icon>
22
24
  </Notification>
23
25
  </Toaster>
26
+ ```