smorks-svelte-ui 0.0.1-alpha.21 → 0.0.1-alpha.22

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.
@@ -6,9 +6,12 @@ export let height = 18;
6
6
  export let color = void 0;
7
7
  export let preset = void 0;
8
8
  export let svg = void 0;
9
+ export let disabled = false;
9
10
  export const dispatch = createEventDispatcher();
10
11
  function buttonClick() {
11
- dispatch("click");
12
+ if (!disabled) {
13
+ dispatch("click");
14
+ }
12
15
  }
13
16
  </script>
14
17
 
@@ -18,6 +21,7 @@ function buttonClick() {
18
21
  on:click|preventDefault={buttonClick}
19
22
  style="width:{width}px;height:{height}px; !important;"
20
23
  style:color
24
+ class:disabled
21
25
  >
22
26
  <IconBase {name} {width} {height} {preset} {svg} />
23
27
  </a>
@@ -36,4 +40,8 @@ function buttonClick() {
36
40
  a.icon-button:active {
37
41
  transform: scale(0.95);
38
42
  }
43
+ a.icon-button.disabled {
44
+ filter: brightness(0.6);
45
+ cursor: default;
46
+ }
39
47
  </style>
@@ -7,6 +7,7 @@ declare const __propDef: {
7
7
  color?: string | undefined;
8
8
  preset?: string | undefined;
9
9
  svg?: string | undefined;
10
+ disabled?: boolean | undefined;
10
11
  dispatch?: import("svelte").EventDispatcher<any> | undefined;
11
12
  };
12
13
  events: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smorks-svelte-ui",
3
- "version": "0.0.1-alpha.21",
3
+ "version": "0.0.1-alpha.22",
4
4
  "license": "MIT",
5
5
  "exports": {
6
6
  ".": {