@axel669/zephyr 0.1.2 → 0.1.3

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.
package/package.json CHANGED
@@ -1,30 +1,30 @@
1
- {
2
- "name": "@axel669/zephyr",
3
- "version": "0.1.2",
4
- "description": "",
5
- "main": "src/index.mjs",
6
- "type": "module",
7
- "scripts": {
8
- "test": "echo \"Error: no test specified\" && exit 1",
9
- "demo": "rollup -c test/rollup.config.mjs"
10
- },
11
- "keywords": [],
12
- "author": "",
13
- "license": "MIT",
14
- "dependencies": {
15
- "@axel669/windstorm": "0.1.12",
16
- "@labyrinthos/asuid": "^0.2.0",
17
- "svelte": "^3.58.0"
18
- },
19
- "devDependencies": {
20
- "@axel669/ipsen": "^0.3.1",
21
- "@axel669/rollup-html-input": "^0.1.2",
22
- "@rollup/plugin-node-resolve": "^15.0.2",
23
- "@rollup/plugin-terser": "^0.4.0",
24
- "rollup": "^3.20.2",
25
- "rollup-plugin-svelte": "^7.1.4"
26
- },
27
- "files": [
28
- "src/"
29
- ]
30
- }
1
+ {
2
+ "name": "@axel669/zephyr",
3
+ "version": "0.1.3",
4
+ "description": "",
5
+ "main": "src/index.mjs",
6
+ "type": "module",
7
+ "scripts": {
8
+ "test": "echo \"Error: no test specified\" && exit 1",
9
+ "demo": "rollup -c test/rollup.config.mjs"
10
+ },
11
+ "keywords": [],
12
+ "author": "",
13
+ "license": "MIT",
14
+ "dependencies": {
15
+ "@axel669/windstorm": "0.1.13",
16
+ "@labyrinthos/asuid": "^0.2.0",
17
+ "svelte": "^3.58.0"
18
+ },
19
+ "devDependencies": {
20
+ "@axel669/ipsen": "^0.3.1",
21
+ "@axel669/rollup-html-input": "^0.1.2",
22
+ "@rollup/plugin-node-resolve": "^15.0.2",
23
+ "@rollup/plugin-terser": "^0.4.0",
24
+ "rollup": "^3.20.2",
25
+ "rollup-plugin-svelte": "^7.1.4"
26
+ },
27
+ "files": [
28
+ "src/"
29
+ ]
30
+ }
package/src/flex.svelte CHANGED
@@ -20,9 +20,9 @@
20
20
  - ### gap `string`
21
21
  Sets `gap`
22
22
  - ### cross `string`
23
- Sets `fl-cr-a`
23
+ Sets `fl-cr-a`, default is `"stretch"`
24
24
  - ### main `string`
25
- Sets `fl-m-a`
25
+ Sets `fl-m-a`, default is `"start"`
26
26
 
27
27
  ## Usage
28
28
  ```svelte
@@ -39,7 +39,7 @@
39
39
  export let direction = false
40
40
  export let pad = false
41
41
  export let gap = false
42
- export let cross = "start"
42
+ export let cross = "stretch"
43
43
  export let main = "start"
44
44
 
45
45
  $: wind = {
package/src/paper.svelte CHANGED
@@ -27,8 +27,10 @@
27
27
  Sets the layout the card will use to display content. Default is Flex.
28
28
  - ### scrollable `bool`
29
29
  Sets `over[auto]` on the layout component
30
- - ### lprops `Object`
31
- An object with props to pass to the layout component
30
+ - ### l-*
31
+ Any prop that is prefixed with `l-` will be passed to the layout
32
+ component, with the remaining props acting as the normal wind functions
33
+ on the paper itself
32
34
 
33
35
  ## Slots
34
36
  - ### header
@@ -57,7 +59,7 @@
57
59
  <div>Content 2</div>
58
60
  <div>Content 3</div>
59
61
  </Paper>
60
- <Paper>
62
+ <Paper l-pad="0px" m="4px">
61
63
  <Titlebar slot="header">
62
64
  <Text slot="title" title>
63
65
  Some Screen
@@ -86,18 +88,29 @@
86
88
  export let card = false
87
89
  export let square = false
88
90
  export let layout = Flex
89
- export let scrollable = false
90
- export let lprops = {}
91
+ export let scrollable = true
92
+
93
+ $: props = Object.entries($$restProps).reduce(
94
+ (p, [key, value]) => {
95
+ const [target, name] =
96
+ (key.startsWith("l-") === true)
97
+ ? [ p.layout, key.slice(2) ]
98
+ : [ p.paper, key ]
99
+ target[name] = value
100
+ return p
101
+ },
102
+ { layout: {}, paper: {} }
103
+ )
91
104
 
92
- $: props = {
105
+ $: layoutProps = {
93
106
  over: scrollable ? "auto" : false,
94
- ...lprops,
107
+ ...props.layout,
95
108
  }
96
109
  $: wind = {
97
110
  $color: color,
98
111
  "@outline": card,
99
112
  r: square && "0px",
100
- ...$$restProps
113
+ ...props.paper,
101
114
  }
102
115
  </script>
103
116
 
@@ -106,7 +119,7 @@
106
119
  {#if $$slots.content}
107
120
  <slot name="content" slot="content" />
108
121
  {:else}
109
- <svelte:component this={layout} {...props} slot="content">
122
+ <svelte:component this={layout} {...layoutProps} slot="content">
110
123
  <slot />
111
124
  </svelte:component>
112
125
  {/if}