@logosphere-ui/core 0.0.0-alpha.3 → 0.0.0-alpha.30

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 (150) hide show
  1. package/AGENTS.md +1118 -0
  2. package/dist/AGENTS.md +1118 -0
  3. package/dist/atoms/Badge/badge.d.ts +1 -1
  4. package/dist/atoms/FormField/formfield.d.ts +10 -0
  5. package/dist/badge-BD_MRIBd.js +72 -0
  6. package/dist/badge-BV2hTvrI.cjs +13 -0
  7. package/dist/badge.cjs +1 -1
  8. package/dist/badge.js +1 -1
  9. package/dist/{breadcrumb-B-4yqoJZ.js → breadcrumb-BB61Xt0s.js} +3 -3
  10. package/dist/breadcrumb.js +1 -1
  11. package/dist/button-DRZ4sG4T.cjs +10 -0
  12. package/dist/button-Uu9oaieg.js +58 -0
  13. package/dist/button.cjs +1 -1
  14. package/dist/button.js +1 -1
  15. package/dist/calendar-CBJ4mtlE.js +652 -0
  16. package/dist/calendar-Coc9E6lD.cjs +88 -0
  17. package/dist/calendar.cjs +1 -0
  18. package/dist/calendar.js +4 -0
  19. package/dist/card-BD8FkSTi.cjs +43 -0
  20. package/dist/{card-CUhlTJyJ.js → card-CAAhjIjf.js} +26 -25
  21. package/dist/card.cjs +1 -1
  22. package/dist/card.js +1 -1
  23. package/dist/chatbot-BUYrJbTR.cjs +183 -0
  24. package/dist/chatbot-Cb2ByNkE.js +564 -0
  25. package/dist/chatbot.cjs +1 -1
  26. package/dist/chatbot.js +2 -2
  27. package/dist/{checkbox-7Rb3WKGx.js → checkbox-g6kl2jGR.js} +4 -4
  28. package/dist/checkbox.js +1 -1
  29. package/dist/combobox-G4TVTGS7.js +387 -0
  30. package/dist/combobox-kdjsT5eX.cjs +107 -0
  31. package/dist/combobox.cjs +1 -1
  32. package/dist/combobox.js +1 -1
  33. package/dist/datepicker-Cf3gLMsu.cjs +85 -0
  34. package/dist/datepicker-n5dZbuCD.js +375 -0
  35. package/dist/datepicker.cjs +1 -1
  36. package/dist/datepicker.js +2 -2
  37. package/dist/{download-manager-A4fOxGWJ.js → download-manager-BPg-6Qfg.js} +4 -4
  38. package/dist/download-manager-DDeTYRPs.cjs +97 -0
  39. package/dist/download-manager.cjs +1 -1
  40. package/dist/download-manager.js +1 -1
  41. package/dist/drawer-CViKfr6O.js +114 -0
  42. package/dist/drawer-CjM-vX41.cjs +32 -0
  43. package/dist/drawer.cjs +1 -0
  44. package/dist/drawer.js +4 -0
  45. package/dist/formfield-CRcyUMvQ.cjs +33 -0
  46. package/dist/formfield-O327HYt0.js +154 -0
  47. package/dist/formfield.cjs +1 -1
  48. package/dist/formfield.js +1 -1
  49. package/dist/index.cjs +1 -1
  50. package/dist/index.d.ts +6 -0
  51. package/dist/index.js +43 -28
  52. package/dist/index.umd.js +1029 -512
  53. package/dist/input-BJtn_iTC.js +257 -0
  54. package/dist/input-DPTTu8ZR.cjs +59 -0
  55. package/dist/input.cjs +1 -1
  56. package/dist/input.js +1 -1
  57. package/dist/left-menu.cjs +1 -0
  58. package/dist/left-menu.js +5 -0
  59. package/dist/leftmenu-DpES_nr1.js +301 -0
  60. package/dist/leftmenu-RcrjiF7g.cjs +83 -0
  61. package/dist/modal-CsEaHz0h.cjs +84 -0
  62. package/dist/modal-DHzMgFVY.js +250 -0
  63. package/dist/modal.cjs +1 -1
  64. package/dist/modal.js +1 -1
  65. package/dist/molecules/Input/input.d.ts +7 -1
  66. package/dist/molecules/Pagination/index.d.ts +1 -0
  67. package/dist/molecules/Pagination/pagination.d.ts +60 -0
  68. package/dist/molecules/Popover/popover.d.ts +1 -0
  69. package/dist/molecules/Textarea/text-area.d.ts +5 -2
  70. package/dist/molecules/TimePicker/index.d.ts +2 -0
  71. package/dist/molecules/TimePicker/timepicker.d.ts +62 -0
  72. package/dist/organisms/Calendar/calendar.d.ts +54 -0
  73. package/dist/organisms/Calendar/index.d.ts +1 -0
  74. package/dist/organisms/Calendar/shared.d.ts +9 -0
  75. package/dist/organisms/Chatbot/chatbot.d.ts +10 -1
  76. package/dist/organisms/Chatbot/index.d.ts +1 -1
  77. package/dist/organisms/Combobox/combobox.d.ts +19 -0
  78. package/dist/organisms/DatePicker/datepicker.d.ts +33 -33
  79. package/dist/organisms/Drawer/drawer.d.ts +30 -0
  80. package/dist/organisms/Drawer/index.d.ts +1 -0
  81. package/dist/organisms/LeftMenu/index.d.ts +2 -0
  82. package/dist/organisms/LeftMenu/leftmenu-item.d.ts +14 -0
  83. package/dist/organisms/LeftMenu/leftmenu.d.ts +45 -0
  84. package/dist/organisms/Modal/modal.d.ts +29 -4
  85. package/dist/organisms/Toast/index.d.ts +2 -0
  86. package/dist/organisms/Toast/toast-container.d.ts +42 -0
  87. package/dist/organisms/Toast/toast.d.ts +48 -0
  88. package/dist/organisms/TreeMenu/index.d.ts +1 -0
  89. package/dist/organisms/TreeMenu/tree-menu.d.ts +41 -0
  90. package/dist/popover-BSfKsQni.js +143 -0
  91. package/dist/popover-DhEvLuOo.cjs +30 -0
  92. package/dist/popover.cjs +1 -1
  93. package/dist/popover.js +1 -1
  94. package/dist/styles/main.css +186 -182
  95. package/dist/switch-8RGGesy5.cjs +17 -0
  96. package/dist/switch-DNqPqH-R.js +64 -0
  97. package/dist/switch.cjs +1 -1
  98. package/dist/switch.js +1 -1
  99. package/dist/tab-BmrITzOL.cjs +40 -0
  100. package/dist/{tab-BKdN4xAz.js → tab-Ca_OyNqQ.js} +5 -5
  101. package/dist/tab.cjs +1 -1
  102. package/dist/tab.js +1 -1
  103. package/dist/text-area-BztUgBL1.cjs +51 -0
  104. package/dist/text-area-DUg5BGQh.js +235 -0
  105. package/dist/textarea.cjs +1 -1
  106. package/dist/textarea.js +1 -1
  107. package/dist/timepicker-BKUTi_AU.js +316 -0
  108. package/dist/timepicker-CRtoPBMn.cjs +119 -0
  109. package/dist/timepicker.cjs +1 -0
  110. package/dist/timepicker.js +4 -0
  111. package/dist/toast-container-CHrtU7X5.js +274 -0
  112. package/dist/toast-container-T77X56AG.cjs +64 -0
  113. package/dist/toast.cjs +1 -0
  114. package/dist/toast.js +6 -0
  115. package/dist/tree-menu-5dkAPsgJ.js +154 -0
  116. package/dist/tree-menu-CdNwvOjp.cjs +47 -0
  117. package/dist/tree-menu.cjs +1 -0
  118. package/dist/tree-menu.js +4 -0
  119. package/dist/ui-icon-DKZMrOTi.cjs +22 -0
  120. package/dist/ui-icon-DrrH0WhF.js +70 -0
  121. package/package.json +56 -12
  122. package/dist/badge-BbhaO73N.cjs +0 -13
  123. package/dist/badge-DE7Tgd8Z.js +0 -71
  124. package/dist/button-C1EwOosO.js +0 -58
  125. package/dist/button-CDRccsk9.cjs +0 -10
  126. package/dist/card-n8ka8Zk-.cjs +0 -43
  127. package/dist/chatbot-Ces7Xveb.js +0 -496
  128. package/dist/chatbot-oRwt64d8.cjs +0 -160
  129. package/dist/combobox-BJbI-Tgi.js +0 -268
  130. package/dist/combobox-pmE7bgEL.cjs +0 -99
  131. package/dist/datepicker-DFJx45C-.js +0 -750
  132. package/dist/datepicker-b9JGTTMx.cjs +0 -115
  133. package/dist/directive-Z_rhNYWK.js +0 -240
  134. package/dist/directive-ekjitgzi.cjs +0 -3
  135. package/dist/download-manager-BSIMTGaK.cjs +0 -97
  136. package/dist/formfield-D_7NFFoe.cjs +0 -27
  137. package/dist/formfield-d8fp9FTV.js +0 -118
  138. package/dist/input-ByllRq9M.js +0 -192
  139. package/dist/input-DsIOQPGV.cjs +0 -46
  140. package/dist/live-BX-yBGvT.cjs +0 -1
  141. package/dist/live-WTVSYE2F.js +0 -24
  142. package/dist/modal-Bfc6WQSL.js +0 -110
  143. package/dist/modal-DQ8VFL-P.cjs +0 -39
  144. package/dist/popover-C_Ob86CJ.cjs +0 -30
  145. package/dist/popover-D-FXdEdS.js +0 -1040
  146. package/dist/switch-Cpl53nRW.js +0 -64
  147. package/dist/switch-Rnnn10bn.cjs +0 -17
  148. package/dist/tab-DcjAlXzU.cjs +0 -40
  149. package/dist/text-area-CtZY3yLA.js +0 -204
  150. package/dist/text-area-DFDF5oos.cjs +0 -44
@@ -1,64 +0,0 @@
1
- import { LitElement as l, html as d, unsafeCSS as p, css as _ } from "lit";
2
- import { property as n, query as w, customElement as b } from "lit/decorators.js";
3
- const u = ":host{display:block}.switch{display:inline-block;position:relative}.switch--md{width:36px;height:20px}.switch--sm{width:32px;height:18px}.switch__input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.switch__track{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:var(--radius-full);cursor:pointer;transition:background-color var(--transition-speed-base) var(--transition-timing);background-color:var(--color-gray-300)}.switch__track--on{background-color:var(--color-primary)}.switch__track--disabled{cursor:not-allowed}.switch__track--disabled-on{background-color:color-mix(in srgb,var(--color-primary) 30%,transparent)}.switch__track--disabled-off{background-color:var(--color-gray-200)}.switch__thumb{position:absolute;background-color:#fff;border-radius:var(--radius-full);box-shadow:var(--shadow-xs);top:2px;left:2px;transform:translate(0);transition:transform var(--transition-speed-base) var(--transition-timing)}.switch--md .switch__thumb{width:16px;height:16px}.switch--sm .switch__thumb{width:14px;height:14px}.switch__thumb--on.switch--md .switch__thumb,.switch__track--on~.switch__thumb{transform:translate(16px)}.switch__track--on+.switch__thumb{transform:translate(16px)}";
4
- var m = Object.defineProperty, k = Object.getOwnPropertyDescriptor, a = (e, t, r, c) => {
5
- for (var s = c > 1 ? void 0 : c ? k(t, r) : t, o = e.length - 1, h; o >= 0; o--)
6
- (h = e[o]) && (s = (c ? h(t, r, s) : h(s)) || s);
7
- return c && s && m(t, r, s), s;
8
- };
9
- let i = class extends l {
10
- constructor() {
11
- super(...arguments), this.checked = !1, this.disabled = !1, this.size = "md";
12
- }
13
- onChange(e) {
14
- const t = e.target;
15
- this.checked = t.checked, this.dispatchEvent(new CustomEvent("change", {
16
- detail: { checked: this.checked }
17
- }));
18
- }
19
- render() {
20
- const e = `switch switch--${this.size}`, t = [
21
- "switch__track",
22
- this.checked && !this.disabled ? "switch__track--on" : "",
23
- this.disabled ? "switch__track--disabled" : "",
24
- this.disabled && this.checked ? "switch__track--disabled-on" : "",
25
- this.disabled && !this.checked ? "switch__track--disabled-off" : ""
26
- ].filter(Boolean).join(" "), r = this.checked ? "translateX(16px)" : "translateX(0)";
27
- return d`
28
- <label class="${e}">
29
- <input
30
- class="switch__input"
31
- type="checkbox"
32
- ?checked=${this.checked}
33
- ?disabled=${this.disabled}
34
- @change=${this.onChange}
35
- />
36
- <div class="${t}">
37
- <span
38
- class="switch__thumb"
39
- style="transform: ${r}"
40
- ></span>
41
- </div>
42
- </label>
43
- `;
44
- }
45
- };
46
- i.styles = [_`${p(u)}`];
47
- a([
48
- n({ type: Boolean })
49
- ], i.prototype, "checked", 2);
50
- a([
51
- n({ type: Boolean })
52
- ], i.prototype, "disabled", 2);
53
- a([
54
- n({ type: String })
55
- ], i.prototype, "size", 2);
56
- a([
57
- w("input")
58
- ], i.prototype, "inputElement", 2);
59
- i = a([
60
- b("logosphere-switch")
61
- ], i);
62
- export {
63
- i as S
64
- };
@@ -1,17 +0,0 @@
1
- "use strict";const a=require("lit"),r=require("lit/decorators.js"),d=":host{display:block}.switch{display:inline-block;position:relative}.switch--md{width:36px;height:20px}.switch--sm{width:32px;height:18px}.switch__input{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.switch__track{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:var(--radius-full);cursor:pointer;transition:background-color var(--transition-speed-base) var(--transition-timing);background-color:var(--color-gray-300)}.switch__track--on{background-color:var(--color-primary)}.switch__track--disabled{cursor:not-allowed}.switch__track--disabled-on{background-color:color-mix(in srgb,var(--color-primary) 30%,transparent)}.switch__track--disabled-off{background-color:var(--color-gray-200)}.switch__thumb{position:absolute;background-color:#fff;border-radius:var(--radius-full);box-shadow:var(--shadow-xs);top:2px;left:2px;transform:translate(0);transition:transform var(--transition-speed-base) var(--transition-timing)}.switch--md .switch__thumb{width:16px;height:16px}.switch--sm .switch__thumb{width:14px;height:14px}.switch__thumb--on.switch--md .switch__thumb,.switch__track--on~.switch__thumb{transform:translate(16px)}.switch__track--on+.switch__thumb{transform:translate(16px)}";var l=Object.defineProperty,p=Object.getOwnPropertyDescriptor,c=(o,t,s,e)=>{for(var i=e>1?void 0:e?p(t,s):t,h=o.length-1,n;h>=0;h--)(n=o[h])&&(i=(e?n(t,s,i):n(i))||i);return e&&i&&l(t,s,i),i};exports.Switch=class extends a.LitElement{constructor(){super(...arguments),this.checked=!1,this.disabled=!1,this.size="md"}onChange(t){const s=t.target;this.checked=s.checked,this.dispatchEvent(new CustomEvent("change",{detail:{checked:this.checked}}))}render(){const t=`switch switch--${this.size}`,s=["switch__track",this.checked&&!this.disabled?"switch__track--on":"",this.disabled?"switch__track--disabled":"",this.disabled&&this.checked?"switch__track--disabled-on":"",this.disabled&&!this.checked?"switch__track--disabled-off":""].filter(Boolean).join(" "),e=this.checked?"translateX(16px)":"translateX(0)";return a.html`
2
- <label class="${t}">
3
- <input
4
- class="switch__input"
5
- type="checkbox"
6
- ?checked=${this.checked}
7
- ?disabled=${this.disabled}
8
- @change=${this.onChange}
9
- />
10
- <div class="${s}">
11
- <span
12
- class="switch__thumb"
13
- style="transform: ${e}"
14
- ></span>
15
- </div>
16
- </label>
17
- `}};exports.Switch.styles=[a.css`${a.unsafeCSS(d)}`];c([r.property({type:Boolean})],exports.Switch.prototype,"checked",2);c([r.property({type:Boolean})],exports.Switch.prototype,"disabled",2);c([r.property({type:String})],exports.Switch.prototype,"size",2);c([r.query("input")],exports.Switch.prototype,"inputElement",2);exports.Switch=c([r.customElement("logosphere-switch")],exports.Switch);
@@ -1,40 +0,0 @@
1
- "use strict";const s=require("lit"),n=require("lit/decorators.js"),c=".tab{width:100%;font-family:var(--font-family-base)}.tab__list{display:flex;overflow-x:auto;overflow-y:hidden;border-bottom:1px solid var(--color-border);scroll-behavior:smooth;-webkit-overflow-scrolling:touch;scrollbar-width:none;-ms-overflow-style:none}.tab__list::-webkit-scrollbar{display:none}.tab__button{display:inline-flex;flex-direction:row;align-items:center;gap:var(--spacing-2);padding:var(--spacing-3) var(--spacing-4);min-width:120px;position:relative;cursor:pointer;border:none;border-bottom:2px solid transparent;background:transparent;font-family:var(--font-family-base);white-space:nowrap;transition:background-color var(--transition-speed-base) var(--transition-timing),border-color var(--transition-speed-base) var(--transition-timing)}.tab__button:hover:not(.tab__button--disabled):not(.tab__button--active){background-color:var(--color-tertiary-bg)}.tab__button--active{border-bottom-color:var(--color-primary)}.tab__button--disabled{cursor:not-allowed;opacity:.4;pointer-events:none}.tab__icon{font-size:var(--font-size-xl);flex-shrink:0;color:inherit;line-height:1}.tab__content{display:flex;flex-direction:column;align-items:flex-start}.tab__label{font-weight:var(--font-weight-medium);font-size:var(--font-size-sm);color:var(--color-body-text)}.tab__label--inactive{color:var(--color-tertiary)}.tab__description{font-size:var(--font-size-xs);text-align:left;color:var(--color-tertiary)}.tab__description--active{color:var(--color-secondary)}.tab__panel{padding:var(--spacing-4);outline:none}.tab__panel--hidden{display:none}";var h=Object.defineProperty,p=Object.getOwnPropertyDescriptor,r=(d,e,a,t)=>{for(var i=t>1?void 0:t?p(e,a):e,o=d.length-1,l;o>=0;o--)(l=d[o])&&(i=(t?l(e,a,i):l(i))||i);return t&&i&&h(e,a,i),i};exports.LogosphereTab=class extends s.LitElement{constructor(){super(...arguments),this.tabs=[],this.activeTab="",this.lazy=!0,this.variant="default",this._focusedIndex=0,this._renderedTabs=new Set}connectedCallback(){super.connectedCallback(),!this.activeTab&&this.tabs.length>0&&(this.activeTab=this.tabs[0].id)}willUpdate(e){if(super.willUpdate(e),e.has("activeTab")&&this.activeTab){this._renderedTabs.add(this.activeTab);const a=this.tabs.findIndex(t=>t.id===this.activeTab);a!==-1&&(this._focusedIndex=a)}e.has("tabs")&&this.tabs.length>0&&(this.tabs.some(t=>t.id===this.activeTab)||(this.activeTab=this.tabs[0].id),this._focusedIndex=this.tabs.findIndex(t=>t.id===this.activeTab))}handleTabClick(e,a){if(a)return;const t=this.activeTab;this.activeTab=e,this._focusedIndex=this.tabs.findIndex(i=>i.id===e),this.dispatchEvent(new CustomEvent("tab-change",{detail:{oldTab:t,newTab:e},bubbles:!0,composed:!0}))}handleKeyDown(e){const{tabs:a}=this;if(a.filter(o=>!o.disabled).length===0)return;let t=this._focusedIndex;const i=this._focusedIndex;switch(e.key){case"ArrowLeft":e.preventDefault();do t=t>0?t-1:a.length-1;while(a[t]?.disabled&&t!==i);break;case"ArrowRight":e.preventDefault();do t=t<a.length-1?t+1:0;while(a[t]?.disabled&&t!==i);break;case"Home":for(e.preventDefault(),t=0;a[t]?.disabled&&t<a.length-1;)t++;break;case"End":for(e.preventDefault(),t=a.length-1;a[t]?.disabled&&t>0;)t--;break;default:return}if(t!==this._focusedIndex&&!a[t]?.disabled){const o=this.activeTab;this._focusedIndex=t,this.activeTab=a[t].id,this.updateComplete.then(()=>{this.shadowRoot?.querySelector(`[role="tab"][data-tab-id="${a[t].id}"]`)?.focus()}),this.dispatchEvent(new CustomEvent("tab-change",{detail:{oldTab:o,newTab:a[t].id},bubbles:!0,composed:!0}))}}scrollTabIntoView(e){this.updateComplete.then(()=>{const a=this.shadowRoot?.querySelector(`[role="tab"][data-tab-id="${e}"]`);if(a&&this.tablist){const t=this.tablist.getBoundingClientRect(),i=a.getBoundingClientRect();i.left<t.left?this.tablist.scrollLeft-=t.left-i.left+16:i.right>t.right&&(this.tablist.scrollLeft+=i.right-t.right+16)}})}renderTabButton(e,a){const t=this.activeTab===e.id,i=this._focusedIndex===a,o=["tab__button",t?"tab__button--active":"",e.disabled?"tab__button--disabled":""].filter(Boolean).join(" "),l=["tab__label",t?"":"tab__label--inactive"].filter(Boolean).join(" "),b=["tab__description",t?"tab__description--active":""].filter(Boolean).join(" ");return s.html`
2
- <button
3
- role="tab"
4
- class=${o}
5
- data-tab-id=${e.id}
6
- aria-selected=${t?"true":"false"}
7
- aria-controls="panel-${e.id}"
8
- tabindex=${t||i?"0":"-1"}
9
- ?disabled=${e.disabled}
10
- @click=${()=>this.handleTabClick(e.id,e.disabled)}
11
- @focus=${()=>this.scrollTabIntoView(e.id)}
12
- >
13
- ${e.icon?s.html`<i class="${e.icon} tab__icon"></i>`:s.nothing}
14
- <div class="tab__content">
15
- <span class=${l}>${e.label}</span>
16
- ${e.description?s.html`<span class=${b}>${e.description}</span>`:s.nothing}
17
- </div>
18
- </button>
19
- `}renderTabPanel(e){const a=this.activeTab===e.id;if(!(!this.lazy||this._renderedTabs.has(e.id)))return s.nothing;const i=["tab__panel",a?"":"tab__panel--hidden"].filter(Boolean).join(" ");return s.html`
20
- <div
21
- role="tabpanel"
22
- id="panel-${e.id}"
23
- aria-labelledby="tab-${e.id}"
24
- class=${i}
25
- tabindex="0"
26
- >
27
- <slot name=${`panel-${e.id}`}>
28
- ${typeof e.content=="string"?s.html`${e.content}`:s.nothing}
29
- </slot>
30
- </div>
31
- `}render(){return s.html`
32
- <div class="tab">
33
- <div role="tablist" aria-label="Tabs" class="tab__list" @keydown=${this.handleKeyDown}>
34
- ${this.tabs.map((e,a)=>this.renderTabButton(e,a))}
35
- </div>
36
- <div class="tab__panels">${this.tabs.map(e=>this.renderTabPanel(e))}</div>
37
- </div>
38
- `}};exports.LogosphereTab.styles=[s.css`
39
- ${s.unsafeCSS(c)}
40
- `];r([n.property({type:Array})],exports.LogosphereTab.prototype,"tabs",2);r([n.property({type:String})],exports.LogosphereTab.prototype,"activeTab",2);r([n.property({type:Boolean})],exports.LogosphereTab.prototype,"lazy",2);r([n.property({type:String})],exports.LogosphereTab.prototype,"variant",2);r([n.state()],exports.LogosphereTab.prototype,"_focusedIndex",2);r([n.state()],exports.LogosphereTab.prototype,"_renderedTabs",2);r([n.query('[role="tablist"]')],exports.LogosphereTab.prototype,"tablist",2);exports.LogosphereTab=r([n.customElement("logosphere-tab")],exports.LogosphereTab);
@@ -1,204 +0,0 @@
1
- import { LitElement as d, nothing as l, html as u, unsafeCSS as y, css as c } from "lit";
2
- import { query as m, property as a, state as _, customElement as f } from "lit/decorators.js";
3
- import { l as v } from "./live-WTVSYE2F.js";
4
- const b = ".textarea__field{width:100%;background:transparent;border:none;outline:none;font-size:var(--font-size-sm);font-family:var(--font-family-base);color:var(--color-body-text);box-sizing:border-box;line-height:1.5}.textarea__field::placeholder{color:var(--color-tertiary)}.textarea__field:disabled{cursor:not-allowed}.textarea__field--resize-none{resize:none}.textarea__field--resize-vertical{resize:vertical}.textarea__field--resize-horizontal{resize:horizontal}.textarea__field--resize-both{resize:both}.textarea__field--auto-resize{resize:none;overflow:hidden}.textarea__clear-btn{border:none;background:transparent;color:var(--color-gray-400);cursor:pointer;padding:0;display:inline-flex;align-items:flex-start;align-self:flex-start;margin-top:var(--spacing-1);outline:none;flex-shrink:0;transition:color var(--transition-speed-fast) var(--transition-timing)}.textarea__clear-btn:hover{color:var(--color-gray-600)}";
5
- var x = Object.defineProperty, g = Object.getOwnPropertyDescriptor, r = (e, i, s, n) => {
6
- for (var o = n > 1 ? void 0 : n ? g(i, s) : i, h = e.length - 1, p; h >= 0; h--)
7
- (p = e[h]) && (o = (n ? p(i, s, o) : p(o)) || o);
8
- return n && o && x(i, s, o), o;
9
- };
10
- let t = class extends d {
11
- constructor() {
12
- super(...arguments), this.value = "", this.placeholder = "", this.name = "", this.autocomplete = "", this.rows = 3, this.wrap = "soft", this.resize = "vertical", this.autoResize = !1, this.size = "default", this.variant = "default", this.showClear = !1, this.label = "", this.helper = "", this.error = "", this.required = !1, this.disabled = !1, this.readonly = !1, this._internalError = "", this.handleInput = (e) => {
13
- const i = e.target;
14
- this.value = i.value, this.autoResize && this.adjustHeight(), this._internalError && (this._internalError = "", this._textareaElement.setCustomValidity("")), this.dispatchEvent(new CustomEvent("input", {
15
- bubbles: !0,
16
- composed: !0,
17
- detail: { value: this.value, originalEvent: e }
18
- }));
19
- }, this.handleChange = (e) => {
20
- const i = e.target;
21
- this.value = i.value, i.checkValidity() || (this._internalError = i.validationMessage), this.dispatchEvent(new CustomEvent("change", {
22
- bubbles: !0,
23
- composed: !0,
24
- detail: { value: this.value, originalEvent: e }
25
- }));
26
- }, this.handleKeyDown = (e) => {
27
- this.dispatchEvent(new CustomEvent("keydown", {
28
- bubbles: !0,
29
- composed: !0,
30
- detail: { key: e.key, originalEvent: e }
31
- }));
32
- }, this.handleKeyUp = (e) => {
33
- this.dispatchEvent(new CustomEvent("keyup", {
34
- bubbles: !0,
35
- composed: !0,
36
- detail: { key: e.key, originalEvent: e }
37
- }));
38
- }, this.handleClear = () => {
39
- this.value = "", this._textareaElement && (this._textareaElement.value = "", this.autoResize && this.adjustHeight()), this.dispatchEvent(new CustomEvent("clear", { bubbles: !0, composed: !0 })), this.dispatchEvent(new CustomEvent("input", {
40
- bubbles: !0,
41
- composed: !0,
42
- detail: { value: "", originalEvent: null }
43
- }));
44
- };
45
- }
46
- get textareaElement() {
47
- return this._textareaElement;
48
- }
49
- focus() {
50
- this._textareaElement?.focus();
51
- }
52
- blur() {
53
- this._textareaElement?.blur();
54
- }
55
- select() {
56
- this._textareaElement?.select();
57
- }
58
- setSelectionRange(e, i, s) {
59
- this._textareaElement?.setSelectionRange(e, i, s);
60
- }
61
- checkValidity() {
62
- return this._textareaElement?.checkValidity() ?? !0;
63
- }
64
- reportValidity() {
65
- return this._textareaElement?.reportValidity() ?? !0;
66
- }
67
- setCustomValidity(e) {
68
- this._textareaElement?.setCustomValidity(e), this._internalError = e, this.requestUpdate();
69
- }
70
- adjustHeight() {
71
- !this.autoResize || !this._textareaElement || (this._textareaElement.style.height = "auto", this._textareaElement.style.height = `${this._textareaElement.scrollHeight}px`);
72
- }
73
- updated(e) {
74
- super.updated(e), e.has("value") && this.autoResize && this.adjustHeight();
75
- }
76
- getResizeClass() {
77
- return this.autoResize ? "textarea__field--auto-resize" : {
78
- none: "textarea__field--resize-none",
79
- vertical: "textarea__field--resize-vertical",
80
- horizontal: "textarea__field--resize-horizontal",
81
- both: "textarea__field--resize-both"
82
- }[this.resize];
83
- }
84
- render() {
85
- const e = this.error || this._internalError, i = this.showClear && this.value && !this.disabled && !this.readonly, s = `textarea__field ${this.getResizeClass()}`;
86
- return u`
87
- <logosphere-formfield
88
- .label=${this.label}
89
- .helper=${this.helper}
90
- .error=${e}
91
- .required=${this.required}
92
- .disabled=${this.disabled}
93
- .readonly=${this.readonly}
94
- .placeholder=${this.placeholder}
95
- .size=${this.size}
96
- .variant=${this.variant}
97
- >
98
- <textarea
99
- class="${s}"
100
- .value=${v(this.value)}
101
- placeholder=${this.placeholder || l}
102
- name=${this.name || l}
103
- autocomplete=${this.autocomplete || l}
104
- ?required=${this.required}
105
- ?disabled=${this.disabled}
106
- ?readonly=${this.readonly}
107
- minlength=${this.minlength ?? l}
108
- maxlength=${this.maxlength ?? l}
109
- rows=${this.rows}
110
- cols=${this.cols ?? l}
111
- wrap=${this.wrap}
112
- @input=${this.handleInput}
113
- @change=${this.handleChange}
114
- @keydown=${this.handleKeyDown}
115
- @keyup=${this.handleKeyUp}
116
- ></textarea>
117
- ${i ? u`
118
- <button
119
- type="button"
120
- slot="suffix"
121
- class="textarea__clear-btn"
122
- @click=${this.handleClear}
123
- tabindex="-1"
124
- >
125
- <ui-icon name="uil-times" size="14"></ui-icon>
126
- </button>
127
- ` : l}
128
- </logosphere-formfield>
129
- `;
130
- }
131
- };
132
- t.styles = [c`${y(b)}`];
133
- r([
134
- m("textarea")
135
- ], t.prototype, "_textareaElement", 2);
136
- r([
137
- a({ type: String })
138
- ], t.prototype, "value", 2);
139
- r([
140
- a({ type: String })
141
- ], t.prototype, "placeholder", 2);
142
- r([
143
- a({ type: String })
144
- ], t.prototype, "name", 2);
145
- r([
146
- a({ type: String })
147
- ], t.prototype, "autocomplete", 2);
148
- r([
149
- a({ type: Number })
150
- ], t.prototype, "minlength", 2);
151
- r([
152
- a({ type: Number })
153
- ], t.prototype, "maxlength", 2);
154
- r([
155
- a({ type: Number })
156
- ], t.prototype, "rows", 2);
157
- r([
158
- a({ type: Number })
159
- ], t.prototype, "cols", 2);
160
- r([
161
- a({ type: String })
162
- ], t.prototype, "wrap", 2);
163
- r([
164
- a({ type: String })
165
- ], t.prototype, "resize", 2);
166
- r([
167
- a({ type: Boolean })
168
- ], t.prototype, "autoResize", 2);
169
- r([
170
- a({ type: String })
171
- ], t.prototype, "size", 2);
172
- r([
173
- a({ type: String })
174
- ], t.prototype, "variant", 2);
175
- r([
176
- a({ type: Boolean })
177
- ], t.prototype, "showClear", 2);
178
- r([
179
- a({ type: String })
180
- ], t.prototype, "label", 2);
181
- r([
182
- a({ type: String })
183
- ], t.prototype, "helper", 2);
184
- r([
185
- a({ type: String })
186
- ], t.prototype, "error", 2);
187
- r([
188
- a({ type: Boolean })
189
- ], t.prototype, "required", 2);
190
- r([
191
- a({ type: Boolean })
192
- ], t.prototype, "disabled", 2);
193
- r([
194
- a({ type: Boolean })
195
- ], t.prototype, "readonly", 2);
196
- r([
197
- _()
198
- ], t.prototype, "_internalError", 2);
199
- t = r([
200
- f("logosphere-textarea")
201
- ], t);
202
- export {
203
- t as T
204
- };
@@ -1,44 +0,0 @@
1
- "use strict";const i=require("lit"),t=require("lit/decorators.js"),p=require("./live-BX-yBGvT.cjs"),u=".textarea__field{width:100%;background:transparent;border:none;outline:none;font-size:var(--font-size-sm);font-family:var(--font-family-base);color:var(--color-body-text);box-sizing:border-box;line-height:1.5}.textarea__field::placeholder{color:var(--color-tertiary)}.textarea__field:disabled{cursor:not-allowed}.textarea__field--resize-none{resize:none}.textarea__field--resize-vertical{resize:vertical}.textarea__field--resize-horizontal{resize:horizontal}.textarea__field--resize-both{resize:both}.textarea__field--auto-resize{resize:none;overflow:hidden}.textarea__clear-btn{border:none;background:transparent;color:var(--color-gray-400);cursor:pointer;padding:0;display:inline-flex;align-items:flex-start;align-self:flex-start;margin-top:var(--spacing-1);outline:none;flex-shrink:0;transition:color var(--transition-speed-fast) var(--transition-timing)}.textarea__clear-btn:hover{color:var(--color-gray-600)}";var d=Object.defineProperty,y=Object.getOwnPropertyDescriptor,r=(l,e,a,o)=>{for(var s=o>1?void 0:o?y(e,a):e,n=l.length-1,h;n>=0;n--)(h=l[n])&&(s=(o?h(e,a,s):h(s))||s);return o&&s&&d(e,a,s),s};exports.TextArea=class extends i.LitElement{constructor(){super(...arguments),this.value="",this.placeholder="",this.name="",this.autocomplete="",this.rows=3,this.wrap="soft",this.resize="vertical",this.autoResize=!1,this.size="default",this.variant="default",this.showClear=!1,this.label="",this.helper="",this.error="",this.required=!1,this.disabled=!1,this.readonly=!1,this._internalError="",this.handleInput=e=>{const a=e.target;this.value=a.value,this.autoResize&&this.adjustHeight(),this._internalError&&(this._internalError="",this._textareaElement.setCustomValidity("")),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:this.value,originalEvent:e}}))},this.handleChange=e=>{const a=e.target;this.value=a.value,a.checkValidity()||(this._internalError=a.validationMessage),this.dispatchEvent(new CustomEvent("change",{bubbles:!0,composed:!0,detail:{value:this.value,originalEvent:e}}))},this.handleKeyDown=e=>{this.dispatchEvent(new CustomEvent("keydown",{bubbles:!0,composed:!0,detail:{key:e.key,originalEvent:e}}))},this.handleKeyUp=e=>{this.dispatchEvent(new CustomEvent("keyup",{bubbles:!0,composed:!0,detail:{key:e.key,originalEvent:e}}))},this.handleClear=()=>{this.value="",this._textareaElement&&(this._textareaElement.value="",this.autoResize&&this.adjustHeight()),this.dispatchEvent(new CustomEvent("clear",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("input",{bubbles:!0,composed:!0,detail:{value:"",originalEvent:null}}))}}get textareaElement(){return this._textareaElement}focus(){this._textareaElement?.focus()}blur(){this._textareaElement?.blur()}select(){this._textareaElement?.select()}setSelectionRange(e,a,o){this._textareaElement?.setSelectionRange(e,a,o)}checkValidity(){return this._textareaElement?.checkValidity()??!0}reportValidity(){return this._textareaElement?.reportValidity()??!0}setCustomValidity(e){this._textareaElement?.setCustomValidity(e),this._internalError=e,this.requestUpdate()}adjustHeight(){!this.autoResize||!this._textareaElement||(this._textareaElement.style.height="auto",this._textareaElement.style.height=`${this._textareaElement.scrollHeight}px`)}updated(e){super.updated(e),e.has("value")&&this.autoResize&&this.adjustHeight()}getResizeClass(){return this.autoResize?"textarea__field--auto-resize":{none:"textarea__field--resize-none",vertical:"textarea__field--resize-vertical",horizontal:"textarea__field--resize-horizontal",both:"textarea__field--resize-both"}[this.resize]}render(){const e=this.error||this._internalError,a=this.showClear&&this.value&&!this.disabled&&!this.readonly,o=`textarea__field ${this.getResizeClass()}`;return i.html`
2
- <logosphere-formfield
3
- .label=${this.label}
4
- .helper=${this.helper}
5
- .error=${e}
6
- .required=${this.required}
7
- .disabled=${this.disabled}
8
- .readonly=${this.readonly}
9
- .placeholder=${this.placeholder}
10
- .size=${this.size}
11
- .variant=${this.variant}
12
- >
13
- <textarea
14
- class="${o}"
15
- .value=${p.l(this.value)}
16
- placeholder=${this.placeholder||i.nothing}
17
- name=${this.name||i.nothing}
18
- autocomplete=${this.autocomplete||i.nothing}
19
- ?required=${this.required}
20
- ?disabled=${this.disabled}
21
- ?readonly=${this.readonly}
22
- minlength=${this.minlength??i.nothing}
23
- maxlength=${this.maxlength??i.nothing}
24
- rows=${this.rows}
25
- cols=${this.cols??i.nothing}
26
- wrap=${this.wrap}
27
- @input=${this.handleInput}
28
- @change=${this.handleChange}
29
- @keydown=${this.handleKeyDown}
30
- @keyup=${this.handleKeyUp}
31
- ></textarea>
32
- ${a?i.html`
33
- <button
34
- type="button"
35
- slot="suffix"
36
- class="textarea__clear-btn"
37
- @click=${this.handleClear}
38
- tabindex="-1"
39
- >
40
- <ui-icon name="uil-times" size="14"></ui-icon>
41
- </button>
42
- `:i.nothing}
43
- </logosphere-formfield>
44
- `}};exports.TextArea.styles=[i.css`${i.unsafeCSS(u)}`];r([t.query("textarea")],exports.TextArea.prototype,"_textareaElement",2);r([t.property({type:String})],exports.TextArea.prototype,"value",2);r([t.property({type:String})],exports.TextArea.prototype,"placeholder",2);r([t.property({type:String})],exports.TextArea.prototype,"name",2);r([t.property({type:String})],exports.TextArea.prototype,"autocomplete",2);r([t.property({type:Number})],exports.TextArea.prototype,"minlength",2);r([t.property({type:Number})],exports.TextArea.prototype,"maxlength",2);r([t.property({type:Number})],exports.TextArea.prototype,"rows",2);r([t.property({type:Number})],exports.TextArea.prototype,"cols",2);r([t.property({type:String})],exports.TextArea.prototype,"wrap",2);r([t.property({type:String})],exports.TextArea.prototype,"resize",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"autoResize",2);r([t.property({type:String})],exports.TextArea.prototype,"size",2);r([t.property({type:String})],exports.TextArea.prototype,"variant",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"showClear",2);r([t.property({type:String})],exports.TextArea.prototype,"label",2);r([t.property({type:String})],exports.TextArea.prototype,"helper",2);r([t.property({type:String})],exports.TextArea.prototype,"error",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"required",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"disabled",2);r([t.property({type:Boolean})],exports.TextArea.prototype,"readonly",2);r([t.state()],exports.TextArea.prototype,"_internalError",2);exports.TextArea=r([t.customElement("logosphere-textarea")],exports.TextArea);