godown 3.11.1 → 3.12.0

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 (60) hide show
  1. package/build/godown+lit.iife.js +11 -11
  2. package/build/godown+lit.iife.js.map +1 -1
  3. package/build/godown+lit.js +5 -5
  4. package/build/godown+lit.js.map +1 -1
  5. package/build/godown+lit.umd.js +11 -11
  6. package/build/godown+lit.umd.js.map +1 -1
  7. package/build/godown.iife.js +5 -4
  8. package/build/godown.iife.js.map +1 -0
  9. package/build/godown.js +7 -7
  10. package/build/godown.js.map +1 -1
  11. package/build/godown.umd.js +3 -3
  12. package/build/godown.umd.js.map +1 -1
  13. package/custom-elements.json +1 -1
  14. package/internal/global-style.js +1 -1
  15. package/internal/super-input.d.ts +0 -3
  16. package/internal/super-input.d.ts.map +1 -1
  17. package/internal/super-input.js +1 -1
  18. package/internal/super-input.js.map +1 -1
  19. package/package.json +2 -2
  20. package/src/internal/global-style.ts +1 -1
  21. package/src/internal/super-input.ts +0 -31
  22. package/src/web-components/alert/component.ts +2 -2
  23. package/src/web-components/button/component.ts +20 -18
  24. package/src/web-components/details/component.ts +1 -1
  25. package/src/web-components/dialog/component.ts +1 -0
  26. package/src/web-components/input/component.ts +37 -27
  27. package/src/web-components/layout/component.ts +1 -0
  28. package/src/web-components/text/component.ts +47 -52
  29. package/src/web-components/time/component.ts +5 -15
  30. package/src/web-components/tooltip/component.ts +6 -5
  31. package/vscode.html-custom-data.json +1 -1
  32. package/web-components/alert/component.js +1 -1
  33. package/web-components/alert/component.js.map +1 -1
  34. package/web-components/button/component.d.ts.map +1 -1
  35. package/web-components/button/component.js +1 -1
  36. package/web-components/button/component.js.map +1 -1
  37. package/web-components/details/component.js +1 -1
  38. package/web-components/details/component.js.map +1 -1
  39. package/web-components/dialog/component.d.ts.map +1 -1
  40. package/web-components/dialog/component.js +1 -1
  41. package/web-components/dialog/component.js.map +1 -1
  42. package/web-components/input/component.d.ts +3 -1
  43. package/web-components/input/component.d.ts.map +1 -1
  44. package/web-components/input/component.js +1 -1
  45. package/web-components/input/component.js.map +1 -1
  46. package/web-components/layout/component.d.ts.map +1 -1
  47. package/web-components/layout/component.js +1 -1
  48. package/web-components/layout/component.js.map +1 -1
  49. package/web-components/text/component.d.ts +4 -7
  50. package/web-components/text/component.d.ts.map +1 -1
  51. package/web-components/text/component.js +1 -1
  52. package/web-components/text/component.js.map +1 -1
  53. package/web-components/time/component.d.ts +2 -2
  54. package/web-components/time/component.d.ts.map +1 -1
  55. package/web-components/time/component.js +1 -1
  56. package/web-components/time/component.js.map +1 -1
  57. package/web-components/tooltip/component.d.ts.map +1 -1
  58. package/web-components/tooltip/component.js +1 -1
  59. package/web-components/tooltip/component.js.map +1 -1
  60. package/web-types.json +1 -1
@@ -1,2 +1,2 @@
1
- import{trim as r,declareLightDarkColors as o,joinRules as t,joinDeclarations as e,toVar as n,GodownElement as i}from"@godown/element";import{unsafeCSS as a,css as s}from"lit";class GlobalStyle extends i{}const d=r(GlobalStyle.godownConfig.prefix,"-");function l(r,o=1){return u(d+"-".repeat(o)+r)}function u(r){return a(`--${r}`)}const g={background:l("background",2),foreground:l("foreground",2),backgroundClip:l("background-clip",2),primaryBackground:l("primary",2),primaryForeground:l("primary-foreground",2),muted:l("muted",2),active:l("active",2),passive:l("passive",2),input:l("input",2),radius:l("radius",2),ringWidth:l("ring-width",2),ringColor:l("ring-color",2)};GlobalStyle.styles=[a(o(":host",[[g.background,["hsl(0 0% 96%)","hsl(0 0% 4%)"]],[g.foreground,["hsl(0 0% 4%)","hsl(0 0% 96%)"]],[g.muted,["hsl(0 0% 90%)","hsl(0 0% 18%)"]]],1)),a(t({":host":e([[g.primaryBackground,n(g.foreground)],[g.primaryForeground,n(g.background)],[g.active,n(g.primaryBackground)],[g.passive,n(g.muted)],[g.backgroundClip,`linear-gradient(to bottom, ${n(g.foreground)}, ${n(g.muted)})`],[g.ringColor,n(g.passive)],[g.ringWidth,".075em"]])})),s`button,dialog,input{border:0;outline:0}*{box-sizing:border-box;font-size:100%;font-style:normal;margin:0;padding:0}:host{border-style:none;box-sizing:border-box;outline-style:none}a{text-decoration:none}span{white-space:nowrap}svg{-webkit-user-select:none;user-select:none}:host([contents]){display:contents}[part=root]{height:100%;width:100%}:host([contents]) [part=root]{height:inherit;width:inherit}:where(:host([contents]) [part=root]){all:inherit;display:revert}`,s`:host{${g.radius}:0.2em;border-radius:var(${g.radius})}`];export{GlobalStyle,g as cssGlobalVars,GlobalStyle as default,l as scopePrefix,u as variablePrefix};
1
+ import{trim as r,declareLightDarkColors as o,joinRules as t,joinDeclarations as e,toVar as n,GodownElement as i}from"@godown/element";import{unsafeCSS as a,css as s}from"lit";class GlobalStyle extends i{}const d=r(GlobalStyle.godownConfig.prefix,"-");function l(r,o=1){return u(d+"-".repeat(o)+r)}function u(r){return a(`--${r}`)}const g={background:l("background",2),foreground:l("foreground",2),backgroundClip:l("background-clip",2),primaryBackground:l("primary",2),primaryForeground:l("primary-foreground",2),muted:l("muted",2),active:l("active",2),passive:l("passive",2),input:l("input",2),radius:l("radius",2),ringWidth:l("ring-width",2),ringColor:l("ring-color",2)};GlobalStyle.styles=[a(o(":host",[[g.background,["hsl(0 0% 96%)","hsl(0 0% 4%)"]],[g.foreground,["hsl(0 0% 4%)","hsl(0 0% 96%)"]],[g.muted,["hsl(0 0% 88%)","hsl(0 0% 18%)"]]],1)),a(t({":host":e([[g.primaryBackground,n(g.foreground)],[g.primaryForeground,n(g.background)],[g.active,n(g.primaryBackground)],[g.passive,n(g.muted)],[g.backgroundClip,`linear-gradient(to bottom, ${n(g.foreground)}, ${n(g.muted)})`],[g.ringColor,n(g.passive)],[g.ringWidth,".075em"]])})),s`button,dialog,input{border:0;outline:0}*{box-sizing:border-box;font-size:100%;font-style:normal;margin:0;padding:0}:host{border-style:none;box-sizing:border-box;outline-style:none}a{text-decoration:none}span{white-space:nowrap}svg{-webkit-user-select:none;user-select:none}:host([contents]){display:contents}[part=root]{height:100%;width:100%}:host([contents]) [part=root]{height:inherit;width:inherit}:where(:host([contents]) [part=root]){all:inherit;display:revert}`,s`:host{${g.radius}:0.2em;border-radius:var(${g.radius})}`];export{GlobalStyle,g as cssGlobalVars,GlobalStyle as default,l as scopePrefix,u as variablePrefix};
2
2
  //# sourceMappingURL=global-style.js.map
@@ -7,7 +7,6 @@ declare class SuperInput<V = string> extends GlobalStyle {
7
7
  autocomplete: string | boolean;
8
8
  ringType: RingType;
9
9
  disabled: boolean;
10
- type: InputType;
11
10
  placeholder: string;
12
11
  name: string;
13
12
  value: V;
@@ -32,7 +31,6 @@ declare class SuperInput<V = string> extends GlobalStyle {
32
31
  connectedCallback(): void;
33
32
  protected _connectedInit(): void;
34
33
  protected _compositionInit(): void;
35
- protected _changeInputType(t: typeof this.type): void;
36
34
  focus(options?: FocusOptions): void;
37
35
  protected firstUpdated(): void;
38
36
  protected _renderPrefix(): TemplateResult<1>;
@@ -40,5 +38,4 @@ declare class SuperInput<V = string> extends GlobalStyle {
40
38
  }
41
39
  export default SuperInput;
42
40
  export { SuperInput };
43
- type InputType = "hidden" | "text" | "search" | "tel" | "url" | "email" | "password" | "datetime" | "date" | "month" | "week" | "time" | "datetime-local" | "number" | "range" | "color" | "checkbox" | "radio" | "file" | "image";
44
41
  //# sourceMappingURL=super-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"super-input.d.ts","sourceRoot":"__source__/","sources":["internal/super-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAqC,MAAM,iBAAiB,CAAC;AACvF,OAAO,EAAE,KAAK,cAAc,EAAa,MAAM,KAAK,CAAC;AAGrD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAkB1C,cACM,UAAU,CAAC,CAAC,GAAG,MAAM,CAAE,SAAQ,WAAW;IAC9C,SAAS,UAAS;IAElB,YAAY,EAAE,MAAM,G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IAE/D,SAAS,IAAI,CAAC,MAAM,EAAE,GAAG,CAAC;IAI1B,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAkB;IAEhD,KAAK,IAAI,IAAI;IAKb,SAAS,CAAC,YAAY,CAAC,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAS/D,SAAS,CAAC,aAAa,CAAC,CAAC,EAAE,YAAY,CAAC,gBAAgB,CAAC,GAAG,IAAI;IAIhE,iBAAiB,IAAI,IAAI;IAKzB,SAAS,CAAC,cAAc,IAAI,IAAI;IAKhC,SAAS,CAAC,gBAAgB,IAAI,IAAI;IAUlC,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY,GAAG,IAAI;IAInC,SAAS,CAAC,YAAY,IAAI,IAAI;IAI9B,SAAS,CAAC,aAAa,IAAI,cAAc,CAAC,CAAC,CAAC;IAM5C,SAAS,CAAC,aAAa,IAAI,cAAc,CAAC,CAAC,CAAC;CAK7C;AAED,eAAe,UAAU,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,CAAC"}
@@ -1,2 +1,2 @@
1
- import{__decorate as t}from"tslib";import{queryPart as e,styles as i,omit as o,htmlSlot as s}from"@godown/element";import{css as r,html as n}from"lit";import{property as a}from"lit/decorators.js";import{GlobalStyle as p}from"./global-style.js";const u=r`:host([disabled]){cursor:not-allowed;filter:brightness(.85)}input:disabled{cursor:inherit}input::-ms-clear,input::-ms-reveal{display:none}`;let l=class SuperInput extends p{constructor(){super(...arguments),this.autofocus=!1,this.ringType="border",this.disabled=!1,this.compositing=!1,this.makeId=Math.random().toString(36).slice(1),this.nameValue=this.namevalue}get observedRecord(){return o(super.observedRecord,"default","value")}set defaultValue(t){this.default=t}get defaultValue(){return this.default}namevalue(){return[this.name,this.value]}reset(){this.value=this.default,this._input.value=this.default}_handleInput(t){t.stopPropagation(),this.compositing||(this.value=t.target.value?.trim(),this.dispatchCustomEvent("input",this.value,{bubbles:!0}))}_handleChange(t){this.dispatchCustomEvent("change",this.value)}connectedCallback(){super.connectedCallback(),this._connectedInit()}_connectedInit(){this.default??=this.value||"",this.value??=this.default}_compositionInit(){this._input&&(this.events.add(this._input,"compositionstart",(()=>this.compositing=!0)),this.events.add(this._input,"compositionend",(t=>{this.compositing=!1,this._handleInput(t)})))}_changeInputType(t){this._input&&(this._input.type=t)}focus(t){this._input?.focus(t)}firstUpdated(){this._compositionInit()}_renderPrefix(){return n`<i part="prefix">${s("prefix")}</i>`}_renderSuffix(){return n`<i part="suffix">${s("suffix")}</i>`}};t([a()],l.prototype,"autocomplete",void 0),t([a({attribute:"ring-type"})],l.prototype,"ringType",void 0),t([a({type:Boolean,reflect:!0})],l.prototype,"disabled",void 0),t([a({reflect:!0})],l.prototype,"type",void 0),t([a({reflect:!0})],l.prototype,"placeholder",void 0),t([a({reflect:!0})],l.prototype,"name",void 0),t([a()],l.prototype,"value",void 0),t([a()],l.prototype,"default",void 0),t([e("input")],l.prototype,"_input",void 0),l=t([i(u)],l);var d=l;export{l as SuperInput,d as default};
1
+ import{__decorate as t}from"tslib";import{queryPart as e,styles as i,omit as o,htmlSlot as s}from"@godown/element";import{css as r,html as a}from"lit";import{property as n}from"lit/decorators.js";import{GlobalStyle as u}from"./global-style.js";const p=r`:host([disabled]){cursor:not-allowed;filter:brightness(.85)}input:disabled{cursor:inherit}input::-ms-clear,input::-ms-reveal{display:none}`;let l=class SuperInput extends u{constructor(){super(...arguments),this.autofocus=!1,this.ringType="border",this.disabled=!1,this.compositing=!1,this.makeId=Math.random().toString(36).slice(1),this.nameValue=this.namevalue}get observedRecord(){return o(super.observedRecord,"default","value")}set defaultValue(t){this.default=t}get defaultValue(){return this.default}namevalue(){return[this.name,this.value]}reset(){this.value=this.default,this._input.value=this.default}_handleInput(t){t.stopPropagation(),this.compositing||(this.value=t.target.value?.trim(),this.dispatchCustomEvent("input",this.value,{bubbles:!0}))}_handleChange(t){this.dispatchCustomEvent("change",this.value)}connectedCallback(){super.connectedCallback(),this._connectedInit()}_connectedInit(){this.default??=this.value||"",this.value??=this.default}_compositionInit(){this._input&&(this.events.add(this._input,"compositionstart",(()=>this.compositing=!0)),this.events.add(this._input,"compositionend",(t=>{this.compositing=!1,this._handleInput(t)})))}focus(t){this._input?.focus(t)}firstUpdated(){this._compositionInit()}_renderPrefix(){return a`<i part="prefix">${s("prefix")}</i>`}_renderSuffix(){return a`<i part="suffix">${s("suffix")}</i>`}};t([n()],l.prototype,"autocomplete",void 0),t([n({attribute:"ring-type"})],l.prototype,"ringType",void 0),t([n({type:Boolean,reflect:!0})],l.prototype,"disabled",void 0),t([n({reflect:!0})],l.prototype,"placeholder",void 0),t([n({reflect:!0})],l.prototype,"name",void 0),t([n()],l.prototype,"value",void 0),t([n()],l.prototype,"default",void 0),t([e("input")],l.prototype,"_input",void 0),l=t([i(p)],l);var d=l;export{l as SuperInput,d as default};
2
2
  //# sourceMappingURL=super-input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"super-input.js","sources":["../src/internal/super-input.ts"],"sourcesContent":null,"names":["inputStyle","css","observedRecord","omit","super","this","default","value","defaultValue","namevalue","name","reset","_input","_handleInput","e","stopPropagation","compositing","target","trim","dispatchCustomEvent","bubbles","connectedCallback","_connectedInit","events","add","_changeInputType","t","type","focus","options","firstUpdated","_compositionInit","_renderPrefix","html","htmlSlot","_renderSuffix","property","SuperInput","prototype","attribute","Boolean","reflect","__decorate","queryPart","styles","SuperInput$1"],"mappings":"oPAOA,MAAMA,EAAaC,CAAG,4WAcpB,kBAAAC,GAGc,OAAAC,EAAVC,MAAAF,eAA+B,UAAW,QAAhD,qBACEG,KAASC,QAAAC,kBAQTC,GA2BA,OAAAH,KAAAC,QAEG,SAAAG,GACH,MAAW,CAAAJ,KAAAK,KAAGL,KAAKE,MAUT,CAMV,KAAAI,GAiEDN,KAAAE,MAAAF,KAAAC,QAjGKD,KAAcO,OAAAL,MAAAF,KAAAC,QAElB,YAAAO,CAACC,GAgBGA,EAAAC,kBACEV,KAACW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,"names":["inputStyle","css","observedRecord","omit","super","this","default","value","defaultValue","namevalue","name","reset","_input","_handleInput","e","stopPropagation","compositing","target","trim","dispatchCustomEvent","bubbles","connectedCallback","_connectedInit","events","add","focus","options","firstUpdated","_compositionInit","_renderPrefix","html","_renderSuffix","htmlSlot","property","SuperInput","prototype","attribute","type","Boolean","reflect","__decorate","queryPart","styles","SuperInput$1"],"mappings":"oPAOA,MAAMA,EAAaC,CAAG,4WAcpB,kBAAAC,GAGc,OAAAC,EAAVC,MAAAF,eAA+B,UAAW,QAAhD,qBACEG,KAASC,QAAAC,kBAQTC,GAwBA,OAAAH,KAAAC,QAEG,SAAAG,GACH,MAAW,CAAAJ,KAAAK,KAAGL,KAAKE,MAUT,CAMV,KAAAI,GA2DDN,KAAAE,MAAAF,KAAAC,QA3FKD,KAAcO,OAAAL,MAAAF,KAAAC,QAElB,YAAAO,CAACC,GAgBGA,EAAAC,kBACEV,KAACW,cAILX,KAAOE,MAAKO,EAAAG,OAAQV,OAAAW,OACrBb,KAAAc,oBAAA,QAAAd,KAAAE,MAAA,CAAAa,SAAA,sBAMAf,KAAAc,oBAAA,SAAAd,KAAAE,OAKC,iBAAAc,GACAjB,0BACDC,KAAAiB,gBAES,kBAERjB,KAAQC,UAAYD,KAAEE,OAAC,QACdA,QAAAF,KAAAC,2BAGLD,KAACO,SACNP,KAAAkB,OAAAC,IAAAnB,KAAAO,OAAA,oBAAA,IAAAP,KAAAW,aAAA,IAESX,KAAakB,OAAkCC,IAAAnB,KAAAO,OAAA,kBAAAE,sBAC9B,EAC1BT,KAAAQ,aAAAC,EAAA,KAKD,KAAAW,CAACC,GAEuBrB,KAAAO,QAAAa,MAAAC,GAEtB,YAAAC,GACDtB,KAAAuB,mBAGC,aAAAC,UACMC,sCACJ,CACE,aAAAC,GACA,OAAAD,CAAA,oBAAAE,EAAA,eACF,KAEH,CAEDC,KACEC,EAAAC,UAAA,oBAAA,MAGQF,EAAY,CAAAG,UAAA,iBACfD,UAAA,gBAAA,KACN,CAESF,EAAa,CAAAI,KAAAC,QAAAC,SAAA,KACrBL,EAAAC,UAAW,gBAAA,QAET,CAAAI,SAAA,OACHJ,UAAA,mBAAA,KAEsB,CACrBF,EAAA,CAAAM,SAAA,iBACqB,YAAQ,KAC3B,CACJN,KACDC,EAAAC,UAAA,aAAA,GA5GCK,EAAA,CADCP,KAC8BC,EAAAC,UAAA,eAAA,GAG/BK,EAAA,CADCC,EAAA,UAC6BP,EAAAC,UAAA,cAAA,GAG9BD,EAAAM,EAAA,CADCE,EAAQ1C,IACQkC,GAGjB,IAAAS,EAAAT"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "godown",
3
- "version": "3.11.1",
3
+ "version": "3.12.0",
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.10.0"
24
24
  },
25
25
  "publishConfig": {
26
26
  "access": "public"
@@ -49,7 +49,7 @@ GlobalStyle.styles = [
49
49
  [
50
50
  [cssGlobalVars.background, ["hsl(0 0% 96%)", "hsl(0 0% 4%)"]],
51
51
  [cssGlobalVars.foreground, ["hsl(0 0% 4%)", "hsl(0 0% 96%)"]],
52
- [cssGlobalVars.muted, ["hsl(0 0% 90%)", "hsl(0 0% 18%)"]],
52
+ [cssGlobalVars.muted, ["hsl(0 0% 88%)", "hsl(0 0% 18%)"]],
53
53
  ],
54
54
  1,
55
55
  ),
@@ -33,9 +33,6 @@ class SuperInput<V = string> extends GlobalStyle {
33
33
  @property({ type: Boolean, reflect: true })
34
34
  disabled = false;
35
35
 
36
- @property({ reflect: true })
37
- type: InputType;
38
-
39
36
  @property({ reflect: true })
40
37
  placeholder: string;
41
38
 
@@ -117,12 +114,6 @@ class SuperInput<V = string> extends GlobalStyle {
117
114
  }
118
115
  }
119
116
 
120
- protected _changeInputType(t: typeof this.type): void {
121
- if (this._input) {
122
- this._input.type = t;
123
- }
124
- }
125
-
126
117
  focus(options?: FocusOptions): void {
127
118
  this._input?.focus(options);
128
119
  }
@@ -146,25 +137,3 @@ class SuperInput<V = string> extends GlobalStyle {
146
137
 
147
138
  export default SuperInput;
148
139
  export { SuperInput };
149
-
150
- type InputType =
151
- | "hidden"
152
- | "text"
153
- | "search"
154
- | "tel"
155
- | "url"
156
- | "email"
157
- | "password"
158
- | "datetime"
159
- | "date"
160
- | "month"
161
- | "week"
162
- | "time"
163
- | "datetime-local"
164
- | "number"
165
- | "range"
166
- | "color"
167
- | "checkbox"
168
- | "radio"
169
- | "file"
170
- | "image";
@@ -68,8 +68,8 @@ class Alert extends GlobalStyle {
68
68
  >
69
69
  <div>${htmlSlot("prefix")}</div>
70
70
  <div part="content">
71
- <strong part="title">${this.title || htmlSlot("title")}</strong>
72
- ${this.content || htmlSlot()}
71
+ <strong part="title">${htmlSlot("title", this.title)}</strong>
72
+ ${htmlSlot("", this.content)}
73
73
  </div>
74
74
  <div>${htmlSlot("suffix")}</div>
75
75
  </div>
@@ -73,21 +73,7 @@ const cssScope = scopePrefix(protoName);
73
73
  visibility: visible;
74
74
  pointer-events: none;
75
75
  transform-origin: 0 0;
76
- background: var(${cssScope}--modal-background, currentColor);
77
- animation-duration: var(${cssScope}--modal-animation-duration);
78
- }
79
-
80
- @keyframes kf {
81
- 0% {
82
- transform: scale(0) translate(-50%, -50%);
83
- opacity: var(${cssScope}--modal-opacity, 0.1);
84
- }
85
- 80% {
86
- transform: scale(1) translate(-50%, -50%);
87
- }
88
- to {
89
- opacity: 0;
90
- }
76
+ background: currentColor;
91
77
  }
92
78
  `,
93
79
  )
@@ -133,7 +119,7 @@ class Button extends GlobalStyle {
133
119
  part="root"
134
120
  ${attr(this.observedRecord)}
135
121
  >
136
- ${this.content || htmlSlot()}
122
+ ${htmlSlot("", this.content)}
137
123
  <span part="modal-root"></span>
138
124
  </div>
139
125
  `;
@@ -154,7 +140,7 @@ class Button extends GlobalStyle {
154
140
 
155
141
  connectedCallback(): void {
156
142
  super.connectedCallback();
157
- this.events.add(this, "click", this._handelClick, true);
143
+ this.events.add(this, "click", this._handelClick);
158
144
  }
159
145
 
160
146
  protected _handelClick(e: MouseEvent): void {
@@ -177,8 +163,24 @@ class Button extends GlobalStyle {
177
163
  modal.style.width = size;
178
164
  modal.style.left = `${e.x - x}px`;
179
165
  modal.style.top = `${e.y - y}px`;
180
- modal.style.animationName = "kf";
181
166
  this._modalRoot.appendChild(modal);
167
+ const keyframes = [
168
+ {
169
+ transform: "scale(0) translate(-50%, -50%)",
170
+ opacity: 0.1,
171
+ },
172
+ {
173
+ transform: "scale(1) translate(-50%, -50%)",
174
+ offset: 0.8,
175
+ },
176
+ {
177
+ opacity: 0,
178
+ },
179
+ ];
180
+ modal.animate(keyframes, {
181
+ duration: 800,
182
+ iterations: 1,
183
+ });
182
184
  modal.addEventListener("animationend", () => modal.remove(), { once: true });
183
185
  }
184
186
  }
@@ -104,7 +104,7 @@ class Details extends SuperOpenable {
104
104
  part="title"
105
105
  @click="${() => this.toggle()}"
106
106
  >
107
- <span part="summary">${this.summary || htmlSlot("summary")}</span>
107
+ <span part="summary">${htmlSlot("summary", this.summary)}</span>
108
108
  <span part="icon">${svgCaretDown()}</span>
109
109
  </dt>
110
110
  <dd
@@ -29,6 +29,7 @@ const splitKeysRegexp = /[\s,]+/;
29
29
  display: block;
30
30
  margin: auto;
31
31
  background: none;
32
+ z-index: 1;
32
33
  left: 50%;
33
34
  top: 50%;
34
35
  position: fixed;
@@ -1,4 +1,4 @@
1
- import { attr, godown, queryPart, styles, StyleController } from "@godown/element";
1
+ import { attr, godown, queryPart, styles, StyleController, htmlSlot } 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";
@@ -7,6 +7,25 @@ import { cssGlobalVars } from "../../internal/global-style.js";
7
7
  import { SuperInput } from "../../internal/super-input.js";
8
8
  import { RingBuilder } from "../../internal/ring.js";
9
9
 
10
+ type InputType =
11
+ | "text"
12
+ | "search"
13
+ | "tel"
14
+ | "url"
15
+ | "email"
16
+ | "password"
17
+ | "datetime"
18
+ | "date"
19
+ | "month"
20
+ | "week"
21
+ | "time"
22
+ | "datetime-local"
23
+ | "number"
24
+ | "range"
25
+ | "color"
26
+ | "file"
27
+ | "image";
28
+
10
29
  const protoName = "input";
11
30
 
12
31
  /**
@@ -46,41 +65,26 @@ const protoName = "input";
46
65
  background: none;
47
66
  }
48
67
 
49
- [part~="icon"] {
68
+ [part="prefix"],
69
+ [part="suffix"] {
70
+ height: 100%;
50
71
  display: flex;
51
72
  align-items: center;
52
73
  justify-content: center;
53
74
  color: var(${cssGlobalVars.input}-icon-color);
54
75
  }
55
76
 
56
- [part~="prefix"],
57
- [part~="suffix"] {
58
- height: 100%;
59
- display: flex;
77
+ [part="suffix"] slot svg {
78
+ margin-inline-start: var(${cssGlobalVars.input}-space);
60
79
  }
61
80
 
62
- [part~="suffix"][part~="icon"] {
63
- padding-inline-start: var(${cssGlobalVars.input}-space);
64
- }
65
-
66
- [part~="prefix"][part~="icon"] {
67
- padding-inline-end: var(${cssGlobalVars.input}-space);
81
+ [part="prefix"] slot svg {
82
+ margin-inline-end: var(${cssGlobalVars.input}-space);
68
83
  }
69
84
  `)
70
85
  class Input extends SuperInput {
71
- type:
72
- | "text"
73
- | "search"
74
- | "tel"
75
- | "url"
76
- | "email"
77
- | "password"
78
- | "number"
79
- | "date"
80
- | "time"
81
- | "datetime-local"
82
- | "month"
83
- | "week" = "text";
86
+ @property({ reflect: true })
87
+ type: InputType = "text";
84
88
 
85
89
  value: string;
86
90
 
@@ -136,17 +140,23 @@ class Input extends SuperInput {
136
140
  if (this.type === PASSWORD) {
137
141
  return html`
138
142
  <i
139
- part="suffix icon"
143
+ part="suffix"
140
144
  @mousedown="${() => this._changeInputType("text")}"
141
145
  @mouseup="${() => this._changeInputType(PASSWORD)}"
142
146
  @mouseleave="${() => this._changeInputType(PASSWORD)}"
143
147
  >
144
- ${iconEyeSlash()}
148
+ ${htmlSlot("suffix", iconEyeSlash())}
145
149
  </i>
146
150
  `;
147
151
  }
148
152
  return super._renderSuffix();
149
153
  }
154
+
155
+ protected _changeInputType(t: typeof this.type): void {
156
+ if (this._input) {
157
+ this._input.type = t;
158
+ }
159
+ }
150
160
  }
151
161
 
152
162
  export default Input;
@@ -24,6 +24,7 @@ const protoName = "layout";
24
24
  @styles(css`
25
25
  :host {
26
26
  width: 100%;
27
+ height: 100%;
27
28
  min-height: 100%;
28
29
  flex-direction: column;
29
30
  grid-template-rows: auto 1fr auto;
@@ -1,13 +1,11 @@
1
- import { attr, tokenList, godown, htmlSlot, styles } from "@godown/element";
1
+ import { godown, htmlSlot, styles } from "@godown/element";
2
2
  import { type TemplateResult, css, html } from "lit";
3
3
  import { property } from "lit/decorators.js";
4
4
 
5
- import { GlobalStyle, cssGlobalVars, scopePrefix } from "../../internal/global-style.js";
5
+ import { GlobalStyle, cssGlobalVars } from "../../internal/global-style.js";
6
6
 
7
7
  const protoName = "text";
8
8
 
9
- const cssScope = scopePrefix(protoName);
10
-
11
9
  /**
12
10
  * {@linkcode Text} renders text.
13
11
  *
@@ -15,74 +13,71 @@ const cssScope = scopePrefix(protoName);
15
13
  */
16
14
  @godown(protoName)
17
15
  @styles(css`
18
- :host {
19
- ${cssScope}--color: currentColor;
20
- ${cssScope}--color-hover: currentColor;
21
- ${cssScope}--color-active: currentColor;
16
+ :host([clip]) {
17
+ background: var(${cssGlobalVars.backgroundClip});
22
18
  display: inline-block;
23
- text-overflow: ellipsis;
24
- overflow-wrap: break-word;
19
+ color: transparent;
20
+ -webkit-text-fill-color: transparent;
21
+ background-clip: text;
22
+ -webkit-background-clip: text;
25
23
  }
26
24
 
27
- [part="root"] {
25
+ :host([nowrap]) {
28
26
  white-space: nowrap;
29
- vertical-align: bottom;
30
- display: inline-block;
31
- text-overflow: inherit;
32
- overflow-wrap: inherit;
33
- overflow: hidden;
34
- color: var(${cssScope}--color);
35
27
  }
36
28
 
37
- [part="root"]:hover {
38
- color: var(${cssScope}--color-hover, var(${cssScope}--color));
29
+ :host([italic]) {
30
+ font-style: italic;
39
31
  }
40
32
 
41
- [part="root"]:active {
42
- color: var(${cssScope}--color-active, var(${cssScope}--color));
43
- }
44
-
45
- .hover:hover,
46
- .active:active,
47
- .always {
48
- text-decoration: underline;
33
+ :host([truncate]),
34
+ :host([truncate]) ::slotted(*) {
35
+ max-width: 100%;
36
+ overflow: hidden;
37
+ text-overflow: ellipsis;
49
38
  }
50
39
 
51
- .none {
52
- text-decoration: none;
40
+ :host([strikethrough]) {
41
+ text-decoration: line-through;
53
42
  }
54
43
 
55
- [clip] {
56
- background: var(${cssGlobalVars.backgroundClip});
57
- display: inline-block;
58
- color: transparent;
59
- -webkit-text-fill-color: transparent;
60
- background-clip: text;
61
- -webkit-background-clip: text;
44
+ :host([underline=""]),
45
+ :host([underline="always"]),
46
+ :host(:hover[underline="hover"]),
47
+ :host(:active[underline="active"]),
48
+ :host(:focus[underline="focus"]) {
49
+ text-decoration: underline;
62
50
  }
63
51
  `)
64
52
  class Text extends GlobalStyle {
65
- /**
66
- * Underline behavior.
67
- */
68
- @property()
69
- underline: "none" | "hover" | "active" | "always" = "none";
53
+ @property({
54
+ converter: {
55
+ fromAttribute(value) {
56
+ return value === "" ? true : value;
57
+ },
58
+ toAttribute(value) {
59
+ return value === false ? null : value === true ? "" : value;
60
+ },
61
+ },
62
+ reflect: true,
63
+ })
64
+ underline: "none" | "hover" | "active" | "always" | boolean = "none";
65
+
66
+ @property({ type: Boolean, reflect: true })
67
+ nowrap = false;
68
+
69
+ @property({ type: Boolean, reflect: true })
70
+ italic = false;
71
+
72
+ @property({ type: Boolean, reflect: true })
73
+ truncate = false;
70
74
 
71
- /**
72
- * Set background-clip to text.
73
- */
74
- @property({ type: Boolean })
75
+ @property({ type: Boolean, reflect: true })
75
76
  clip = false;
76
77
 
77
78
  protected render(): TemplateResult<1> {
78
79
  return html`
79
- <span
80
- part="root"
81
- ${attr(this.observedRecord)}
82
- class="${tokenList(this.underline)}"
83
- >
84
- ${htmlSlot()}
85
- </span>
80
+ <p part="root">${htmlSlot()}</p>
86
81
  `;
87
82
  }
88
83
  }
@@ -1,9 +1,9 @@
1
- import { attr, godown, styles } from "@godown/element";
1
+ import { attr, godown } from "@godown/element";
2
2
  import fmtime from "fmtime";
3
- import { type PropertyValues, type TemplateResult, css, html } from "lit";
3
+ import { type PropertyValues, type TemplateResult, html } from "lit";
4
4
  import { property } from "lit/decorators.js";
5
5
 
6
- import { GlobalStyle } from "../../internal/global-style.js";
6
+ import Text from "../text/component.js";
7
7
 
8
8
  const protoName = "time";
9
9
 
@@ -14,12 +14,7 @@ const protoName = "time";
14
14
  * @category display
15
15
  */
16
16
  @godown(protoName)
17
- @styles(css`
18
- :host {
19
- text-align: center;
20
- }
21
- `)
22
- class Time extends GlobalStyle {
17
+ class Time extends Text {
23
18
  /**
24
19
  * Escape symbol.
25
20
  */
@@ -54,12 +49,7 @@ class Time extends GlobalStyle {
54
49
 
55
50
  protected render(): TemplateResult<1> {
56
51
  return html`
57
- <span
58
- part="root"
59
- ${attr(this.observedRecord)}
60
- >
61
- ${fmtime(this.format, this.time, this.escape)}
62
- </span>
52
+ <p part="root">${fmtime(this.format, this.time, this.escape)}</p>
63
53
  `;
64
54
  }
65
55
 
@@ -124,11 +124,12 @@ class Tooltip extends SuperOpenable {
124
124
  part="tip"
125
125
  direction-outset-place
126
126
  >
127
- ${this.tip
128
- ? html`
129
- <span class="passive">${this.tip}</span>
130
- `
131
- : htmlSlot("tip")}
127
+ ${htmlSlot(
128
+ "tip",
129
+ html`
130
+ <span class="passive">${this.tip}</span>
131
+ `,
132
+ )}
132
133
  </div>
133
134
  </div>
134
135
  `;