@intechstudio/grid-uikit 0.0.5 → 0.0.6

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.
@@ -1,8 +1,4 @@
1
- <script>const dispatch = (name, payload) => {
2
- const event = new Event(name, payload);
3
- dispatchEvent(event);
4
- };
5
- const styleMap = {
1
+ <script>const styleMap = {
6
2
  normal: {
7
3
  enabled: "text-gray-50 bg-black bg-opacity-10 border border-black border-opacity-40 hover:bg-opacity-40",
8
4
  disabled: "text-gray-50/25 bg-black/25 bg-opacity-10 border border-black/25 border-opacity-40"
@@ -23,24 +19,22 @@ export let disabled = false;
23
19
  export let popup = void 0;
24
20
  export let ratio = "normal";
25
21
  export let snap = "auto";
26
- let button;
22
+ export let click;
27
23
  let showPopup = false;
28
- function handleClick(e) {
29
- if (!showPopup) {
30
- showPopup = true;
31
- setTimeout(() => {
32
- showPopup = false;
33
- }, popup?.duration ?? 3e3);
34
- }
35
- dispatch("click");
36
- }
37
24
  </script>
38
25
 
39
26
  <container class="relative" class:w-full={snap === "full"}>
40
27
  <button
41
- bind:this={button}
42
28
  class:selected
43
- on:click={handleClick}
29
+ on:click={() => {
30
+ if (!showPopup) {
31
+ showPopup = true;
32
+ setTimeout(() => {
33
+ showPopup = false;
34
+ }, popup?.duration ?? 3000);
35
+ }
36
+ click();
37
+ }}
44
38
  {disabled}
45
39
  class="{disabled
46
40
  ? styleMap[style].disabled
@@ -10,6 +10,7 @@ declare const __propDef: {
10
10
  } | undefined;
11
11
  ratio?: string | undefined;
12
12
  snap?: string | undefined;
13
+ click: (...args: any) => void;
13
14
  };
14
15
  events: {
15
16
  [evt: string]: CustomEvent<any>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intechstudio/grid-uikit",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run package",
@@ -25,8 +25,8 @@
25
25
  ],
26
26
  "dependencies": {
27
27
  "@melt-ui/svelte": "^0.42.0",
28
- "tailwindcss": "^3.1.8",
29
- "svelte-easy-popover": "^1.0.0"
28
+ "svelte-easy-popover": "^1.0.0",
29
+ "tailwindcss": "^3.1.8"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "svelte": "^4.0.0"