@hyvor/design 0.0.63 → 0.0.64

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.
@@ -3,7 +3,7 @@ import { clickOutside } from "../index.js";
3
3
  import { createEventDispatcher } from "svelte";
4
4
  export let color = "#000000";
5
5
  export let size = 30;
6
- let show = false;
6
+ export let show = false;
7
7
  const dispatch = createEventDispatcher();
8
8
  function handleInput() {
9
9
  dispatch("input", color);
@@ -19,7 +19,13 @@ function handleClose() {
19
19
  style:width="{size}px"
20
20
  style:height="{size}px"
21
21
  style:background-color={color}
22
- on:click={() => show = true}
22
+ on:click={() => {
23
+ if (show) {
24
+ handleClose();
25
+ } else {
26
+ show = true;
27
+ }
28
+ }}
23
29
  ></button>
24
30
 
25
31
  {#if show}
@@ -29,9 +35,9 @@ function handleClose() {
29
35
  callback: () => handleClose(),
30
36
  }}
31
37
  >
32
- <ColorPicker
38
+ <ColorPicker
33
39
  bind:hex={color}
34
- --input-size={size + 'px'}
40
+ --input-size={size + "px"}
35
41
  isDialog={false}
36
42
  isAlpha={false}
37
43
  on:input={handleInput}
@@ -55,4 +61,4 @@ function handleClose() {
55
61
  width: 0;
56
62
  z-index: 1000;
57
63
  }
58
- </style>
64
+ </style>
@@ -3,6 +3,7 @@ declare const __propDef: {
3
3
  props: {
4
4
  color?: string | undefined;
5
5
  size?: number | undefined;
6
+ show?: boolean | undefined;
6
7
  };
7
8
  events: {
8
9
  input: CustomEvent<string>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyvor/design",
3
- "version": "0.0.63",
3
+ "version": "0.0.64",
4
4
  "license": "MIT",
5
5
  "private": false,
6
6
  "scripts": {