@hyvor/design 0.0.31 → 0.0.33

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.
@@ -4,6 +4,7 @@ export let color = "accent";
4
4
  export let block = false;
5
5
  export let variant = "fill";
6
6
  export let align = "center";
7
+ export let button = {};
7
8
  </script>
8
9
 
9
10
  <svelte:element
@@ -25,6 +26,8 @@ export let align = "center";
25
26
  role="button"
26
27
  tabindex="0"
27
28
 
29
+ bind:this={button}
30
+
28
31
  {...$$restProps}
29
32
  >
30
33
 
@@ -8,6 +8,7 @@ declare const __propDef: {
8
8
  block?: boolean | undefined;
9
9
  variant?: "fill" | "outline" | "invisible" | "outline-fill" | undefined;
10
10
  align?: "start" | "center" | undefined;
11
+ button?: HTMLButtonElement | HTMLAnchorElement | undefined;
11
12
  };
12
13
  events: {
13
14
  keyup: KeyboardEvent;
@@ -1,7 +1,7 @@
1
1
  <script>export let checked = void 0;
2
2
  export let group = [];
3
3
  export let value = "on";
4
- let input;
4
+ export let input = {};
5
5
  function handleChange() {
6
6
  const index = group.indexOf(value);
7
7
  if (checked === void 0)
@@ -5,6 +5,7 @@ declare const __propDef: {
5
5
  checked?: boolean | undefined;
6
6
  group?: (string | number)[] | undefined;
7
7
  value?: string | number | undefined;
8
+ input?: HTMLInputElement | undefined;
8
9
  };
9
10
  events: {
10
11
  keyup: KeyboardEvent;
@@ -31,7 +31,11 @@ export let closeOnEscape = true;
31
31
  <div class="header">
32
32
 
33
33
  <div class="title">
34
- {title}
34
+ {#if $$slots.title}
35
+ <slot name="title" />
36
+ {:else}
37
+ <span>{title}</span>
38
+ {/if}
35
39
  </div>
36
40
 
37
41
  <div class="close-wrap">
@@ -64,7 +68,7 @@ export let closeOnEscape = true;
64
68
  position: fixed;
65
69
  top: 0;
66
70
  left: 0;
67
- z-index: 1000;
71
+ z-index: 10000000;
68
72
  width: 100%;
69
73
  height: 100%;
70
74
  background: rgba(0,0,0,0.5);
@@ -94,8 +98,6 @@ export let closeOnEscape = true;
94
98
  .header {
95
99
  padding: 20px 25px;
96
100
  border-bottom: 1px solid var(--box-border);
97
- font-size: 1.2em;
98
- font-weight: 600;
99
101
  display: flex;
100
102
  align-items: center;
101
103
  }
@@ -103,6 +105,10 @@ export let closeOnEscape = true;
103
105
  .title {
104
106
  flex: 1;
105
107
  }
108
+ .title span {
109
+ font-size: 1.2em;
110
+ font-weight: 600;
111
+ }
106
112
 
107
113
  .content {
108
114
  padding: 20px 25px;
@@ -11,6 +11,7 @@ declare const __propDef: {
11
11
  [evt: string]: CustomEvent<any>;
12
12
  };
13
13
  slots: {
14
+ title: {};
14
15
  default: {};
15
16
  footer: {};
16
17
  };
@@ -1,13 +1,15 @@
1
1
  <script>export let value = "";
2
2
  export let group = "";
3
+ export let input = {};
3
4
  </script>
4
5
 
5
6
  <label>
6
7
 
7
- <input
8
+ <input
8
9
  type="radio"
9
10
 
10
11
  bind:group
12
+ bind:this={input}
11
13
  {value}
12
14
 
13
15
  on:keyup
@@ -4,6 +4,7 @@ declare const __propDef: {
4
4
  [x: string]: any;
5
5
  value?: string | number | undefined;
6
6
  group?: string | number | undefined;
7
+ input?: HTMLInputElement | undefined;
7
8
  };
8
9
  events: {
9
10
  keyup: KeyboardEvent;
@@ -1,11 +1,13 @@
1
1
  <script>export let checked = false;
2
+ export let input = {};
2
3
  </script>
3
4
 
4
5
  <label class="switch-wrap">
5
6
  <span class="switch">
6
7
  <input
7
8
  type="checkbox"
8
- bind:checked
9
+ bind:checked
10
+ bind:this={input}
9
11
  {...$$restProps}
10
12
 
11
13
  on:keyup
@@ -3,6 +3,7 @@ declare const __propDef: {
3
3
  props: {
4
4
  [x: string]: any;
5
5
  checked?: boolean | undefined;
6
+ input?: HTMLInputElement | undefined;
6
7
  };
7
8
  events: {
8
9
  keyup: KeyboardEvent;
@@ -14,6 +14,8 @@ function handleClick() {
14
14
  class:active={isActive}
15
15
  on:click={handleClick}
16
16
  {...$$restProps}
17
+
18
+ on:click
17
19
  >
18
20
  {#if $$slots.start}
19
21
  <span class="start">
@@ -6,6 +6,8 @@ declare const __propDef: {
6
6
  name: string;
7
7
  };
8
8
  events: {
9
+ click: MouseEvent;
10
+ } & {
9
11
  [evt: string]: CustomEvent<any>;
10
12
  };
11
13
  slots: {
@@ -2,7 +2,7 @@
2
2
  export let size = "medium";
3
3
  export let block = false;
4
4
  export let value = void 0;
5
- let input;
5
+ export let input = {};
6
6
  </script>
7
7
 
8
8
 
@@ -6,6 +6,7 @@ declare const __propDef: {
6
6
  size?: "small" | "medium" | "large" | "x-small" | undefined;
7
7
  block?: boolean | undefined;
8
8
  value?: any;
9
+ input?: HTMLInputElement | undefined;
9
10
  };
10
11
  events: {
11
12
  keyup: KeyboardEvent;
@@ -3,16 +3,16 @@ export let block = false;
3
3
  export let rows = 5;
4
4
  export let cols = 40;
5
5
  export let state = "default";
6
- let input;
6
+ export let textarea = {};
7
7
  </script>
8
8
 
9
9
 
10
10
  <span class="input-wrap state-{state}"
11
11
  class:block
12
- on:click={() => input.focus()}
12
+ on:click={() => textarea.focus()}
13
13
  on:keydown={(e) => {
14
14
  if (e.key === 'Enter') {
15
- input.blur();
15
+ textarea.blur();
16
16
  }
17
17
  }}
18
18
  role="textbox"
@@ -29,7 +29,7 @@ let input;
29
29
 
30
30
  <textarea
31
31
  bind:value={value}
32
- bind:this={input}
32
+ bind:this={textarea}
33
33
 
34
34
 
35
35
  on:keyup
@@ -7,6 +7,7 @@ declare const __propDef: {
7
7
  rows?: number | undefined;
8
8
  cols?: number | undefined;
9
9
  state?: "default" | "error" | "success" | "warning" | undefined;
10
+ textarea?: HTMLTextAreaElement | undefined;
10
11
  };
11
12
  events: {
12
13
  keyup: KeyboardEvent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyvor/design",
3
- "version": "0.0.31",
3
+ "version": "0.0.33",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "scripts": {