@rogieking/figui3 1.0.6 → 1.0.8

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 (3) hide show
  1. package/fig.css +4 -11
  2. package/fig.js +13 -0
  3. package/package.json +1 -1
package/fig.css CHANGED
@@ -529,17 +529,8 @@ fig-segmented-control {
529
529
  appearance: none;
530
530
  padding: 0 var(--spacer-2);
531
531
 
532
- & [type=radio] {
533
- position: absolute;
534
- inset: 0;
535
- border-radius: 0;
536
- opacity: 0;
537
- z-index: 1;
538
- width: 100%;
539
- height: 100%;
540
- }
541
-
542
- &:has(:checked) {
532
+ &[selected]:not([selected=false]),
533
+ &[selected=true] {
543
534
  background-color: var(--figma-color-bg);
544
535
  border-radius: calc(var(--radius-medium) - 1px);
545
536
  box-shadow: var(--handle-shadow);
@@ -1619,6 +1610,8 @@ fig-input-text[resizable] textarea {
1619
1610
 
1620
1611
  fig-checkbox,
1621
1612
  fig-radio {
1613
+ align-items: center;
1614
+
1622
1615
  & label span {
1623
1616
  vertical-align: middle;
1624
1617
  }
package/fig.js CHANGED
@@ -956,6 +956,10 @@ class FigCheckbox extends HTMLElement {
956
956
  case "checked":
957
957
  this.checked = this.input.checked = this.hasAttribute("checked") ? true : false
958
958
  break;
959
+ case "name":
960
+ case "value":
961
+ this.input[name] = newValue
962
+ break;
959
963
  }
960
964
  }
961
965
 
@@ -968,6 +972,15 @@ class FigCheckbox extends HTMLElement {
968
972
  }
969
973
  window.customElements.define('fig-checkbox', FigCheckbox);
970
974
 
975
+ /* Radio */
976
+ class FigRadio extends FigCheckbox {
977
+ constructor() {
978
+ super()
979
+ this.input.setAttribute("type", "radio")
980
+ }
981
+ }
982
+ window.customElements.define('fig-radio', FigRadio);
983
+
971
984
  /* Switch */
972
985
  class FigSwitch extends FigCheckbox {
973
986
  render() {
package/package.json CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@rogieking/figui3",
3
- "version": "1.0.6"
3
+ "version": "1.0.8"
4
4
  }