@nil-/doc 0.2.29 → 0.2.30

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/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @nil-/doc
2
2
 
3
+ ## 0.2.30
4
+
5
+ ### Patch Changes
6
+
7
+ - [doc] Added color transition in Layout ([#43](https://github.com/njaldea/mono/pull/43))
8
+
9
+ - [doc] added Instance component ([#43](https://github.com/njaldea/mono/pull/43))
10
+
3
11
  ## 0.2.29
4
12
 
5
13
  ### Patch Changes
@@ -49,6 +49,7 @@
49
49
 
50
50
  /* colors */
51
51
  .layout {
52
+ transition: color 350ms, background-color 350ms;
52
53
  background-color: hsl(0, 0%, 100%);
53
54
  color: hsl(0, 100%, 0%);
54
55
  color-scheme: light;
@@ -0,0 +1,11 @@
1
+
2
+ <script>import Template from "./Template.svelte";
3
+ import Params from "./Params.svelte";
4
+ export let defaults = void 0;
5
+ export let noreset = false;
6
+ const cast = (t) => t;
7
+ </script>
8
+ <Template {defaults} {noreset} let:props let:key>
9
+ <slot props={cast(props)} {key} />
10
+ </Template>
11
+ <Params />
@@ -0,0 +1,22 @@
1
+ import { SvelteComponentTyped } from "svelte";
2
+ declare class __sveltets_Render<Args> {
3
+ props(): {
4
+ defaults?: Args | undefined;
5
+ noreset?: boolean | undefined;
6
+ };
7
+ events(): {} & {
8
+ [evt: string]: CustomEvent<any>;
9
+ };
10
+ slots(): {
11
+ default: {
12
+ props: Args;
13
+ key: boolean;
14
+ };
15
+ };
16
+ }
17
+ export type InstanceProps<Args> = ReturnType<__sveltets_Render<Args>['props']>;
18
+ export type InstanceEvents<Args> = ReturnType<__sveltets_Render<Args>['events']>;
19
+ export type InstanceSlots<Args> = ReturnType<__sveltets_Render<Args>['slots']>;
20
+ export default class Instance<Args> extends SvelteComponentTyped<InstanceProps<Args>, InstanceEvents<Args>, InstanceSlots<Args>> {
21
+ }
22
+ export {};
@@ -1,25 +1,8 @@
1
- <script context="module">let indexer = 0;
2
- </script>
3
1
  <script>export let dark = true;
4
- import { spring } from "svelte/motion";
5
- function iter() {
6
- dark = !dark;
7
- }
8
- const rotate = spring(dark ? 90 : 40);
9
- const mcx = spring(dark ? 30 : 12);
10
- const mcy = spring(dark ? 0 : 4);
11
- const cr = spring(dark ? 5 : 9);
12
- const opacity = spring(dark ? 0 : 1);
13
- $:
14
- rotate.set(dark ? 90 : 40);
15
- $:
16
- mcx.set(dark ? 30 : 12);
17
- $:
18
- mcy.set(dark ? 0 : 4);
19
- $:
20
- cr.set(dark ? 5 : 9);
2
+ import { tweened } from "svelte/motion";
3
+ const values = tweened(dark ? vdark : vlight, { duration: 350 });
21
4
  $:
22
- opacity.set(dark ? 1 : 0);
5
+ values.set(dark ? vdark : vlight);
23
6
  const index = indexer++;
24
7
  </script>
25
8
  <style>
@@ -27,14 +10,21 @@ const index = indexer++;
27
10
  all: unset;
28
11
  width: 50%;
29
12
  height: 50%;
13
+ margin: auto;
14
+
15
+ cursor: pointer;
16
+ color: black;
30
17
  fill: none;
18
+
31
19
  stroke: currentColor;
32
20
  stroke-width: 2;
33
21
  stroke-linecap: round;
34
22
  stroke-linejoin: round;
35
- cursor: pointer;
36
- color: black;
37
- margin: auto;
23
+
24
+ -webkit-tap-highlight-color: transparent;
25
+ -moz-tap-highlight-color: transparent;
26
+ -o-tap-highlight-color: transparent;
27
+ tap-highlight-color: transparent;
38
28
  }
39
29
 
40
30
  svg.dark {
@@ -42,20 +32,39 @@ const index = indexer++;
42
32
  }
43
33
  </style>
44
34
 
45
-
35
+ <script context="module">let indexer = 0;
36
+ const vlight = {
37
+ rotate: 40,
38
+ mask: {
39
+ cx: 12,
40
+ cy: 4
41
+ },
42
+ cr: 10,
43
+ opacity: 0
44
+ };
45
+ const vdark = {
46
+ rotate: 180,
47
+ mask: {
48
+ cx: 30,
49
+ cy: 0
50
+ },
51
+ cr: 5,
52
+ opacity: 1
53
+ };
54
+ </script>
46
55
  <svg
47
- on:click={iter}
48
- on:keypress={null}
49
- viewBox="0 0 24 24"
50
56
  class:dark
51
- style={`transform: rotate(${$rotate}deg)`}
57
+ viewBox="0 0 24 24"
58
+ style={`transform: rotate(${$values.rotate}deg)`}
59
+ on:click={() => (dark = !dark)}
60
+ on:keypress={null}
52
61
  >
53
62
  <mask id={`theme_icon_${index}`}>
54
63
  <rect x="0" y="0" width="100%" height="100%" fill="white" />
55
- <circle cx={$mcx} cy={$mcy} r="9" fill="currentColor" />
64
+ <circle cx={$values.mask.cx} cy={$values.mask.cy} r="11" fill="currentColor" />
56
65
  </mask>
57
- <circle cx="12" cy="12" r={$cr} fill="currentColor" mask={`url(#theme_icon_${index})`} />
58
- <g style={`opacity: ${$opacity}`}>
66
+ <circle cx="12" cy="12" r={$values.cr} fill="currentColor" mask={`url(#theme_icon_${index})`} />
67
+ <g style={`opacity: ${$values.opacity}`}>
59
68
  <line x1="12" y1="1" x2="12" y2="3" />
60
69
  <line x1="12" y1="21" x2="12" y2="23" />
61
70
  <line x1="4.22" y1="4.22" x2="5.64" y2="5.64" />
package/index.d.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  export { renamer, sorter } from "./components/navigation/utils";
2
2
  export type { Control } from "./components/block/controls/types";
3
3
  export { default as Layout } from "./components/Layout.svelte";
4
+ export { default as Instance } from "./components/block/Instance.svelte";
4
5
  export { default as Block } from "./components/block/Block.svelte";
5
6
  export { default as Template } from "./components/block/Template.svelte";
6
7
  export { default as Controls } from "./components/block/Controls.svelte";
package/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  export { renamer, sorter } from "./components/navigation/utils";
2
2
  export { default as Layout } from "./components/Layout.svelte";
3
+ export { default as Instance } from "./components/block/Instance.svelte";
3
4
  export { default as Block } from "./components/block/Block.svelte";
4
5
  export { default as Template } from "./components/block/Template.svelte";
5
6
  export { default as Controls } from "./components/block/Controls.svelte";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nil-/doc",
3
- "version": "0.2.29",
3
+ "version": "0.2.30",
4
4
  "author": {
5
5
  "email": "njaldea@gmail.com",
6
6
  "name": "Neil Aldea"