@logosphere-ui/core 0.0.0-alpha.35 → 0.0.0-alpha.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +7 -2
- package/dist/AGENTS.md +7 -2
- package/dist/atoms/Checkbox/checkbox.d.ts +2 -1
- package/dist/{chatbot-p4CmxSdZ.js → chatbot-Cr6iOO7s.js} +1 -1
- package/dist/{chatbot-8etAVHNx.cjs → chatbot-Dl6P98Jq.cjs} +1 -1
- package/dist/chatbot.cjs +1 -1
- package/dist/chatbot.js +1 -1
- package/dist/checkbox-CX0LgsWP.js +148 -0
- package/dist/checkbox-DpbKHANK.cjs +53 -0
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{combobox-CTqEZUg6.js → combobox-CFF30L-n.js} +67 -61
- package/dist/{combobox-BV4AKTqp.cjs → combobox-s7NFPAd3.cjs} +3 -2
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/index.cjs +11 -7
- package/dist/index.d.ts +1 -0
- package/dist/index.js +179 -117
- package/dist/index.umd.js +80 -58
- package/dist/molecules/InputGroup/index.d.ts +1 -0
- package/dist/molecules/InputGroup/input-group.d.ts +40 -0
- package/dist/organisms/Tab/tab.d.ts +13 -1
- package/dist/{pagination-BLNrwUSO.js → pagination-DG56TV5n.js} +1 -1
- package/dist/{pagination-AclB9qi1.cjs → pagination-HyX0EAZr.cjs} +1 -1
- package/dist/pagination.cjs +1 -1
- package/dist/pagination.js +1 -1
- package/dist/tab-CDMcFHvP.cjs +41 -0
- package/dist/tab-CuBCFGoO.js +204 -0
- package/dist/tab.cjs +1 -1
- package/dist/tab.js +1 -1
- package/package.json +6 -1
- package/dist/checkbox-CdDTRdKV.cjs +0 -37
- package/dist/checkbox-g6kl2jGR.js +0 -119
- package/dist/tab-BmrITzOL.cjs +0 -40
- package/dist/tab-Ca_OyNqQ.js +0 -176
package/dist/tab-BmrITzOL.cjs
DELETED
|
@@ -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-light)}.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);
|
package/dist/tab-Ca_OyNqQ.js
DELETED
|
@@ -1,176 +0,0 @@
|
|
|
1
|
-
import { unsafeCSS as p, css as f, LitElement as v, nothing as c, html as r } from "lit";
|
|
2
|
-
import { property as b, state as h, query as _, customElement as u } from "lit/decorators.js";
|
|
3
|
-
const y = ".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-light)}.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}";
|
|
4
|
-
var g = Object.defineProperty, w = Object.getOwnPropertyDescriptor, n = (e, i, t, a) => {
|
|
5
|
-
for (var s = a > 1 ? void 0 : a ? w(i, t) : i, l = e.length - 1, d; l >= 0; l--)
|
|
6
|
-
(d = e[l]) && (s = (a ? d(i, t, s) : d(s)) || s);
|
|
7
|
-
return a && s && g(i, t, s), s;
|
|
8
|
-
};
|
|
9
|
-
let o = class extends v {
|
|
10
|
-
constructor() {
|
|
11
|
-
super(...arguments), this.tabs = [], this.activeTab = "", this.lazy = !0, this.variant = "default", this._focusedIndex = 0, this._renderedTabs = /* @__PURE__ */ new Set();
|
|
12
|
-
}
|
|
13
|
-
connectedCallback() {
|
|
14
|
-
super.connectedCallback(), !this.activeTab && this.tabs.length > 0 && (this.activeTab = this.tabs[0].id);
|
|
15
|
-
}
|
|
16
|
-
willUpdate(e) {
|
|
17
|
-
if (super.willUpdate(e), e.has("activeTab") && this.activeTab) {
|
|
18
|
-
this._renderedTabs.add(this.activeTab);
|
|
19
|
-
const i = this.tabs.findIndex((t) => t.id === this.activeTab);
|
|
20
|
-
i !== -1 && (this._focusedIndex = i);
|
|
21
|
-
}
|
|
22
|
-
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));
|
|
23
|
-
}
|
|
24
|
-
// ==================== EVENTS ====================
|
|
25
|
-
handleTabClick(e, i) {
|
|
26
|
-
if (i) return;
|
|
27
|
-
const t = this.activeTab;
|
|
28
|
-
this.activeTab = e, this._focusedIndex = this.tabs.findIndex((a) => a.id === e), this.dispatchEvent(
|
|
29
|
-
new CustomEvent("tab-change", {
|
|
30
|
-
detail: { oldTab: t, newTab: e },
|
|
31
|
-
bubbles: !0,
|
|
32
|
-
composed: !0
|
|
33
|
-
})
|
|
34
|
-
);
|
|
35
|
-
}
|
|
36
|
-
handleKeyDown(e) {
|
|
37
|
-
const { tabs: i } = this;
|
|
38
|
-
if (i.filter((s) => !s.disabled).length === 0) return;
|
|
39
|
-
let t = this._focusedIndex;
|
|
40
|
-
const a = this._focusedIndex;
|
|
41
|
-
switch (e.key) {
|
|
42
|
-
case "ArrowLeft":
|
|
43
|
-
e.preventDefault();
|
|
44
|
-
do
|
|
45
|
-
t = t > 0 ? t - 1 : i.length - 1;
|
|
46
|
-
while (i[t]?.disabled && t !== a);
|
|
47
|
-
break;
|
|
48
|
-
case "ArrowRight":
|
|
49
|
-
e.preventDefault();
|
|
50
|
-
do
|
|
51
|
-
t = t < i.length - 1 ? t + 1 : 0;
|
|
52
|
-
while (i[t]?.disabled && t !== a);
|
|
53
|
-
break;
|
|
54
|
-
case "Home":
|
|
55
|
-
for (e.preventDefault(), t = 0; i[t]?.disabled && t < i.length - 1; ) t++;
|
|
56
|
-
break;
|
|
57
|
-
case "End":
|
|
58
|
-
for (e.preventDefault(), t = i.length - 1; i[t]?.disabled && t > 0; ) t--;
|
|
59
|
-
break;
|
|
60
|
-
default:
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
if (t !== this._focusedIndex && !i[t]?.disabled) {
|
|
64
|
-
const s = this.activeTab;
|
|
65
|
-
this._focusedIndex = t, this.activeTab = i[t].id, this.updateComplete.then(() => {
|
|
66
|
-
this.shadowRoot?.querySelector(
|
|
67
|
-
`[role="tab"][data-tab-id="${i[t].id}"]`
|
|
68
|
-
)?.focus();
|
|
69
|
-
}), this.dispatchEvent(
|
|
70
|
-
new CustomEvent("tab-change", {
|
|
71
|
-
detail: { oldTab: s, newTab: i[t].id },
|
|
72
|
-
bubbles: !0,
|
|
73
|
-
composed: !0
|
|
74
|
-
})
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
scrollTabIntoView(e) {
|
|
79
|
-
this.updateComplete.then(() => {
|
|
80
|
-
const i = this.shadowRoot?.querySelector(
|
|
81
|
-
`[role="tab"][data-tab-id="${e}"]`
|
|
82
|
-
);
|
|
83
|
-
if (i && this.tablist) {
|
|
84
|
-
const t = this.tablist.getBoundingClientRect(), a = i.getBoundingClientRect();
|
|
85
|
-
a.left < t.left ? this.tablist.scrollLeft -= t.left - a.left + 16 : a.right > t.right && (this.tablist.scrollLeft += a.right - t.right + 16);
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
// ==================== RENDER ====================
|
|
90
|
-
renderTabButton(e, i) {
|
|
91
|
-
const t = this.activeTab === e.id, a = this._focusedIndex === i, s = [
|
|
92
|
-
"tab__button",
|
|
93
|
-
t ? "tab__button--active" : "",
|
|
94
|
-
e.disabled ? "tab__button--disabled" : ""
|
|
95
|
-
].filter(Boolean).join(" "), l = ["tab__label", t ? "" : "tab__label--inactive"].filter(Boolean).join(" "), d = ["tab__description", t ? "tab__description--active" : ""].filter(Boolean).join(" ");
|
|
96
|
-
return r`
|
|
97
|
-
<button
|
|
98
|
-
role="tab"
|
|
99
|
-
class=${s}
|
|
100
|
-
data-tab-id=${e.id}
|
|
101
|
-
aria-selected=${t ? "true" : "false"}
|
|
102
|
-
aria-controls="panel-${e.id}"
|
|
103
|
-
tabindex=${t || a ? "0" : "-1"}
|
|
104
|
-
?disabled=${e.disabled}
|
|
105
|
-
@click=${() => this.handleTabClick(e.id, e.disabled)}
|
|
106
|
-
@focus=${() => this.scrollTabIntoView(e.id)}
|
|
107
|
-
>
|
|
108
|
-
${e.icon ? r`<i class="${e.icon} tab__icon"></i>` : c}
|
|
109
|
-
<div class="tab__content">
|
|
110
|
-
<span class=${l}>${e.label}</span>
|
|
111
|
-
${e.description ? r`<span class=${d}>${e.description}</span>` : c}
|
|
112
|
-
</div>
|
|
113
|
-
</button>
|
|
114
|
-
`;
|
|
115
|
-
}
|
|
116
|
-
renderTabPanel(e) {
|
|
117
|
-
const i = this.activeTab === e.id;
|
|
118
|
-
if (!(!this.lazy || this._renderedTabs.has(e.id))) return c;
|
|
119
|
-
const a = ["tab__panel", i ? "" : "tab__panel--hidden"].filter(Boolean).join(" ");
|
|
120
|
-
return r`
|
|
121
|
-
<div
|
|
122
|
-
role="tabpanel"
|
|
123
|
-
id="panel-${e.id}"
|
|
124
|
-
aria-labelledby="tab-${e.id}"
|
|
125
|
-
class=${a}
|
|
126
|
-
tabindex="0"
|
|
127
|
-
>
|
|
128
|
-
<slot name=${`panel-${e.id}`}>
|
|
129
|
-
${typeof e.content == "string" ? r`${e.content}` : c}
|
|
130
|
-
</slot>
|
|
131
|
-
</div>
|
|
132
|
-
`;
|
|
133
|
-
}
|
|
134
|
-
render() {
|
|
135
|
-
return r`
|
|
136
|
-
<div class="tab">
|
|
137
|
-
<div role="tablist" aria-label="Tabs" class="tab__list" @keydown=${this.handleKeyDown}>
|
|
138
|
-
${this.tabs.map((e, i) => this.renderTabButton(e, i))}
|
|
139
|
-
</div>
|
|
140
|
-
<div class="tab__panels">${this.tabs.map((e) => this.renderTabPanel(e))}</div>
|
|
141
|
-
</div>
|
|
142
|
-
`;
|
|
143
|
-
}
|
|
144
|
-
};
|
|
145
|
-
o.styles = [
|
|
146
|
-
f`
|
|
147
|
-
${p(y)}
|
|
148
|
-
`
|
|
149
|
-
];
|
|
150
|
-
n([
|
|
151
|
-
b({ type: Array })
|
|
152
|
-
], o.prototype, "tabs", 2);
|
|
153
|
-
n([
|
|
154
|
-
b({ type: String })
|
|
155
|
-
], o.prototype, "activeTab", 2);
|
|
156
|
-
n([
|
|
157
|
-
b({ type: Boolean })
|
|
158
|
-
], o.prototype, "lazy", 2);
|
|
159
|
-
n([
|
|
160
|
-
b({ type: String })
|
|
161
|
-
], o.prototype, "variant", 2);
|
|
162
|
-
n([
|
|
163
|
-
h()
|
|
164
|
-
], o.prototype, "_focusedIndex", 2);
|
|
165
|
-
n([
|
|
166
|
-
h()
|
|
167
|
-
], o.prototype, "_renderedTabs", 2);
|
|
168
|
-
n([
|
|
169
|
-
_('[role="tablist"]')
|
|
170
|
-
], o.prototype, "tablist", 2);
|
|
171
|
-
o = n([
|
|
172
|
-
u("logosphere-tab")
|
|
173
|
-
], o);
|
|
174
|
-
export {
|
|
175
|
-
o as L
|
|
176
|
-
};
|