@florid-kit/components 0.8.24 → 0.8.26

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/index.js +2 -2
  2. package/index.mjs +3 -1
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -1951,8 +1951,8 @@
1951
1951
  flex-wrap: wrap;
1952
1952
  gap: var(--spacing-s);
1953
1953
  }
1954
- `;Ut([a({reflect:!0})],ct.prototype,"name",2);Ut([a({reflect:!0})],ct.prototype,"value",2);ct=Ut([x("o-chipset")],ct);var No=Object.defineProperty,Fo=Object.getOwnPropertyDescriptor,N=(o,t,e,r)=>{for(var i=r>1?void 0:r?Fo(t,e):t,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&No(t,e,i),i};const Ro=Bt(u);let L=class extends Ro{constructor(){super(...arguments),this.name="",this.value="",this.role="",this.text="",this.selected=!1,this.disabled=!1,this.fullwidth=!1,this.crossIconName="cross",this.strikethroughImgName="strikeDiagonal"}handleClick(o){this.selected=!this.selected;const t={selected:this.selected},e=new CustomEvent("selected",{detail:t,bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e),e.defaultPrevented&&o.preventDefault(),this.selected=t.selected}crossIcon(){const o=W[this.crossIconName].replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"').replace(/stroke=[#"'a-z1-9]*/gi,"");return l`<span class="cross-icon">${E(o)}</span>`}strikeThroughImg(){const o=Je[this.strikethroughImgName].replace("<svg",'<svg aria-hidden="true" focusable="false" part="strikethrough"').replace(/stroke=[#"'a-z1-9]*/gi,"");return E(o)}render(){const o=this.text;return l`${this.role==="button"?l`
1955
- <a role="button" tabindex="0" class="button" ?disabled=${this.disabled} @click=${this.handleClick}
1954
+ `;Ut([a({reflect:!0})],ct.prototype,"name",2);Ut([a({reflect:!0})],ct.prototype,"value",2);ct=Ut([x("o-chipset")],ct);var No=Object.defineProperty,Fo=Object.getOwnPropertyDescriptor,N=(o,t,e,r)=>{for(var i=r>1?void 0:r?Fo(t,e):t,n=o.length-1,s;n>=0;n--)(s=o[n])&&(i=(r?s(t,e,i):s(i))||i);return r&&i&&No(t,e,i),i};const Ro=Bt(u);let L=class extends Ro{constructor(){super(...arguments),this.name="",this.value="",this.role="",this.text="",this.selected=!1,this.disabled=!1,this.fullwidth=!1,this.crossIconName="cross",this.strikethroughImgName="strikeDiagonal"}handleClick(o){if(o instanceof KeyboardEvent&&o.key!=="Enter"&&o.key!==" ")return;this.selected=!this.selected;const t={selected:this.selected},e=new CustomEvent("selected",{detail:t,bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e),e.defaultPrevented&&o.preventDefault(),this.selected=t.selected}crossIcon(){const o=W[this.crossIconName].replace("<svg",'<svg aria-hidden="true" focusable="false" part="svg"').replace(/stroke=[#"'a-z1-9]*/gi,"");return l`<span class="cross-icon">${E(o)}</span>`}strikeThroughImg(){const o=Je[this.strikethroughImgName].replace("<svg",'<svg aria-hidden="true" focusable="false" part="strikethrough"').replace(/stroke=[#"'a-z1-9]*/gi,"");return E(o)}render(){const o=this.text;return l`${this.role==="button"?l`
1955
+ <a role="button" tabindex="0" class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}
1956
1956
  aria-label=${this.ariaLabel} aria-pressed=${this.selected}>
1957
1957
  ${o?l`
1958
1958
  ${this.text?l`<span class="text">${this.text}</span>`:d}
package/index.mjs CHANGED
@@ -3700,6 +3700,8 @@ let L = class extends Ro {
3700
3700
  super(...arguments), this.name = "", this.value = "", this.role = "", this.text = "", this.selected = !1, this.disabled = !1, this.fullwidth = !1, this.crossIconName = "cross", this.strikethroughImgName = "strikeDiagonal";
3701
3701
  }
3702
3702
  handleClick(o) {
3703
+ if (o instanceof KeyboardEvent && o.key !== "Enter" && o.key !== " ")
3704
+ return;
3703
3705
  this.selected = !this.selected;
3704
3706
  const t = { selected: this.selected }, e = new CustomEvent("selected", { detail: t, bubbles: !0, composed: !0, cancelable: !0 });
3705
3707
  this.dispatchEvent(e), e.defaultPrevented && o.preventDefault(), this.selected = t.selected;
@@ -3721,7 +3723,7 @@ let L = class extends Ro {
3721
3723
  render() {
3722
3724
  const o = this.text;
3723
3725
  return l`${this.role === "button" ? l`
3724
- <a role="button" tabindex="0" class="button" ?disabled=${this.disabled} @click=${this.handleClick}
3726
+ <a role="button" tabindex="0" class="button" ?disabled=${this.disabled} @click=${this.handleClick} @keydown=${this.handleClick}
3725
3727
  aria-label=${this.ariaLabel} aria-pressed=${this.selected}>
3726
3728
  ${o ? l`
3727
3729
  ${this.text ? l`<span class="text">${this.text}</span>` : d}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@florid-kit/components",
3
- "version": "0.8.24",
3
+ "version": "0.8.26",
4
4
  "main": "index.js",
5
5
  "module": "index.mjs",
6
6
  "typings": "index.d.ts",