@rogieking/figui3 2.10.2 → 2.10.3

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.
Files changed (2) hide show
  1. package/fig.js +11 -2
  2. package/package.json +1 -1
package/fig.js CHANGED
@@ -1984,9 +1984,17 @@ class FigInputNumber extends HTMLElement {
1984
1984
  }
1985
1985
  this.transform = Number(this.getAttribute("transform") || 1);
1986
1986
 
1987
+ const hasSteppers =
1988
+ this.hasAttribute("steppers") &&
1989
+ this.getAttribute("steppers") !== "false";
1990
+
1991
+ // Use type="number" when steppers are enabled (for native spin buttons)
1992
+ const inputType = hasSteppers ? "number" : "text";
1993
+ const inputMode = hasSteppers ? "" : 'inputmode="decimal"';
1994
+
1987
1995
  let html = `<input
1988
- type="text"
1989
- inputmode="decimal"
1996
+ type="${inputType}"
1997
+ ${inputMode}
1990
1998
  ${this.name ? `name="${this.name}"` : ""}
1991
1999
  placeholder="${this.placeholder}"
1992
2000
  value="${this.#formatWithUnit(this.value)}" />`;
@@ -2268,6 +2276,7 @@ class FigInputNumber extends HTMLElement {
2268
2276
  "name",
2269
2277
  "units",
2270
2278
  "unit-position",
2279
+ "steppers",
2271
2280
  ];
2272
2281
  }
2273
2282
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "2.10.2",
3
+ "version": "2.10.3",
4
4
  "description": "A lightweight web components library for building Figma plugin and widget UIs with native look and feel",
5
5
  "author": "Rogie King",
6
6
  "license": "MIT",