@rogieking/figui3 1.0.94 → 1.0.95

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/example.html CHANGED
@@ -19,6 +19,21 @@
19
19
  <h2>Heading 2</h2>
20
20
  <h3>Heading 3</h3>
21
21
  <br />
22
+ <fig-button id="button-progressive-blur"
23
+ variant="ghost"
24
+ icon="true"
25
+ class=""
26
+ disabled="true"><svg width="16"
27
+ height="16"
28
+ viewBox="0 0 16 16"
29
+ fill="none"
30
+ xmlns="http://www.w3.org/2000/svg">
31
+ <path fill-rule="evenodd"
32
+ clip-rule="evenodd"
33
+ d="M6.5 6C7.32843 6 8 5.32843 8 4.5C8 3.67157 7.32843 3 6.5 3C5.67157 3 5 3.67157 5 4.5C5 5.32843 5.67157 6 6.5 6ZM6.5 7C7.70948 7 8.71836 6.14112 8.94999 5H14V4H8.94999C8.71836 2.85888 7.70948 2 6.5 2C5.29052 2 4.28164 2.85888 4.05001 4H2V5H4.05001C4.28164 6.14112 5.29052 7 6.5 7ZM9.5 13C8.67157 13 8 12.3284 8 11.5C8 10.6716 8.67157 10 9.5 10C10.3284 10 11 10.6716 11 11.5C11 12.3284 10.3284 13 9.5 13ZM9.5 14C8.29052 14 7.28164 13.1411 7.05001 12H2V11H7.05001C7.28164 9.85888 8.29052 9 9.5 9C10.7095 9 11.7184 9.85888 11.95 11H14V12H11.95C11.7184 13.1411 10.7095 14 9.5 14Z"
34
+ fill="currentColor"></path>
35
+ </svg></fig-button>
36
+ <br /> <br />
22
37
  <fig-button disabled>Button 1</fig-button>
23
38
  <br /><br />
24
39
  <fig-button variant="secondary"
package/fig.css CHANGED
@@ -722,13 +722,14 @@ fig-button {
722
722
  /* Disabled */
723
723
  &[disabled]:not([disabled="false"]){
724
724
  background-color: var(--figma-color-bg-disabled);
725
-
726
725
  pointer-events: none;
726
+ cursor: not-allowed;
727
727
  &:not([variant="secondary"]){
728
728
  color: var(--figma-color-text-ondisabled);
729
729
  box-shadow: none;
730
730
  }
731
- &[variant="secondary"]{
731
+ &[variant="secondary"],
732
+ &[variant="ghost"]{
732
733
  color: var(--figma-color-text-disabled);
733
734
  background-color: transparent;
734
735
  }
@@ -926,7 +927,7 @@ fig-avatar,
926
927
  background: var(--checkerboard);
927
928
  }
928
929
  }
929
- &[borderless] {
930
+ &[borderless] img{
930
931
  box-shadow: none;
931
932
  }
932
933
 
package/fig.js CHANGED
@@ -15,9 +15,6 @@ if (window.customElements && !window.customElements.get("fig-button")) {
15
15
  this.attachShadow({ mode: "open" });
16
16
  }
17
17
  connectedCallback() {
18
- this.render();
19
- }
20
- render() {
21
18
  this.#type = this.getAttribute("type") || "button";
22
19
  this.shadowRoot.innerHTML = `
23
20
  <style>
@@ -47,10 +44,13 @@ if (window.customElements && !window.customElements.get("fig-button")) {
47
44
  this.#selected =
48
45
  this.hasAttribute("selected") &&
49
46
  this.getAttribute("selected") !== "false";
50
- this.addEventListener("click", this.handleClick.bind(this));
47
+ this.addEventListener("click", this.#handleClick.bind(this));
51
48
 
52
- this.button = this.querySelector("button");
49
+ requestAnimationFrame(() => {
50
+ this.button = this.querySelector("button");
51
+ });
53
52
  }
53
+
54
54
  get type() {
55
55
  return this.#type;
56
56
  }
@@ -67,7 +67,7 @@ if (window.customElements && !window.customElements.get("fig-button")) {
67
67
  this.setAttribute("selected", value);
68
68
  }
69
69
 
70
- handleClick(event) {
70
+ #handleClick(event) {
71
71
  if (this.#type === "toggle") {
72
72
  this.selected = !this.#selected;
73
73
  }
@@ -145,7 +145,6 @@ if (window.customElements && !window.customElements.get("fig-dropdown")) {
145
145
  }
146
146
 
147
147
  #handleSelectInput(e) {
148
- console.log("FigDropdown #handleSelectInput:", e.target.value);
149
148
  this.value = e.target.value;
150
149
  this.setAttribute("value", this.value);
151
150
  }
@@ -181,7 +180,6 @@ if (window.customElements && !window.customElements.get("fig-dropdown")) {
181
180
  attributeChangedCallback(name, oldValue, newValue) {
182
181
  if (name === "value") {
183
182
  this.#syncSelectedValue(newValue);
184
- console.log("val:", this.value);
185
183
  }
186
184
  if (name === "type") {
187
185
  this.type = newValue;
package/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "1.0.94"
3
+ "version": "1.0.95"
4
4
  }