godown 3.11.0 → 3.11.2

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 (38) hide show
  1. package/build/godown+lit.iife.js +2 -2
  2. package/build/godown+lit.iife.js.map +1 -1
  3. package/build/godown+lit.js +2 -2
  4. package/build/godown+lit.js.map +1 -1
  5. package/build/godown+lit.umd.js +2 -2
  6. package/build/godown+lit.umd.js.map +1 -1
  7. package/build/godown.iife.js +2 -2
  8. package/build/godown.js +2 -2
  9. package/build/godown.js.map +1 -1
  10. package/build/godown.umd.js +2 -2
  11. package/build/godown.umd.js.map +1 -1
  12. package/package.json +2 -3
  13. package/src/web-components/alert/component.ts +1 -1
  14. package/src/web-components/badge/component.ts +4 -0
  15. package/src/web-components/button/component.ts +1 -1
  16. package/src/web-components/details/component.ts +1 -1
  17. package/src/web-components/input/component.ts +4 -6
  18. package/src/web-components/rotate/component.ts +0 -1
  19. package/src/web-components/skeleton/component.ts +1 -1
  20. package/src/web-components/tabs/component.ts +1 -1
  21. package/web-components/alert/component.js +1 -1
  22. package/web-components/badge/component.d.ts.map +1 -1
  23. package/web-components/badge/component.js +1 -1
  24. package/web-components/badge/component.js.map +1 -1
  25. package/web-components/button/component.js +1 -1
  26. package/web-components/details/component.js +1 -1
  27. package/web-components/details/component.js.map +1 -1
  28. package/web-components/input/component.d.ts.map +1 -1
  29. package/web-components/input/component.js +1 -1
  30. package/web-components/input/component.js.map +1 -1
  31. package/web-components/rotate/component.d.ts.map +1 -1
  32. package/web-components/rotate/component.js +1 -1
  33. package/web-components/rotate/component.js.map +1 -1
  34. package/web-components/skeleton/component.js +1 -1
  35. package/web-components/skeleton/component.js.map +1 -1
  36. package/web-components/tabs/component.js +1 -1
  37. package/web-components/tabs/component.js.map +1 -1
  38. package/web-types.json +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "godown",
3
- "version": "3.11.0",
3
+ "version": "3.11.2",
4
4
  "description": "Web Components Library",
5
5
  "type": "module",
6
6
  "main": "index.js",
@@ -20,7 +20,7 @@
20
20
  "fmtime": "^0.0.3",
21
21
  "lit": "^3.0.0",
22
22
  "tslib": "^2.7.0",
23
- "@godown/element": "^1.9.0"
23
+ "@godown/element": "^1.9.1"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public"
@@ -42,7 +42,6 @@
42
42
  "clean": "tsc --build tsconfig.prod.json --clean",
43
43
  "build": "tsx build.ts",
44
44
  "build:ts": "tsc",
45
- "fmt": "prettier src/**/* --write",
46
45
  "manifest": "tsx manifest.ts"
47
46
  }
48
47
  }
@@ -19,7 +19,6 @@ const protoName = "alert";
19
19
  @godown(protoName)
20
20
  @styles(css`
21
21
  :host {
22
- padding: 0.75em;
23
22
  background: var(${cssGlobalVars.background});
24
23
  }
25
24
 
@@ -29,6 +28,7 @@ const protoName = "alert";
29
28
  }
30
29
 
31
30
  [part="root"] {
31
+ padding: 0.75em;
32
32
  display: grid;
33
33
  align-items: center;
34
34
  grid-template-columns: auto 1fr auto;
@@ -16,6 +16,10 @@ const protoName = "badge";
16
16
  :host {
17
17
  font-size: 0.75em;
18
18
  }
19
+
20
+ [part="root"] {
21
+ padding: 0 0.5em;
22
+ }
19
23
  `)
20
24
  class Badge extends Button {
21
25
  plain: never = true as never;
@@ -43,7 +43,6 @@ const cssScope = scopePrefix(protoName);
43
43
  ${cssScope}--deg: 45deg;
44
44
  color: var(${cssGlobalVars.primaryForeground});
45
45
  background: var(${cssGlobalVars.primaryBackground});
46
- padding: 0.25em 0.75em;
47
46
  border-width: var(${cssGlobalVars.ringWidth});
48
47
  border-style: none;
49
48
  width: fit-content;
@@ -59,6 +58,7 @@ const cssScope = scopePrefix(protoName);
59
58
  }
60
59
 
61
60
  [part="root"] {
61
+ padding: 0.25em 0.75em;
62
62
  position: relative;
63
63
  user-select: none;
64
64
  }
@@ -23,12 +23,12 @@ const cssScope = scopePrefix(protoName);
23
23
  :host {
24
24
  ${cssScope}--icon-deg-open: 0deg;
25
25
  ${cssScope}--icon-deg-close: 90deg;
26
- padding: 0.2em;
27
26
  display: block;
28
27
  transition: 0.3s;
29
28
  }
30
29
 
31
30
  [part="root"] {
31
+ padding: 0.25em;
32
32
  position: relative;
33
33
  }
34
34
 
@@ -1,4 +1,4 @@
1
- import { attr, godown, queryPart, styles, htmlSlot, StyleController } from "@godown/element";
1
+ import { attr, godown, queryPart, styles, StyleController } from "@godown/element";
2
2
  import iconEyeSlash from "../../internal/icons/eye-slash.js";
3
3
  import { type TemplateResult, css, html, nothing } from "lit";
4
4
  import { property } from "lit/decorators.js";
@@ -21,13 +21,12 @@ const protoName = "input";
21
21
  :host {
22
22
  display: block;
23
23
  ${cssGlobalVars.input}-space: 0.2em;
24
- ${cssGlobalVars.input}-control: currentColor;
25
24
  ${cssGlobalVars.input}-icon-color: hsl(0, 0%, 50%);
26
25
  }
27
26
 
28
27
  :host(:focus-within),
29
28
  :host(:active) {
30
- ${cssGlobalVars.ringColor}: var(${cssGlobalVars.active});
29
+ ${cssGlobalVars.ringColor}: currentColor;
31
30
  ${cssGlobalVars.input}-icon-color: currentColor;
32
31
  }
33
32
 
@@ -37,15 +36,14 @@ const protoName = "input";
37
36
  position: relative;
38
37
  align-items: center;
39
38
  border-radius: inherit;
40
- height: inherit;
41
39
  }
42
40
 
43
41
  [part="input"] {
44
- background: none;
42
+ width: 100%;
45
43
  height: 100%;
46
44
  flex-grow: 1;
47
45
  color: currentColor;
48
- min-height: 1.5em;
46
+ background: none;
49
47
  }
50
48
 
51
49
  [part~="icon"] {
@@ -18,7 +18,6 @@ const cssScope = scopePrefix(protoName);
18
18
  width: -moz-fit-content;
19
19
  width: fit-content;
20
20
  transition: all 0.5s ease-in-out;
21
- ${cssScope}--padding: .75em;
22
21
  ${cssScope}--offset: .5em;
23
22
  }
24
23
 
@@ -21,7 +21,7 @@ const cssScope = scopePrefix(protoName);
21
21
  ${cssScope}--to: var(${cssGlobalVars.passive});
22
22
  ${cssScope}--deg: 95deg;
23
23
  ${cssScope}--duration: 2s;
24
- min-height: 1.5em;
24
+ height: 2em;
25
25
  width: 100%;
26
26
  flex-shrink: 0;
27
27
  overflow: hidden;
@@ -39,7 +39,6 @@ const mouseEnterAddedToken = "hover";
39
39
  :host {
40
40
  ${cssScope}--indicator-background: var(${cssGlobalVars.passive});
41
41
  ${cssScope}--space: 0.25em;
42
- padding: 0.2em;
43
42
  border-radius: var(${cssGlobalVars.radius});
44
43
  transition: 0.3s ease-in-out;
45
44
  width: fit-content;
@@ -48,6 +47,7 @@ const mouseEnterAddedToken = "hover";
48
47
  }
49
48
 
50
49
  [part="root"] {
50
+ padding: 0.2em;
51
51
  position: relative;
52
52
  z-index: 1;
53
53
  display: flex;
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as r,styles as o,StyleController as e,attr as i,htmlSlot as n}from"@godown/element";import{css as s,html as p}from"lit";import{property as a}from"lit/decorators.js";import{cssGlobalVars as d,GlobalStyle as l}from"../../internal/global-style.js";import{RingBuilder as c}from"../../internal/ring.js";let m=class Alert extends l{constructor(){super(),this.ringType="border",new e(this,(()=>new c({type:this.ringType}).css))}render(){return p`<div part="root" ${i(this.observedRecord)}> <div>${n("prefix")}</div> <div part="content"> <strong part="title">${this.title||n("title")}</strong> ${this.content||n()} </div> <div>${n("suffix")}</div> </div>`}static alert(t,r){const o=new this;return Object.assign(o,r),t.appendChild(o),o}};t([a({attribute:"ring-type"})],m.prototype,"ringType",void 0),t([a()],m.prototype,"title",void 0),t([a()],m.prototype,"content",void 0),m=t([r("alert"),o(s`:host{background:var(${d.background});padding:.75em}:host,:where(:host([contents]) [part=root]){display:block}[part=root]{align-items:center;grid-template-columns:auto 1fr auto;grid-template-rows:auto 1fr}[part=content],[part=root]{display:grid}`)],m);var g=m;export{m as Alert,g as default};
1
+ import{__decorate as t}from"tslib";import{godown as r,styles as o,StyleController as e,attr as i,htmlSlot as n}from"@godown/element";import{css as s,html as p}from"lit";import{property as a}from"lit/decorators.js";import{cssGlobalVars as d,GlobalStyle as l}from"../../internal/global-style.js";import{RingBuilder as c}from"../../internal/ring.js";let m=class Alert extends l{constructor(){super(),this.ringType="border",new e(this,(()=>new c({type:this.ringType}).css))}render(){return p`<div part="root" ${i(this.observedRecord)}> <div>${n("prefix")}</div> <div part="content"> <strong part="title">${this.title||n("title")}</strong> ${this.content||n()} </div> <div>${n("suffix")}</div> </div>`}static alert(t,r){const o=new this;return Object.assign(o,r),t.appendChild(o),o}};t([a({attribute:"ring-type"})],m.prototype,"ringType",void 0),t([a()],m.prototype,"title",void 0),t([a()],m.prototype,"content",void 0),m=t([r("alert"),o(s`:host{background:var(${d.background})}:host,:where(:host([contents]) [part=root]){display:block}[part=root]{align-items:center;grid-template-columns:auto 1fr auto;grid-template-rows:auto 1fr;padding:.75em}[part=content],[part=root]{display:grid}`)],m);var g=m;export{m as Alert,g as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/badge/component.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAK5C;;;;;GAKG;AACH,cAMM,KAAM,SAAQ,MAAM;IACxB,KAAK,EAAE,KAAK,CAAiB;IAC7B,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAQ;CAC/B;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/badge/component.ts"],"names":[],"mappings":"AAEA,OAAO,MAAM,MAAM,wBAAwB,CAAC;AAK5C;;;;;GAKG;AACH,cAUM,KAAM,SAAQ,MAAM;IACxB,KAAK,EAAE,KAAK,CAAiB;IAC7B,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,CAAQ;CAC/B;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as o,styles as e}from"@godown/element";import r from"../button/component.js";import{css as s}from"lit";let m=class Badge extends r{constructor(){super(...arguments),this.plain=!0,this.round=!0}};m=t([o("badge"),e(s`:host{font-size:.75em}`)],m);var i=m;export{m as Badge,i as default};
1
+ import{__decorate as t}from"tslib";import{godown as o,styles as r}from"@godown/element";import e from"../button/component.js";import{css as m}from"lit";let s=class Badge extends e{constructor(){super(...arguments),this.plain=!0,this.round=!0}};s=t([o("badge"),r(m`:host{font-size:.75em}[part=root]{padding:0 .5em}`)],s);var i=s;export{s as Badge,i as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/web-components/badge/component.ts"],"sourcesContent":null,"names":["Badge","Button","constructor","this","plain","round","__decorate","godown","styles","css"],"mappings":"wJAmBA,IAAMA,EAAN,MAAMA,cAAcC,EAApB,WAAAC,uBACEC,KAAKC,OAAU,EACfD,KAAKE,OAAoB,IAFrBL,EAAKM,EAAA,CANVC,EARiB,SASjBC,EAAOC,CAAG"}
1
+ {"version":3,"file":"component.js","sources":["../../src/web-components/badge/component.ts"],"sourcesContent":null,"names":["Badge","Button","constructor","this","plain","round","__decorate","godown","styles","css"],"mappings":"wJAuBA,IAAMA,EAAN,MAAMA,cAAcC,EAApB,WAAAC,uBACEC,KAAKC,OAAU,EACfD,KAAKE,OAAoB,IAFrBL,EAAKM,EAAA,CAVVC,EARiB,SASjBC,EAAOC,CAAG"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{queryPart as o,godown as e,styles as i,attr as r,htmlSlot as a}from"@godown/element";import{css as n,html as s}from"lit";import{property as d}from"lit/decorators.js";import{scopePrefix as l,cssGlobalVars as c,GlobalStyle as p}from"../../internal/global-style.js";const h="button",u=l(h);let m=class Button extends p{constructor(){super(...arguments),this.plain=!1,this.disabled=!1,this.active=!1,this.round=!1}render(){return s`<div part="root" ${r(this.observedRecord)}> ${this.content||a()} <span part="modal-root"></span> </div>`}focus(){this.disabled||(this.active=!0,super.focus())}blur(){this.active=!1,super.blur()}connectedCallback(){super.connectedCallback(),this.events.add(this,"click",this._handelClick,!0)}_handelClick(t){if(this.disabled)return t.stopPropagation(),void t.preventDefault();this.plain||this._handleModal(t)}_handleModal(t){const o=document.createElement("i"),{width:e,height:i}=this.getBoundingClientRect(),{x:r,y:a}=this._root.getBoundingClientRect(),n=2*Math.sqrt(i**2+e**2)+"px";o.style.height=n,o.style.width=n,o.style.left=t.x-r+"px",o.style.top=t.y-a+"px",o.style.animationName="kf",this._modalRoot.appendChild(o),o.addEventListener("animationend",(()=>o.remove()),{once:!0})}};t([d({type:Boolean,reflect:!0})],m.prototype,"plain",void 0),t([d({type:Boolean,reflect:!0})],m.prototype,"disabled",void 0),t([d({type:Boolean,reflect:!0})],m.prototype,"active",void 0),t([d({type:Boolean,reflect:!0})],m.prototype,"round",void 0),t([d()],m.prototype,"content",void 0),t([o("modal-root")],m.prototype,"_modalRoot",void 0),t([o("root")],m.prototype,"_root",void 0),m=t([e(h),i(n`:host(:not([disabled]):active){transform:scale(var(${u}--focus-scale))}:host([round]){border-radius:calc(infinity*1px)}:host([disabled]){cursor:not-allowed;filter:brightness(.85)}:host([plain]){${u}--gradients:unset;${u}--focus-scale:unset}`,n`:host{${u}--modal-animation-duration:1.5s;${u}--focus-scale:.97;${u}--deg:45deg;background:var(${c.primaryBackground});border-style:none;border-width:var(${c.ringWidth});color:var(${c.primaryForeground});cursor:pointer;display:block;overflow:hidden;padding:.25em .75em;text-align:center;width:-moz-fit-content;width:fit-content}[part=root]:not([contents]){height:100%;width:100%}[part=root]{position:relative;-webkit-user-select:none;user-select:none}i{animation-duration:var(${u}--modal-animation-duration);background:var(${u}--modal-background,currentColor);border-radius:50%;height:100%;inset:0;opacity:0;pointer-events:none;position:absolute;transform-origin:0 0;visibility:visible;width:100%}@keyframes kf{0%{opacity:var(${u}--modal-opacity,.1);transform:scale(0) translate(-50%,-50%)}80%{transform:scale(1) translate(-50%,-50%)}to{opacity:0}}`)],m);var v=m;export{m as Button,v as default};
1
+ import{__decorate as t}from"tslib";import{queryPart as o,godown as e,styles as i,attr as r,htmlSlot as a}from"@godown/element";import{css as n,html as s}from"lit";import{property as d}from"lit/decorators.js";import{scopePrefix as l,cssGlobalVars as c,GlobalStyle as p}from"../../internal/global-style.js";const h="button",u=l(h);let m=class Button extends p{constructor(){super(...arguments),this.plain=!1,this.disabled=!1,this.active=!1,this.round=!1}render(){return s`<div part="root" ${r(this.observedRecord)}> ${this.content||a()} <span part="modal-root"></span> </div>`}focus(){this.disabled||(this.active=!0,super.focus())}blur(){this.active=!1,super.blur()}connectedCallback(){super.connectedCallback(),this.events.add(this,"click",this._handelClick,!0)}_handelClick(t){if(this.disabled)return t.stopPropagation(),void t.preventDefault();this.plain||this._handleModal(t)}_handleModal(t){const o=document.createElement("i"),{width:e,height:i}=this.getBoundingClientRect(),{x:r,y:a}=this._root.getBoundingClientRect(),n=2*Math.sqrt(i**2+e**2)+"px";o.style.height=n,o.style.width=n,o.style.left=t.x-r+"px",o.style.top=t.y-a+"px",o.style.animationName="kf",this._modalRoot.appendChild(o),o.addEventListener("animationend",(()=>o.remove()),{once:!0})}};t([d({type:Boolean,reflect:!0})],m.prototype,"plain",void 0),t([d({type:Boolean,reflect:!0})],m.prototype,"disabled",void 0),t([d({type:Boolean,reflect:!0})],m.prototype,"active",void 0),t([d({type:Boolean,reflect:!0})],m.prototype,"round",void 0),t([d()],m.prototype,"content",void 0),t([o("modal-root")],m.prototype,"_modalRoot",void 0),t([o("root")],m.prototype,"_root",void 0),m=t([e(h),i(n`:host(:not([disabled]):active){transform:scale(var(${u}--focus-scale))}:host([round]){border-radius:calc(infinity*1px)}:host([disabled]){cursor:not-allowed;filter:brightness(.85)}:host([plain]){${u}--gradients:unset;${u}--focus-scale:unset}`,n`:host{${u}--modal-animation-duration:1.5s;${u}--focus-scale:.97;${u}--deg:45deg;background:var(${c.primaryBackground});border-style:none;border-width:var(${c.ringWidth});color:var(${c.primaryForeground});cursor:pointer;display:block;overflow:hidden;text-align:center;width:-moz-fit-content;width:fit-content}[part=root]:not([contents]){height:100%;width:100%}[part=root]{padding:.25em .75em;position:relative;-webkit-user-select:none;user-select:none}i{animation-duration:var(${u}--modal-animation-duration);background:var(${u}--modal-background,currentColor);border-radius:50%;height:100%;inset:0;opacity:0;pointer-events:none;position:absolute;transform-origin:0 0;visibility:visible;width:100%}@keyframes kf{0%{opacity:var(${u}--modal-opacity,.1);transform:scale(0) translate(-50%,-50%)}80%{transform:scale(1) translate(-50%,-50%)}to{opacity:0}}`)],m);var v=m;export{m as Button,v as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as i,styles as o,attr as e,htmlSlot as r}from"@godown/element";import a from"../../internal/icons/caret-down.js";import{css as s,html as l}from"lit";import{property as n}from"lit/decorators.js";import{scopePrefix as p}from"../../internal/global-style.js";import d from"../../internal/super-openable.js";const m="details",c=p(m);let f=class Details extends d{constructor(){super(...arguments),this.float=!1,this.fill=!1,this.summary=""}render(){return l`<dl part="root" ${e(this.observedRecord)}> <dt part="title" @click="${()=>this.toggle()}"> <span part="summary">${this.summary||r("summary")}</span> <span part="icon">${a()}</span> </dt> <dd part="details" @click=${this.fill?()=>this.toggle():null}> <div style="min-height: 0;">${r()}</div> </dd> </dl>`}};t([n({type:Boolean})],f.prototype,"float",void 0),t([n({type:Boolean})],f.prototype,"fill",void 0),t([n()],f.prototype,"summary",void 0),f=t([i(m),o(s`:host{${c}--icon-deg-open:0deg;${c}--icon-deg-close:90deg;display:block;padding:.2em;transition:.3s}[part=root]{position:relative}[part=title]{align-items:center;direction:ltr;grid-template-columns:auto auto;height:100%;justify-content:space-between}[part=details],[part=title]{display:grid;overflow:hidden;transition:inherit}[part=details]{grid-template-rows:0fr}:host([open]) [part=details]{grid-template-rows:1fr}[float] [part=details]{position:absolute;top:100%;width:100%}[part]{transition:inherit;transition-property:transform,grid-template-rows}[part=icon]{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:flex;transform:rotate(var(${c}--icon-deg-close))}:host([open]) [part=icon]{transform:rotate(var(${c}--icon-deg-open))}`)],f);var g=f;export{f as Details,g as default};
1
+ import{__decorate as t}from"tslib";import{godown as i,styles as o,attr as e,htmlSlot as r}from"@godown/element";import a from"../../internal/icons/caret-down.js";import{css as s,html as l}from"lit";import{property as n}from"lit/decorators.js";import{scopePrefix as p}from"../../internal/global-style.js";import d from"../../internal/super-openable.js";const m="details",c=p(m);let f=class Details extends d{constructor(){super(...arguments),this.float=!1,this.fill=!1,this.summary=""}render(){return l`<dl part="root" ${e(this.observedRecord)}> <dt part="title" @click="${()=>this.toggle()}"> <span part="summary">${this.summary||r("summary")}</span> <span part="icon">${a()}</span> </dt> <dd part="details" @click=${this.fill?()=>this.toggle():null}> <div style="min-height: 0;">${r()}</div> </dd> </dl>`}};t([n({type:Boolean})],f.prototype,"float",void 0),t([n({type:Boolean})],f.prototype,"fill",void 0),t([n()],f.prototype,"summary",void 0),f=t([i(m),o(s`:host{${c}--icon-deg-open:0deg;${c}--icon-deg-close:90deg;display:block;transition:.3s}[part=root]{padding:.25em;position:relative}[part=title]{align-items:center;direction:ltr;grid-template-columns:auto auto;height:100%;justify-content:space-between}[part=details],[part=title]{display:grid;overflow:hidden;transition:inherit}[part=details]{grid-template-rows:0fr}:host([open]) [part=details]{grid-template-rows:1fr}[float] [part=details]{position:absolute;top:100%;width:100%}[part]{transition:inherit;transition-property:transform,grid-template-rows}[part=icon]{-webkit-backface-visibility:hidden;backface-visibility:hidden;display:flex;transform:rotate(var(${c}--icon-deg-close))}:host([open]) [part=icon]{transform:rotate(var(${c}--icon-deg-open))}`)],f);var g=f;export{f as Details,g as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/web-components/details/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Details","SuperOpenable","constructor","this","float","fill","summary","render","html","attr","observedRecord","toggle","htmlSlot","svgCaretDown","__decorate","property","type","Boolean","styles","css","Details$1"],"mappings":"gWAQA,MAAMA,EAAY,UAEZC,EAAWC,EAAYF,GAmE7B,IAAMG,EAAN,MAAMA,gBAAgBC,EAAtB,WAAAC,uBAKEC,KAAKC,OAAG,EAMRD,KAAIE,MAAG,EAMPF,KAAOG,QAAG,GAEA,MAAAC,GACR,OAAOC,CAAI,mBAAAC,EAAAN,KAAAO,6CAAA,IAAAP,KAAAQ,mCAAAR,KAAAG,SAAAM,EAAA,uCAAAC,8CAAAV,KAAAE,KAAA,IAAAF,KAAAQ,SAAA,qCAAAC,0BAGLE,EAAA,mDAIUC,EAAA,CAAAC,KAAAC,sCAEaH,EAAA,CACHC,6CAIXG,EAAAC,CAAA,SAAKrB,yBAAiCA,qnBAAAA,sEAAAA,2BAEjB,IAAAsB,EAAApB"}
1
+ {"version":3,"file":"component.js","sources":["../../src/web-components/details/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Details","SuperOpenable","constructor","this","float","fill","summary","render","html","attr","observedRecord","toggle","htmlSlot","svgCaretDown","__decorate","property","type","Boolean","styles","css","Details$1"],"mappings":"gWAQA,MAAMA,EAAY,UAEZC,EAAWC,EAAYF,GAmE7B,IAAMG,EAAN,MAAMA,gBAAgBC,EAAtB,WAAAC,uBAKEC,KAAKC,OAAG,EAMRD,KAAIE,MAAG,EAMPF,KAAOG,QAAG,GAEA,MAAAC,GACR,OAAOC,CAAI,mBAAAC,EAAAN,KAAAO,6CAAA,IAAAP,KAAAQ,mCAAAR,KAAAG,SAAAM,EAAA,uCAAAC,8CAAAV,KAAAE,KAAA,IAAAF,KAAAQ,SAAA,qCAAAC,0BAGLE,EAAA,mDAIUC,EAAA,CAAAC,KAAAC,sCAEaH,EAAA,CACHC,6CAIXG,EAAAC,CAAA,SAAKrB,yBAAiCA,snBAAAA,sEAAAA,2BAEjB,IAAAsB,EAAApB"}
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/input/component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,KAAK,CAAC;AAI9D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAK3D;;;;;;GAMG;AACH,cAqDM,KAAM,SAAQ,UAAU;IAC5B,IAAI,EACA,MAAM,GACN,QAAQ,GACR,KAAK,GACL,KAAK,GACL,OAAO,GACP,UAAU,GACV,QAAQ,GACR,MAAM,GACN,MAAM,GACN,gBAAgB,GAChB,OAAO,GACP,MAAM,CAAU;IAEpB,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IAEH,OAAO,EAAE,SAAS,GAAG,SAAS,CAAa;IAG3C,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAC;;IAYnC,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IA4BrC,SAAS,CAAC,aAAa,IAAI,cAAc,CAAC,CAAC,CAAC;CAgB7C;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/input/component.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,cAAc,EAAsB,MAAM,KAAK,CAAC;AAI9D,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAK3D;;;;;;GAMG;AACH,cAmDM,KAAM,SAAQ,UAAU;IAC5B,IAAI,EACA,MAAM,GACN,QAAQ,GACR,KAAK,GACL,KAAK,GACL,OAAO,GACP,UAAU,GACV,QAAQ,GACR,MAAM,GACN,MAAM,GACN,gBAAgB,GAChB,OAAO,GACP,MAAM,CAAU;IAEpB,KAAK,EAAE,MAAM,CAAC;IAEd;;OAEG;IAEH,OAAO,EAAE,SAAS,GAAG,SAAS,CAAa;IAG3C,SAAS,CAAC,MAAM,EAAE,gBAAgB,CAAC;;IAYnC,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IA4BrC,SAAS,CAAC,aAAa,IAAI,cAAc,CAAC,CAAC,CAAC;CAgB7C;AAED,eAAe,KAAK,CAAC;AACrB,OAAO,EAAE,KAAK,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{queryPart as e,godown as i,styles as r,StyleController as o,attr as n}from"@godown/element";import a from"../../internal/icons/eye-slash.js";import{css as p,nothing as s,html as l}from"lit";import{property as u}from"lit/decorators.js";import{cssGlobalVars as c}from"../../internal/global-style.js";import{SuperInput as h}from"../../internal/super-input.js";import{RingBuilder as d}from"../../internal/ring.js";let f=class Input extends h{constructor(){super(),this.type="text",this.variant="default",new o(this,(()=>new d({type:this.ringType}).css+("outline"===this.variant?`:host{${c.ringColor}:currentColor}`:"")))}render(){return l`<label part="root" ${n(this.observedRecord)}> ${[this._renderPrefix(),l`<input part="input" type="${this.type}" .value="${this.value}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||s}" autocomplete="${this.autocomplete||s}" placeholder="${this.placeholder||s}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,this._renderSuffix()]} </label>`}_renderSuffix(){const t="password";return this.type===t?l`<i part="suffix icon" @mousedown="${()=>this._changeInputType("text")}" @mouseup="${()=>this._changeInputType(t)}" @mouseleave="${()=>this._changeInputType(t)}"> ${a()} </i>`:super._renderSuffix()}};t([u()],f.prototype,"variant",void 0),t([e("input")],f.prototype,"_input",void 0),f=t([i("input"),r(p`:host{display:block;${c.input}-space:0.2em;${c.input}-control:currentColor;${c.input}-icon-color:grey}:host(:active),:host(:focus-within){${c.ringColor}:var(${c.active});${c.input}-icon-color:currentColor}[part~=root]{align-items:center;border-radius:inherit;display:flex;height:inherit;padding:.4em .5em;position:relative}[part=input]{background:none;color:currentColor;flex-grow:1;height:100%;min-height:1.5em}[part~=icon]{align-items:center;color:var(${c.input}-icon-color);display:flex;justify-content:center}[part~=prefix],[part~=suffix]{display:flex;height:100%}[part~=suffix][part~=icon]{padding-inline-start:var(${c.input}-space)}[part~=prefix][part~=icon]{padding-inline-end:var(${c.input}-space)}`)],f);var m=f;export{f as Input,m as default};
1
+ import{__decorate as t}from"tslib";import{queryPart as e,godown as i,styles as r,StyleController as o,attr as n}from"@godown/element";import a from"../../internal/icons/eye-slash.js";import{css as p,nothing as s,html as l}from"lit";import{property as u}from"lit/decorators.js";import{cssGlobalVars as c}from"../../internal/global-style.js";import{SuperInput as h}from"../../internal/super-input.js";import{RingBuilder as d}from"../../internal/ring.js";let f=class Input extends h{constructor(){super(),this.type="text",this.variant="default",new o(this,(()=>new d({type:this.ringType}).css+("outline"===this.variant?`:host{${c.ringColor}:currentColor}`:"")))}render(){return l`<label part="root" ${n(this.observedRecord)}> ${[this._renderPrefix(),l`<input part="input" type="${this.type}" .value="${this.value}" ?autofocus="${this.autofocus}" ?disabled="${this.disabled}" autocapitalize="${this.autocapitalize||s}" autocomplete="${this.autocomplete||s}" placeholder="${this.placeholder||s}" @input="${this._handleInput}" @change="${this._handleChange}"/>`,this._renderSuffix()]} </label>`}_renderSuffix(){const t="password";return this.type===t?l`<i part="suffix icon" @mousedown="${()=>this._changeInputType("text")}" @mouseup="${()=>this._changeInputType(t)}" @mouseleave="${()=>this._changeInputType(t)}"> ${a()} </i>`:super._renderSuffix()}};t([u()],f.prototype,"variant",void 0),t([e("input")],f.prototype,"_input",void 0),f=t([i("input"),r(p`:host{display:block;${c.input}-space:0.2em;${c.input}-icon-color:grey}:host(:active),:host(:focus-within){${c.ringColor}:currentColor;${c.input}-icon-color:currentColor}[part~=root]{align-items:center;border-radius:inherit;display:flex;padding:.4em .5em;position:relative}[part=input]{background:none;color:currentColor;flex-grow:1;height:100%;width:100%}[part~=icon]{align-items:center;color:var(${c.input}-icon-color);display:flex;justify-content:center}[part~=prefix],[part~=suffix]{display:flex;height:100%}[part~=suffix][part~=icon]{padding-inline-start:var(${c.input}-space)}[part~=prefix][part~=icon]{padding-inline-end:var(${c.input}-space)}`)],f);var m=f;export{f as Input,m as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/web-components/input/component.ts"],"sourcesContent":null,"names":["Input","SuperInput","constructor","super","this","type","variant","StyleController","RingBuilder","ringType","css","cssGlobalVars","ringColor","render","html","attr","observedRecord","_renderSuffix","PASSWORD","__decorate","queryPart","styles","input","active"],"mappings":"ocAuEA,IAAMA,EAAN,MAAMA,cAAcC,EA0BlB,WAAAC,GACEC,QA1BFC,KAAIC,KAYS,OAQbD,KAAOE,QAA0B,UAO/B,IAAIC,EACFH,MACA,IACE,IAAII,EAAY,CAAEH,KAAMD,KAAKK,WAAYC,KACvB,YAAjBN,KAAKE,QAAwB,SAASK,EAAcC,0BAA4B,MAI7E,MAAAC,GACR,OAAOC,CAAI,sBAAAC,EAAAX,KAAAY,oBAAA,2UAGLZ,KAAKa,2BAEL,iBAEA,MAAAC,EAAI,iNAIUf,MAAAc,eACI,sCAIK,GACTE,EAAA,CACCC,EAAA,uCAEdpB,EAAAmB,EAAA,GAvHO,SAyHTE,EAAAX,CAAA,uBAAAC,EAAAW,qBAAAX,EAAAW,8BAAAX,EAAAW,6DAAAX,EAAAC,iBAAAD,EAAAY,WAAAZ,EAAAW,0RAAAX,EAAAW,oKAAAX,EAAAW,kEAAAX,EAAAW,2BAEJtB"}
1
+ {"version":3,"file":"component.js","sources":["../../src/web-components/input/component.ts"],"sourcesContent":null,"names":["Input","SuperInput","constructor","super","this","type","variant","StyleController","RingBuilder","ringType","css","cssGlobalVars","ringColor","render","html","attr","observedRecord","_renderSuffix","PASSWORD","__decorate","queryPart","styles","input"],"mappings":"ocAqEA,IAAMA,EAAN,MAAMA,cAAcC,EA0BlB,WAAAC,GACEC,QA1BFC,KAAIC,KAYS,OAQbD,KAAOE,QAA0B,UAO/B,IAAIC,EACFH,MACA,IACE,IAAII,EAAY,CAAEH,KAAMD,KAAKK,WAAYC,KACvB,YAAjBN,KAAKE,QAAwB,SAASK,EAAcC,0BAA4B,MAI7E,MAAAC,GACR,OAAOC,CAAI,sBAAAC,EAAAX,KAAAY,oBAAA,2UAGLZ,KAAKa,2BAEL,iBAEA,MAAAC,EAAI,iNAIUf,MAAAc,eACI,sCAIK,GACTE,EAAA,CACCC,EAAA,uCAEdpB,EAAAmB,EAAA,GArHO,SAuHTE,EAAAX,CAAA,uBAAAC,EAAAW,qBAAAX,EAAAW,6DAAAX,EAAAC,0BAAAD,EAAAW,qQAAAX,EAAAW,oKAAAX,EAAAW,kEAAAX,EAAAW,2BAEJtB"}
@@ -1 +1 @@
1
- {"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/rotate/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAErD,OAAO,EAAE,WAAW,EAAe,MAAM,gCAAgC,CAAC;AAK1E;;;;GAIG;AACH,cA+BM,MAAO,SAAQ,WAAW;IAE9B,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC;IAE7B,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAcrC,KAAK,IAAI,IAAI;IAKb,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAM5C;;;;;;;;;OASG;IACH,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,UAAU,GAAG;QACvC,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB;CAUF;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
1
+ {"version":3,"file":"component.d.ts","sourceRoot":"__source__/","sources":["web-components/rotate/component.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAErD,OAAO,EAAE,WAAW,EAAe,MAAM,gCAAgC,CAAC;AAK1E;;;;GAIG;AACH,cA8BM,MAAO,SAAQ,WAAW;IAE9B,SAAS,CAAC,KAAK,EAAE,WAAW,CAAC;IAE7B,SAAS,CAAC,MAAM,IAAI,cAAc,CAAC,CAAC,CAAC;IAcrC,KAAK,IAAI,IAAI;IAKb,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,UAAU,GAAG,IAAI;IAM5C;;;;;;;;;OASG;IACH,SAAS,CAAC,cAAc,CAAC,CAAC,EAAE,UAAU,GAAG;QACvC,OAAO,EAAE,MAAM,CAAC;QAChB,OAAO,EAAE,MAAM,CAAC;KACjB;CAUF;AAED,eAAe,MAAM,CAAC;AACtB,OAAO,EAAE,MAAM,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{queryPart as o,godown as e,styles as r,htmlSlot as i}from"@godown/element";import{css as s,html as n}from"lit";import{scopePrefix as a,GlobalStyle as l}from"../../internal/global-style.js";const d="rotate",p=a(d);let m=class Rotate extends l{render(){return n`<div part="root"> <div part="slot" @mousemove="${this._handleRotate}"> ${i()} </div> <i @mouseleave="${this.reset}"></i> </div>`}reset(){this._root.style.removeProperty("transform"),this._root.style.removeProperty("transition")}_handleRotate(t){const{rotateX:o,rotateY:e}=this._computeOffset(t);this._root.style.setProperty("transform",`rotateX(${o}rad) rotateY(${e}rad)`),this._root.style.setProperty("transition","0s")}_computeOffset(t){const{left:o,top:e,width:r,height:i}=this._root.getBoundingClientRect(),{clientX:s,clientY:n}=t;return{rotateX:-(n-e-i/2)/i/2,rotateY:(s-o-r/2)/r/2}}};t([o("root")],m.prototype,"_root",void 0),m=t([e(d),r(s`:host{display:block;transition:all .5s ease-in-out;width:-moz-fit-content;width:fit-content;${p}--padding:.75em;${p}--offset:.5em}div{position:relative;transition:inherit;transition-property:transform}i{box-sizing:content-box;height:100%;margin:calc(var(${p}--offset)*-1);padding:var(${p}--offset);position:absolute;top:0;width:100%}[part=slot]{z-index:2}`)],m);var f=m;export{m as Rotate,f as default};
1
+ import{__decorate as t}from"tslib";import{queryPart as o,godown as e,styles as r,htmlSlot as i}from"@godown/element";import{css as s,html as n}from"lit";import{scopePrefix as a,GlobalStyle as l}from"../../internal/global-style.js";const p="rotate",d=a(p);let m=class Rotate extends l{render(){return n`<div part="root"> <div part="slot" @mousemove="${this._handleRotate}"> ${i()} </div> <i @mouseleave="${this.reset}"></i> </div>`}reset(){this._root.style.removeProperty("transform"),this._root.style.removeProperty("transition")}_handleRotate(t){const{rotateX:o,rotateY:e}=this._computeOffset(t);this._root.style.setProperty("transform",`rotateX(${o}rad) rotateY(${e}rad)`),this._root.style.setProperty("transition","0s")}_computeOffset(t){const{left:o,top:e,width:r,height:i}=this._root.getBoundingClientRect(),{clientX:s,clientY:n}=t;return{rotateX:-(n-e-i/2)/i/2,rotateY:(s-o-r/2)/r/2}}};t([o("root")],m.prototype,"_root",void 0),m=t([e(p),r(s`:host{display:block;transition:all .5s ease-in-out;width:-moz-fit-content;width:fit-content;${d}--offset:.5em}div{position:relative;transition:inherit;transition-property:transform}i{box-sizing:content-box;height:100%;margin:calc(var(${d}--offset)*-1);padding:var(${d}--offset);position:absolute;top:0;width:100%}[part=slot]{z-index:2}`)],m);var f=m;export{m as Rotate,f as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/web-components/rotate/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Rotate","GlobalStyle","render","html","this","_handleRotate","htmlSlot","reset","_root","style","removeProperty","e","setProperty","rotateX","rotateY","_computeOffset","__decorate","queryPart","prototype","godown","styles","css","Rotate$1"],"mappings":"uOAKA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAsC7B,IAAMG,EAAN,MAAMA,eAAeC,EAIT,MAAAC,GACR,OAAOC,CAAI,kDAAAC,KAAAC,mBAAAC,8BAAAF,KAAAG,0EAISH,KAAAI,MAAAC,MAAAC,eAAkB,cAE9B,aAAAL,CAAAM,qDAEcP,KAAAI,MAAAC,MAAAG,YAAU,YAAA,WAAAC,iBAAAC,yDAgBlC,cAAAC,CAAAJ,0JAUUK,EAAA,CAIRC,EAAM,SACNjB,EAAAkB,UAAe,gBACflB,EAAAgB,EAAa,CACbG,EAAAtB,GAEAuB,EAAAC,CAAa,+FAAuCvB,oBAAAA,8IAAAA,8BAAAA,yEACpDE,GACA,IAAAsB,EAAOtB"}
1
+ {"version":3,"file":"component.js","sources":["../../src/web-components/rotate/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Rotate","GlobalStyle","render","html","this","_handleRotate","htmlSlot","reset","_root","style","removeProperty","e","setProperty","rotateX","rotateY","_computeOffset","__decorate","queryPart","prototype","godown","styles","css","Rotate$1"],"mappings":"uOAKA,MAAMA,EAAY,SACZC,EAAWC,EAAYF,GAqC7B,IAAMG,EAAN,MAAMA,eAAeC,EAIT,MAAAC,GACR,OAAOC,CAAI,kDAAAC,KAAAC,mBAAAC,8BAAAF,KAAAG,0EAISH,KAAAI,MAAAC,MAAAC,eAAkB,cAE9B,aAAAL,CAAAM,qDAEcP,KAAAI,MAAAC,MAAAG,YAAU,YAAA,WAAAC,iBAAAC,yDAgBlC,cAAAC,CAAAJ,0JAUUK,EAAA,CAIRC,EAAM,SACNjB,EAAAkB,UAAe,gBACflB,EAAAgB,EAAa,CACbG,EAAAtB,GAEAuB,EAAAC,CAAa,+FAAuCvB,8IAAAA,8BAAAA,yEACpDE,GACA,IAAAsB,EAAOtB"}
@@ -1,2 +1,2 @@
1
- import{__decorate as o}from"tslib";import{godown as r,styles as t,htmlSlot as n}from"@godown/element";import{css as i,html as e}from"lit";import{state as a}from"lit/decorators.js";import{scopePrefix as s,cssGlobalVars as d,GlobalStyle as l}from"../../internal/global-style.js";const g="skeleton",m=s(g);let p=class Skeleton extends l{constructor(){super(...arguments),this.loading=!0}render(){return this.loading?e`<div part="root">${n("loading")}</div>`:n()}};o([a()],p.prototype,"loading",void 0),p=o([r(g),t(i`:host{${m}--from:var(${d.background});${m}--to:var(${d.passive});${m}--deg:95deg;${m}--duration:2s;animation:_ var(${m}--duration) ease-in-out infinite none running;background-color:transparent;background-image:linear-gradient(var(${m}--deg),var(${m}--from) 36%,var(${m}--to) 50%,var(${m}--from) 64%);background-size:200% 100%;flex-shrink:0;min-height:1.5em;overflow:hidden;width:100%}@keyframes _{0%{background-position:150%}to{background-position:-50%}}[part=root]{display:contents}:host,:host([contents]) [part=root]{display:block}`)],p);var c=p;export{p as Skeleton,c as default};
1
+ import{__decorate as o}from"tslib";import{godown as r,styles as t,htmlSlot as n}from"@godown/element";import{css as e,html as i}from"lit";import{state as a}from"lit/decorators.js";import{scopePrefix as s,cssGlobalVars as d,GlobalStyle as l}from"../../internal/global-style.js";const g="skeleton",m=s(g);let p=class Skeleton extends l{constructor(){super(...arguments),this.loading=!0}render(){return this.loading?i`<div part="root">${n("loading")}</div>`:n()}};o([a()],p.prototype,"loading",void 0),p=o([r(g),t(e`:host{${m}--from:var(${d.background});${m}--to:var(${d.passive});${m}--deg:95deg;${m}--duration:2s;animation:_ var(${m}--duration) ease-in-out infinite none running;background-color:transparent;background-image:linear-gradient(var(${m}--deg),var(${m}--from) 36%,var(${m}--to) 50%,var(${m}--from) 64%);background-size:200% 100%;flex-shrink:0;height:2em;overflow:hidden;width:100%}@keyframes _{0%{background-position:150%}to{background-position:-50%}}[part=root]{display:contents}:host,:host([contents]) [part=root]{display:block}`)],p);var c=p;export{p as Skeleton,c as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/web-components/skeleton/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Skeleton","GlobalStyle","constructor","this","loading","render","html","htmlSlot","state","prototype","__decorate","godown","styles","css","cssGlobalVars","background","passive"],"mappings":"qRAMA,MAAMA,EAAY,WACZC,EAAWC,EAAYF,GAiD7B,IAAMG,EAAN,MAAMA,iBAAiBC,EAAvB,WAAAC,uBAKEC,KAAOC,SAAG,EAEA,MAAAC,GACR,OAAKF,KAAKC,QAGHE,CAAI,oBAAAC,EAAA,mBAFFA,QAKX,CACDC,KAVCR,EAAAS,UAAA,eAAA,GADCT,EAAOU,EAAA,CACOC,EAAAd,GALHe,EAAAC,CAAA,SAAAf,eAAAgB,EAAAC,eAAAjB,aAAAgB,EAAAE,YAAAlB,gBAAAA,kCAAAA,oHAAAA,eAAAA,oBAAAA,kBAAAA,qQAvCHE"}
1
+ {"version":3,"file":"component.js","sources":["../../src/web-components/skeleton/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","Skeleton","GlobalStyle","constructor","this","loading","render","html","htmlSlot","state","prototype","__decorate","godown","styles","css","cssGlobalVars","background","passive"],"mappings":"qRAMA,MAAMA,EAAY,WACZC,EAAWC,EAAYF,GAiD7B,IAAMG,EAAN,MAAMA,iBAAiBC,EAAvB,WAAAC,uBAKEC,KAAOC,SAAG,EAEA,MAAAC,GACR,OAAKF,KAAKC,QAGHE,CAAI,oBAAAC,EAAA,mBAFFA,QAKX,CACDC,KAVCR,EAAAS,UAAA,eAAA,GADCT,EAAOU,EAAA,CACOC,EAAAd,GALHe,EAAAC,CAAA,SAAAf,eAAAgB,EAAAC,eAAAjB,aAAAgB,EAAAE,YAAAlB,gBAAAA,kCAAAA,oHAAAA,eAAAA,oBAAAA,kBAAAA,+PAvCHE"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{godown as i,styles as e,StyleController as r,attr as o,tokenList as n,htmlSlot as s}from"@godown/element";import{scopePrefix as a,cssGlobalVars as d,GlobalStyle as p}from"../../internal/global-style.js";import{css as l,html as c}from"lit";import{property as h,queryAll as u}from"lit/decorators.js";import{RingBuilder as m}from"../../internal/ring.js";const v="tabs",y=a(v),x="hover";let b=class Tabs extends p{constructor(){super(),this.ringType="border",this.useSlot=!1,this.index=0,new r(this,(()=>new m({type:this.ringType}).css))}render(){return c`<ul part="root" ${o(this.observedRecord)} @mouseleave="${this._handleMouseLeave}"> ${this.tabs?.map(((t,i)=>t||this.useSlot?c`<li part="${n("item",{selected:this.index===i})}" @mouseenter=${()=>{this.move(this._lastIndex,i),this._lastIndex=i}} @click=${()=>this.select(i)}> ${this.useSlot?s(t):t} <div part="indicator"></div> </li>`:""))} </ul>`}connectedCallback(){super.connectedCallback(),this._lastIndex=this.index}_handleMouseLeave(){const t=this._items[this._lastIndex];t&&t.part.remove(x),this._lastIndex=this.index}move(t,i){if(t===i)return;const{_items:e,_indicators:r}=this,o=e[i];if(!o)return;o.part.add(x);const n=e[t];if(!n)return;n.part.remove(x);const s=r[i],a=r[t];if(!s||!a)return;const d=a.getBoundingClientRect(),p=o.getBoundingClientRect(),l=d.x-p.x,c=d.y-p.y,h=d.width,{style:u}=s;u.transform=`translate3d(${l}px,${c}px,0)`,u.width=h+"px",u.transition=a.style.transition="none",s.getBoundingClientRect(),u.width=u.transform=u.transition=a.style.transition=""}select(t){const{index:i,tabs:e,_lastIndex:r,useSlot:o}=this;e&&i!==t&&t in e&&(this.dispatchCustomEvent("select",t),this.move(r,t),this._lastIndex=t,i in e&&(e[i]||o)&&(this.index=t))}};t([h({attribute:"ring-type"})],b.prototype,"ringType",void 0),t([h({type:Boolean})],b.prototype,"useSlot",void 0),t([h({type:Array})],b.prototype,"tabs",void 0),t([h({type:Number})],b.prototype,"index",void 0),t([u("[part~=item]")],b.prototype,"_items",void 0),t([u("[part=indicator]")],b.prototype,"_indicators",void 0),b=t([i(v),e(l`:host{${y}--indicator-background:var(${d.passive});${y}--space:0.25em;border-radius:var(${d.radius});cursor:default;display:flex;padding:.2em;transition:.3s ease-in-out;width:-moz-fit-content;width:fit-content}[part=root]{border-radius:inherit;display:flex;flex-direction:inherit;gap:var(${y}--space);overflow-x:clip;position:relative;transition:inherit;transition-property:width,transform,opacity;z-index:1}[useslot] [part~=item]{padding:0}[part~=item]{display:block;padding:0 .25em;position:relative;white-space:nowrap}[part=indicator],[part~=item]{border-radius:inherit;transition:inherit;transition-property:inherit;width:100%}[part=indicator]{background:var(${y}--indicator-background);height:100%;inset:0;opacity:0;position:absolute;z-index:-1}[part~=selected]{background:var(${y}--indicator-background)}[part~=hover] [part=indicator],[part~=selected] [part=indicator]{opacity:1}`)],b);var g=b;export{b as Tabs,g as default};
1
+ import{__decorate as t}from"tslib";import{godown as i,styles as e,StyleController as r,attr as o,tokenList as n,htmlSlot as s}from"@godown/element";import{scopePrefix as a,cssGlobalVars as d,GlobalStyle as p}from"../../internal/global-style.js";import{css as l,html as c}from"lit";import{property as h,queryAll as u}from"lit/decorators.js";import{RingBuilder as m}from"../../internal/ring.js";const v="tabs",y=a(v),x="hover";let b=class Tabs extends p{constructor(){super(),this.ringType="border",this.useSlot=!1,this.index=0,new r(this,(()=>new m({type:this.ringType}).css))}render(){return c`<ul part="root" ${o(this.observedRecord)} @mouseleave="${this._handleMouseLeave}"> ${this.tabs?.map(((t,i)=>t||this.useSlot?c`<li part="${n("item",{selected:this.index===i})}" @mouseenter=${()=>{this.move(this._lastIndex,i),this._lastIndex=i}} @click=${()=>this.select(i)}> ${this.useSlot?s(t):t} <div part="indicator"></div> </li>`:""))} </ul>`}connectedCallback(){super.connectedCallback(),this._lastIndex=this.index}_handleMouseLeave(){const t=this._items[this._lastIndex];t&&t.part.remove(x),this._lastIndex=this.index}move(t,i){if(t===i)return;const{_items:e,_indicators:r}=this,o=e[i];if(!o)return;o.part.add(x);const n=e[t];if(!n)return;n.part.remove(x);const s=r[i],a=r[t];if(!s||!a)return;const d=a.getBoundingClientRect(),p=o.getBoundingClientRect(),l=d.x-p.x,c=d.y-p.y,h=d.width,{style:u}=s;u.transform=`translate3d(${l}px,${c}px,0)`,u.width=h+"px",u.transition=a.style.transition="none",s.getBoundingClientRect(),u.width=u.transform=u.transition=a.style.transition=""}select(t){const{index:i,tabs:e,_lastIndex:r,useSlot:o}=this;e&&i!==t&&t in e&&(this.dispatchCustomEvent("select",t),this.move(r,t),this._lastIndex=t,i in e&&(e[i]||o)&&(this.index=t))}};t([h({attribute:"ring-type"})],b.prototype,"ringType",void 0),t([h({type:Boolean})],b.prototype,"useSlot",void 0),t([h({type:Array})],b.prototype,"tabs",void 0),t([h({type:Number})],b.prototype,"index",void 0),t([u("[part~=item]")],b.prototype,"_items",void 0),t([u("[part=indicator]")],b.prototype,"_indicators",void 0),b=t([i(v),e(l`:host{${y}--indicator-background:var(${d.passive});${y}--space:0.25em;border-radius:var(${d.radius});cursor:default;display:flex;transition:.3s ease-in-out;width:-moz-fit-content;width:fit-content}[part=root]{border-radius:inherit;display:flex;flex-direction:inherit;gap:var(${y}--space);overflow-x:clip;padding:.2em;position:relative;transition:inherit;transition-property:width,transform,opacity;z-index:1}[useslot] [part~=item]{padding:0}[part~=item]{display:block;padding:0 .25em;position:relative;white-space:nowrap}[part=indicator],[part~=item]{border-radius:inherit;transition:inherit;transition-property:inherit;width:100%}[part=indicator]{background:var(${y}--indicator-background);height:100%;inset:0;opacity:0;position:absolute;z-index:-1}[part~=selected]{background:var(${y}--indicator-background)}[part~=hover] [part=indicator],[part~=selected] [part=indicator]{opacity:1}`)],b);var g=b;export{b as Tabs,g as default};
2
2
  //# sourceMappingURL=component.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sources":["../../src/web-components/tabs/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","mouseEnterAddedToken","Tabs","GlobalStyle","constructor","super","this","ringType","useSlot","index","StyleController","RingBuilder","type","css","render","html","attr","observedRecord","_handleMouseLeave","tabs","map","tab","move","_lastIndex","select","htmlSlot","connectedCallback","lastItem","_items","part","remove","from","to","_indicators","toItem","add","fromItem","toIndicator","fromIndicator","fromIndicatorRect","getBoundingClientRect","toItemRect","transformX","x","transformY","y","fromWidth","width","style","transform","transition","selected","dispatchCustomEvent","attribute","prototype","property","Boolean","__decorate","Array","queryAll","godown","styles","cssGlobalVars","passive","radius","Tabs$1"],"mappings":"yYAMA,MAAMA,EAAY,OACZC,EAAWC,EAAYF,GAEvBG,EAAuB,QAyF7B,IAAMC,EAAN,MAAMA,aAAaC,EA8BjB,WAAAC,GACEC,QA7BFC,KAAQC,SAAa,SAMrBD,KAAOE,SAAG,EAYVF,KAAKG,MAAG,EAYN,IAAIC,EAAgBJ,MAAM,IAAM,IAAIK,EAAY,CAAEC,KAAMN,KAAKC,WAAYM,MAG3E,MAAAC,GACE,OAAOC,CAAI,mBAAAC,EAAAV,KAAAW,gCAAAX,KAAAY,uBAAAZ,KAAAa,MAAAC,KAAA,CAAAC,EAAAZ,IAAAY,GAAAf,KAAAE,0EAGK,KACGF,KAAAgB,KAAAhB,KAAsBiB,WAAAd,gCAErB,IAAKH,KAAOkB,OAC1Bf,OAAYH,KAAOE,QAAAiB,EAAAJ,GAAAA,uCACf,iCAGMhB,MAAAqB,yBACDH,WAACjB,KAAAG,KACY,qBAEZ,MAAAkB,EAAKrB,KAAAsB,OAAatB,KAAKiB,YACzBI,GACSA,EAAAE,KAAAC,OAAM7B,GAEbK,KAAAiB,WAAKjB,KAAAG,gBAGV,GAAAsB,IAAAC,EACH,OAGP,MAAAJ,OAAAA,EAAAK,YAAAA,GAAA3B,KACH4B,EAAAN,EAAAI,GAEiB,IAAAE,EACV,OAEPA,EAAAL,KAAAM,IAAAlC,GAE2B,MAAAmC,EAAAR,EAAAG,GACzB,IAAMK,EACF,OAEJA,EAAAP,KAAAC,OAAA7B,GACA,MAAeoC,EAAOJ,EAAMD,GAC9BM,EAAAL,EAAAF,GAEI,IAAaM,IAAYC,EACvB,OAEJ,MAAAC,EAAAD,EAAAE,wBACMC,4BACAC,EAASH,EAAUI,EAAAF,EAAAE,EACdC,EAAEL,EAAAM,EAAAJ,EAAAI,EACJC,EAAAP,EAAAQ,OACTC,MAAAA,GAAAX,EAEAW,EAAMC,UAAW,eAAYP,OAAAE,SAC7BI,EAAaD,MAAAD,EAAE,OACNI,WAAAZ,EAAAU,MAAAE,WAHO,OAIhBb,EAAAG,wBACAQ,EAAAD,MAAcC,EAAMC,UAACD,EAAAE,WAAqBZ,EAAAU,MAAAE,WAAA,EAC1C,CACA,MAAA1B,CAAA2B,GACA,MAAgB1C,MAAAA,EAAAU,KAAAA,EAAAI,WAAKA,EAAAf,QAAAA,GAAeF,KAC3Ba,GAAAV,IAAA0C,GAAAA,KAAAhC,IAGTb,KAAA8C,oBAAyB,SAACD,GAC1B7C,KAAMgB,KAAAC,EAA8B4B,GACpC7C,KAAMiB,aACNd,KAAeU,IAAoBA,EAAAV,SAEnCH,KAAQG,MAAO0C,QAKV,GAEM,CAAAE,UAAsB,eAEjCnD,EAAAoD,UAAW,gBAAS,KACtB,CAEAC,EAAuB,CAAA3C,KAAA4C,aACrBF,UAAa,eAAkB,GAC/BG,EAAA,GACS,CAAA7C,KAAA8C,WACTJ,UAAA,YAAA,GACAG,EAAA,CACAF,EAAK,CAAI3C,eACTV,EAAAoD,UAAK,aAAa,GAClBG,EAAA,CACEE,EAAA,mBACFL,UAAA,cAAA,KACF,CACDK,EAAA,qBA9HCzD,EAAAoD,UAAA,mBAAA,GADCpD,EAAAuD,EAAW,CACkBG,EAAA9D,GAM9B+D,EAAAhD,CAAA,SAAAd,+BAAA+D,EAAAC,YAAAhE,qCAAA+D,EAAAE,sMAAAjE,uXAAAA,uHAAAA,yGADCG,GACe,IAAA+D,EAAA/D"}
1
+ {"version":3,"file":"component.js","sources":["../../src/web-components/tabs/component.ts"],"sourcesContent":null,"names":["protoName","cssScope","scopePrefix","mouseEnterAddedToken","Tabs","GlobalStyle","constructor","super","this","ringType","useSlot","index","StyleController","RingBuilder","type","css","render","html","attr","observedRecord","_handleMouseLeave","tabs","map","tab","move","_lastIndex","select","htmlSlot","connectedCallback","lastItem","_items","part","remove","from","to","_indicators","toItem","add","fromItem","toIndicator","fromIndicator","fromIndicatorRect","getBoundingClientRect","toItemRect","transformX","x","transformY","y","fromWidth","width","style","transform","transition","selected","dispatchCustomEvent","attribute","prototype","property","Boolean","__decorate","Array","queryAll","godown","styles","cssGlobalVars","passive","radius","Tabs$1"],"mappings":"yYAMA,MAAMA,EAAY,OACZC,EAAWC,EAAYF,GAEvBG,EAAuB,QAyF7B,IAAMC,EAAN,MAAMA,aAAaC,EA8BjB,WAAAC,GACEC,QA7BFC,KAAQC,SAAa,SAMrBD,KAAOE,SAAG,EAYVF,KAAKG,MAAG,EAYN,IAAIC,EAAgBJ,MAAM,IAAM,IAAIK,EAAY,CAAEC,KAAMN,KAAKC,WAAYM,MAG3E,MAAAC,GACE,OAAOC,CAAI,mBAAAC,EAAAV,KAAAW,gCAAAX,KAAAY,uBAAAZ,KAAAa,MAAAC,KAAA,CAAAC,EAAAZ,IAAAY,GAAAf,KAAAE,0EAGK,KACGF,KAAAgB,KAAAhB,KAAsBiB,WAAAd,gCAErB,IAAKH,KAAOkB,OAC1Bf,OAAYH,KAAOE,QAAAiB,EAAAJ,GAAAA,uCACf,iCAGMhB,MAAAqB,yBACDH,WAACjB,KAAAG,KACY,qBAEZ,MAAAkB,EAAKrB,KAAAsB,OAAatB,KAAKiB,YACzBI,GACSA,EAAAE,KAAAC,OAAM7B,GAEbK,KAAAiB,WAAKjB,KAAAG,gBAGV,GAAAsB,IAAAC,EACH,OAGP,MAAAJ,OAAAA,EAAAK,YAAAA,GAAA3B,KACH4B,EAAAN,EAAAI,GAEiB,IAAAE,EACV,OAEPA,EAAAL,KAAAM,IAAAlC,GAE2B,MAAAmC,EAAAR,EAAAG,GACzB,IAAMK,EACF,OAEJA,EAAAP,KAAAC,OAAA7B,GACA,MAAeoC,EAAOJ,EAAMD,GAC9BM,EAAAL,EAAAF,GAEI,IAAaM,IAAYC,EACvB,OAEJ,MAAAC,EAAAD,EAAAE,wBACMC,4BACAC,EAASH,EAAUI,EAAAF,EAAAE,EACdC,EAAEL,EAAAM,EAAAJ,EAAAI,EACJC,EAAAP,EAAAQ,OACTC,MAAAA,GAAAX,EAEAW,EAAMC,UAAW,eAAYP,OAAAE,SAC7BI,EAAaD,MAAAD,EAAE,OACNI,WAAAZ,EAAAU,MAAAE,WAHO,OAIhBb,EAAAG,wBACAQ,EAAAD,MAAcC,EAAMC,UAACD,EAAAE,WAAqBZ,EAAAU,MAAAE,WAAA,EAC1C,CACA,MAAA1B,CAAA2B,GACA,MAAgB1C,MAAAA,EAAAU,KAAAA,EAAAI,WAAKA,EAAAf,QAAAA,GAAeF,KAC3Ba,GAAAV,IAAA0C,GAAAA,KAAAhC,IAGTb,KAAA8C,oBAAyB,SAACD,GAC1B7C,KAAMgB,KAAAC,EAA8B4B,GACpC7C,KAAMiB,aACNd,KAAeU,IAAoBA,EAAAV,SAEnCH,KAAQG,MAAO0C,QAKV,GAEM,CAAAE,UAAsB,eAEjCnD,EAAAoD,UAAW,gBAAS,KACtB,CAEAC,EAAuB,CAAA3C,KAAA4C,aACrBF,UAAa,eAAkB,GAC/BG,EAAA,GACS,CAAA7C,KAAA8C,WACTJ,UAAA,YAAA,GACAG,EAAA,CACAF,EAAK,CAAI3C,eACTV,EAAAoD,UAAK,aAAa,GAClBG,EAAA,CACEE,EAAA,mBACFL,UAAA,cAAA,KACF,CACDK,EAAA,qBA9HCzD,EAAAoD,UAAA,mBAAA,GADCpD,EAAAuD,EAAW,CACkBG,EAAA9D,GAM9B+D,EAAAhD,CAAA,SAAAd,+BAAA+D,EAAAC,YAAAhE,qCAAA+D,EAAAE,yLAAAjE,oYAAAA,uHAAAA,yGADCG,GACe,IAAA+D,EAAA/D"}