@revotech-group/revotech-ui-kit 0.0.95 → 0.0.96

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/dist/library.css CHANGED
@@ -853,12 +853,12 @@ body {
853
853
  .rtg-h-\[300px\] {
854
854
  height: 300px;
855
855
  }
856
+ .rtg-h-\[36px\] {
857
+ height: 36px;
858
+ }
856
859
  .rtg-h-\[400px\] {
857
860
  height: 400px;
858
861
  }
859
- .rtg-h-\[40px\] {
860
- height: 40px;
861
- }
862
862
  .rtg-h-full {
863
863
  height: 100%;
864
864
  }
@@ -937,6 +937,9 @@ body {
937
937
  .rtg-w-\[350px\] {
938
938
  width: 350px;
939
939
  }
940
+ .rtg-w-\[36px\] {
941
+ width: 36px;
942
+ }
940
943
  .rtg-w-\[400px\] {
941
944
  width: 400px;
942
945
  }
@@ -12849,8 +12849,8 @@ let at = class extends h {
12849
12849
  }
12850
12850
  render() {
12851
12851
  const e = this._inputOtp, t = (e == null ? void 0 : e.variant) === "with-spacing", o = (e == null ? void 0 : e.variant) === "combined", s = {
12852
- "rtg-h-[40px]": !0,
12853
- "rtg-w-[40px]": !0,
12852
+ "rtg-h-[36px]": !0,
12853
+ "rtg-w-[36px]": !0,
12854
12854
  "rtg-text-center rtg-relative rtg-flex rtg-h-10 rtg-w-10 rtg-items-center rtg-justify-center rtg-border-y rtg-border-r rtg-border-input rtg-text-sm rtg-transition-all": !0,
12855
12855
  "first:rtg-rounded-l-md first:rtg-border-l": this.isFirst,
12856
12856
  "rtg-overflow-hidden": !0,
@@ -13014,7 +13014,7 @@ let it = class extends h {
13014
13014
  }
13015
13015
  applyVariantStyles() {
13016
13016
  const e = this.querySelectorAll("rtg-input-otp-group");
13017
- switch (this.querySelectorAll("rtg-input-otp-separator"), e.forEach((t) => {
13017
+ switch (e.forEach((t) => {
13018
13018
  t.className = "", t.classList.add("rtg-flex", "rtg-items-center");
13019
13019
  }), this.variant) {
13020
13020
  case "with-spacing":
@@ -4425,7 +4425,7 @@ body {
4425
4425
  class="${p(dd,this.className)}"
4426
4426
  ?disable="${this.disabled}"
4427
4427
  ></div>
4428
- `}},Pe([l.property({type:Boolean})],o.ToggleGroup.prototype,"disabled",2),Pe([l.property({type:String})],o.ToggleGroup.prototype,"type",2),Pe([l.property({attribute:!0,type:Boolean,reflect:!0})],o.ToggleGroup.prototype,"required",2),Pe([l.property({attribute:!0,type:String,reflect:!0})],o.ToggleGroup.prototype,"variant",2),Pe([l.property({attribute:!0,type:String})],o.ToggleGroup.prototype,"size",2),Pe([l.property({type:Array})],o.ToggleGroup.prototype,"selectedItems",2),o.ToggleGroup=Pe([l.customElement("rtg-toggle-group")],o.ToggleGroup);var md=Object.defineProperty,vd=Object.getOwnPropertyDescriptor,Fe=(a,e,r,n)=>{for(var t=n>1?void 0:n?vd(e,r):e,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=(n?s(e,r,t):s(t))||t);return n&&t&&md(e,r,t),t};o.InputOtpSlot=class extends h{constructor(){super(...arguments),this.click=()=>{},this.index=0,this.isFirst=!1,this.isLast=!1,this.value=""}get _inputOtp(){let e=this.parentElement;for(;e&&!(e instanceof o.InputOtp);)e=e.parentElement;return e}firstUpdated(e){const r=this._inputOtp;r&&(r.inputes.push({index:r.inputes.length,value:"",isSelected:!1,userIndex:this.index}),r.addEventListener("selected-input",n=>{const t=this.querySelector(`input[name="input-${n.detail.selectedItems}"]`);t&&(t.focus(),n.detail.eventType==="changes"&&(t.value=""))}))}disconnectedCallback(){super.disconnectedCallback(),this._inputOtp&&this._inputOtp.removeEventListener("selected-input",()=>{})}getAttributesToExclude(){return[]}handleFocus(e){const r=this._inputOtp;if(!r)return;const n=r.inputes.findIndex(i=>i.value===""),t=this.index;if(n!==-1&&t>n){e.preventDefault(),e.stopImmediatePropagation();const i=n;r.raiseEvent(i,"focus")}}handleInputChange(e){const r=e.target;if(new RegExp(/^\d+$/).test(r.value)){const t=this._inputOtp;if(t){let i=t.inputes.findIndex(s=>s.index===this.index);t.inputes[i]={...t.inputes[i],value:r.value,isSelected:!1},i+1<t.inputes.length&&t.raiseEvent(i+1,"changes")}}else r.value=""}handleKeyDown(e){const r=e.target,n=this._inputOtp;if(!n)return;const t=n.inputes.findIndex(i=>i.index===this.index);switch(e.key){case"Backspace":{e.preventDefault();const i=r.value==="",s=n.inputes.find(w=>w.value===""),m=s!==void 0?n.inputes.indexOf(s):n.inputes.length;if(i&&t>=m){t>0&&n.raiseEvent(t-1,"focus");return}n.inputes[t].value="",r.value="";for(let w=t;w<n.inputes.length-1;w++){n.inputes[w].value=n.inputes[w+1].value;const x=n.querySelector(`input[name="input-${n.inputes[w].index}"]`);x&&(x.value=n.inputes[w].value)}const C=n.inputes[n.inputes.length-1];C.value="";const b=n.querySelector(`input[name="input-${C.index}"]`);b&&(b.value=""),n.raiseEvent(t,"focus");break}case"ArrowLeft":e.preventDefault(),t>0&&n.raiseEvent(t-1,"focus");break;case"ArrowRight":e.preventDefault(),t<n.maxLength-1&&n.raiseEvent(t+1,"focus");break}}handlePaste(e){var C;e.preventDefault();const r=this._inputOtp;if(!r)return;const t=(((C=e.clipboardData)==null?void 0:C.getData("text"))??"").replace(/\D/g,"").split("").slice(0);if(t.length===0)return;const i=r.inputes.findIndex(b=>b.index===this.index),s=r.maxLength-i;t.splice(s);for(let b=0;b<t.length;b++){const w=i+b;if(w>=r.maxLength)break;r.inputes[w].value=t[b];const x=r.querySelector(`input[name="input-${w}"]`);x&&(x.value=t[b])}const m=i+t.length;m<r.maxLength&&r.raiseEvent(m,"focus")}createRenderRoot(){return this}render(){const e=this._inputOtp,r=(e==null?void 0:e.variant)==="with-spacing",n=(e==null?void 0:e.variant)==="combined",t={"rtg-h-[40px]":!0,"rtg-w-[40px]":!0,"rtg-text-center rtg-relative rtg-flex rtg-h-10 rtg-w-10 rtg-items-center rtg-justify-center rtg-border-y rtg-border-r rtg-border-input rtg-text-sm rtg-transition-all":!0,"first:rtg-rounded-l-md first:rtg-border-l":this.isFirst,"rtg-overflow-hidden":!0,"focus:rtg-border focus:rtg-border-[#c1c1c1] focus:rtg-border-[3px]":!0,"rtg-border":r||n,"rtg-border-t":!r||n,"rtg-border-b":!r||n,"rtg-border-r":!r||n,"rtg-border-l":this.isFirst||r||n,"first:rtg-rounded-l-md":!0,"last:rtg-rounded-r-md":!0,"rtg-rounded-none":(e==null?void 0:e.variant)==="with-separator"||(e==null?void 0:e.variant)==="combined","rtg-rounded-l-md":this.isFirst&&((e==null?void 0:e.variant)==="default"||(e==null?void 0:e.variant)==="with-spacing"),"rtg-rounded-r-md":this.isLast&&((e==null?void 0:e.variant)==="default"||(e==null?void 0:e.variant)==="with-spacing")};return d.html`
4428
+ `}},Pe([l.property({type:Boolean})],o.ToggleGroup.prototype,"disabled",2),Pe([l.property({type:String})],o.ToggleGroup.prototype,"type",2),Pe([l.property({attribute:!0,type:Boolean,reflect:!0})],o.ToggleGroup.prototype,"required",2),Pe([l.property({attribute:!0,type:String,reflect:!0})],o.ToggleGroup.prototype,"variant",2),Pe([l.property({attribute:!0,type:String})],o.ToggleGroup.prototype,"size",2),Pe([l.property({type:Array})],o.ToggleGroup.prototype,"selectedItems",2),o.ToggleGroup=Pe([l.customElement("rtg-toggle-group")],o.ToggleGroup);var md=Object.defineProperty,vd=Object.getOwnPropertyDescriptor,Fe=(a,e,r,n)=>{for(var t=n>1?void 0:n?vd(e,r):e,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=(n?s(e,r,t):s(t))||t);return n&&t&&md(e,r,t),t};o.InputOtpSlot=class extends h{constructor(){super(...arguments),this.click=()=>{},this.index=0,this.isFirst=!1,this.isLast=!1,this.value=""}get _inputOtp(){let e=this.parentElement;for(;e&&!(e instanceof o.InputOtp);)e=e.parentElement;return e}firstUpdated(e){const r=this._inputOtp;r&&(r.inputes.push({index:r.inputes.length,value:"",isSelected:!1,userIndex:this.index}),r.addEventListener("selected-input",n=>{const t=this.querySelector(`input[name="input-${n.detail.selectedItems}"]`);t&&(t.focus(),n.detail.eventType==="changes"&&(t.value=""))}))}disconnectedCallback(){super.disconnectedCallback(),this._inputOtp&&this._inputOtp.removeEventListener("selected-input",()=>{})}getAttributesToExclude(){return[]}handleFocus(e){const r=this._inputOtp;if(!r)return;const n=r.inputes.findIndex(i=>i.value===""),t=this.index;if(n!==-1&&t>n){e.preventDefault(),e.stopImmediatePropagation();const i=n;r.raiseEvent(i,"focus")}}handleInputChange(e){const r=e.target;if(new RegExp(/^\d+$/).test(r.value)){const t=this._inputOtp;if(t){let i=t.inputes.findIndex(s=>s.index===this.index);t.inputes[i]={...t.inputes[i],value:r.value,isSelected:!1},i+1<t.inputes.length&&t.raiseEvent(i+1,"changes")}}else r.value=""}handleKeyDown(e){const r=e.target,n=this._inputOtp;if(!n)return;const t=n.inputes.findIndex(i=>i.index===this.index);switch(e.key){case"Backspace":{e.preventDefault();const i=r.value==="",s=n.inputes.find(w=>w.value===""),m=s!==void 0?n.inputes.indexOf(s):n.inputes.length;if(i&&t>=m){t>0&&n.raiseEvent(t-1,"focus");return}n.inputes[t].value="",r.value="";for(let w=t;w<n.inputes.length-1;w++){n.inputes[w].value=n.inputes[w+1].value;const x=n.querySelector(`input[name="input-${n.inputes[w].index}"]`);x&&(x.value=n.inputes[w].value)}const C=n.inputes[n.inputes.length-1];C.value="";const b=n.querySelector(`input[name="input-${C.index}"]`);b&&(b.value=""),n.raiseEvent(t,"focus");break}case"ArrowLeft":e.preventDefault(),t>0&&n.raiseEvent(t-1,"focus");break;case"ArrowRight":e.preventDefault(),t<n.maxLength-1&&n.raiseEvent(t+1,"focus");break}}handlePaste(e){var C;e.preventDefault();const r=this._inputOtp;if(!r)return;const t=(((C=e.clipboardData)==null?void 0:C.getData("text"))??"").replace(/\D/g,"").split("").slice(0);if(t.length===0)return;const i=r.inputes.findIndex(b=>b.index===this.index),s=r.maxLength-i;t.splice(s);for(let b=0;b<t.length;b++){const w=i+b;if(w>=r.maxLength)break;r.inputes[w].value=t[b];const x=r.querySelector(`input[name="input-${w}"]`);x&&(x.value=t[b])}const m=i+t.length;m<r.maxLength&&r.raiseEvent(m,"focus")}createRenderRoot(){return this}render(){const e=this._inputOtp,r=(e==null?void 0:e.variant)==="with-spacing",n=(e==null?void 0:e.variant)==="combined",t={"rtg-h-[36px]":!0,"rtg-w-[36px]":!0,"rtg-text-center rtg-relative rtg-flex rtg-h-10 rtg-w-10 rtg-items-center rtg-justify-center rtg-border-y rtg-border-r rtg-border-input rtg-text-sm rtg-transition-all":!0,"first:rtg-rounded-l-md first:rtg-border-l":this.isFirst,"rtg-overflow-hidden":!0,"focus:rtg-border focus:rtg-border-[#c1c1c1] focus:rtg-border-[3px]":!0,"rtg-border":r||n,"rtg-border-t":!r||n,"rtg-border-b":!r||n,"rtg-border-r":!r||n,"rtg-border-l":this.isFirst||r||n,"first:rtg-rounded-l-md":!0,"last:rtg-rounded-r-md":!0,"rtg-rounded-none":(e==null?void 0:e.variant)==="with-separator"||(e==null?void 0:e.variant)==="combined","rtg-rounded-l-md":this.isFirst&&((e==null?void 0:e.variant)==="default"||(e==null?void 0:e.variant)==="with-spacing"),"rtg-rounded-r-md":this.isLast&&((e==null?void 0:e.variant)==="default"||(e==null?void 0:e.variant)==="with-spacing")};return d.html`
4429
4429
  <input
4430
4430
  part="input-otp-slot"
4431
4431
  auto-complete="one-time-code"
@@ -4454,7 +4454,7 @@ body {
4454
4454
  >
4455
4455
  ${fa()}
4456
4456
  </div>
4457
- `}},an([l.property({type:Number})],o.InputOtpSeparator.prototype,"index",2),o.InputOtpSeparator=an([l.customElement("rtg-input-otp-separator")],o.InputOtpSeparator);var Cd=Object.defineProperty,_d=Object.getOwnPropertyDescriptor,rt=(a,e,r,n)=>{for(var t=n>1?void 0:n?_d(e,r):e,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=(n?s(e,r,t):s(t))||t);return n&&t&&Cd(e,r,t),t};o.InputOtp=class extends h{constructor(){super(),this.maxLength=6,this.onChange=()=>{},this.pin=new Array(this.maxLength),this.variant="default",this.inputes=[]}connectedCallback(){super.connectedCallback()}getAttributesToExclude(){return[]}get _containerElement(){return this.querySelector("div[part=input-otp]")}raiseEvent(e,r="changes",n=1/0){const t=new CustomEvent("selected-input",{bubbles:!0,composed:!0,detail:{selectedItems:e,eventType:r,customIndex:n}});this.dispatchEvent(t)}createRenderRoot(){return this}firstUpdated(e){this.moveLightDomChildrenInto(this._containerElement),this.applyVariantStyles()}updated(e){e.has("variant")&&this.applyVariantStyles()}applyVariantStyles(){const e=this.querySelectorAll("rtg-input-otp-group");switch(this.querySelectorAll("rtg-input-otp-separator"),e.forEach(r=>{r.className="",r.classList.add("rtg-flex","rtg-items-center")}),this.variant){case"with-spacing":e.forEach(r=>r.classList.add("rtg-gap-2"));break;case"with-separator":break;case"combined":e.forEach(r=>r.classList.add("rtg-gap-2"));break}}render(){return d.html`
4457
+ `}},an([l.property({type:Number})],o.InputOtpSeparator.prototype,"index",2),o.InputOtpSeparator=an([l.customElement("rtg-input-otp-separator")],o.InputOtpSeparator);var Cd=Object.defineProperty,_d=Object.getOwnPropertyDescriptor,rt=(a,e,r,n)=>{for(var t=n>1?void 0:n?_d(e,r):e,i=a.length-1,s;i>=0;i--)(s=a[i])&&(t=(n?s(e,r,t):s(t))||t);return n&&t&&Cd(e,r,t),t};o.InputOtp=class extends h{constructor(){super(),this.maxLength=6,this.onChange=()=>{},this.pin=new Array(this.maxLength),this.variant="default",this.inputes=[]}connectedCallback(){super.connectedCallback()}getAttributesToExclude(){return[]}get _containerElement(){return this.querySelector("div[part=input-otp]")}raiseEvent(e,r="changes",n=1/0){const t=new CustomEvent("selected-input",{bubbles:!0,composed:!0,detail:{selectedItems:e,eventType:r,customIndex:n}});this.dispatchEvent(t)}createRenderRoot(){return this}firstUpdated(e){this.moveLightDomChildrenInto(this._containerElement),this.applyVariantStyles()}updated(e){e.has("variant")&&this.applyVariantStyles()}applyVariantStyles(){const e=this.querySelectorAll("rtg-input-otp-group");switch(e.forEach(r=>{r.className="",r.classList.add("rtg-flex","rtg-items-center")}),this.variant){case"with-spacing":e.forEach(r=>r.classList.add("rtg-gap-2"));break;case"with-separator":break;case"combined":e.forEach(r=>r.classList.add("rtg-gap-2"));break}}render(){return d.html`
4458
4458
  <div
4459
4459
  part="input-otp"
4460
4460
  class="${p("rtg-flex rtg-items-center",this.className)}"
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Webcomponent wc-ui following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "wc-ui",
6
- "version": "0.0.95",
6
+ "version": "0.0.96",
7
7
  "type": "module",
8
8
  "main": "dist/rtg-ui-kit.umd.cjs",
9
9
  "module": "./dist/rtg-ui-kit.js",