@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.
- package/AGENTS.md +1118 -0
- package/dist/AGENTS.md +1118 -0
- package/dist/atoms/Badge/badge.d.ts +1 -1
- package/dist/atoms/FormField/formfield.d.ts +10 -0
- package/dist/badge-BD_MRIBd.js +72 -0
- package/dist/badge-BV2hTvrI.cjs +13 -0
- package/dist/badge.cjs +1 -1
- package/dist/badge.js +1 -1
- package/dist/{breadcrumb-B-4yqoJZ.js → breadcrumb-BB61Xt0s.js} +3 -3
- package/dist/breadcrumb.js +1 -1
- package/dist/button-DRZ4sG4T.cjs +10 -0
- package/dist/button-Uu9oaieg.js +58 -0
- package/dist/button.cjs +1 -1
- package/dist/button.js +1 -1
- package/dist/calendar-CBJ4mtlE.js +652 -0
- package/dist/calendar-Coc9E6lD.cjs +88 -0
- package/dist/calendar.cjs +1 -0
- package/dist/calendar.js +4 -0
- package/dist/card-BD8FkSTi.cjs +43 -0
- package/dist/{card-CUhlTJyJ.js → card-CAAhjIjf.js} +26 -25
- package/dist/card.cjs +1 -1
- package/dist/card.js +1 -1
- package/dist/chatbot-BUYrJbTR.cjs +183 -0
- package/dist/chatbot-Cb2ByNkE.js +564 -0
- package/dist/chatbot.cjs +1 -1
- package/dist/chatbot.js +2 -2
- package/dist/{checkbox-7Rb3WKGx.js → checkbox-g6kl2jGR.js} +4 -4
- package/dist/checkbox.js +1 -1
- package/dist/combobox-G4TVTGS7.js +387 -0
- package/dist/combobox-kdjsT5eX.cjs +107 -0
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.js +1 -1
- package/dist/datepicker-Cf3gLMsu.cjs +85 -0
- package/dist/datepicker-n5dZbuCD.js +375 -0
- package/dist/datepicker.cjs +1 -1
- package/dist/datepicker.js +2 -2
- package/dist/{download-manager-A4fOxGWJ.js → download-manager-BPg-6Qfg.js} +4 -4
- package/dist/download-manager-DDeTYRPs.cjs +97 -0
- package/dist/download-manager.cjs +1 -1
- package/dist/download-manager.js +1 -1
- package/dist/drawer-CViKfr6O.js +114 -0
- package/dist/drawer-CjM-vX41.cjs +32 -0
- package/dist/drawer.cjs +1 -0
- package/dist/drawer.js +4 -0
- package/dist/formfield-CRcyUMvQ.cjs +33 -0
- package/dist/formfield-O327HYt0.js +154 -0
- package/dist/formfield.cjs +1 -1
- package/dist/formfield.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.js +43 -28
- package/dist/index.umd.js +1029 -512
- package/dist/input-BJtn_iTC.js +257 -0
- package/dist/input-DPTTu8ZR.cjs +59 -0
- package/dist/input.cjs +1 -1
- package/dist/input.js +1 -1
- package/dist/left-menu.cjs +1 -0
- package/dist/left-menu.js +5 -0
- package/dist/leftmenu-DpES_nr1.js +301 -0
- package/dist/leftmenu-RcrjiF7g.cjs +83 -0
- package/dist/modal-CsEaHz0h.cjs +84 -0
- package/dist/modal-DHzMgFVY.js +250 -0
- package/dist/modal.cjs +1 -1
- package/dist/modal.js +1 -1
- package/dist/molecules/Input/input.d.ts +7 -1
- package/dist/molecules/Pagination/index.d.ts +1 -0
- package/dist/molecules/Pagination/pagination.d.ts +60 -0
- package/dist/molecules/Popover/popover.d.ts +1 -0
- package/dist/molecules/Textarea/text-area.d.ts +5 -2
- package/dist/molecules/TimePicker/index.d.ts +2 -0
- package/dist/molecules/TimePicker/timepicker.d.ts +62 -0
- package/dist/organisms/Calendar/calendar.d.ts +54 -0
- package/dist/organisms/Calendar/index.d.ts +1 -0
- package/dist/organisms/Calendar/shared.d.ts +9 -0
- package/dist/organisms/Chatbot/chatbot.d.ts +10 -1
- package/dist/organisms/Chatbot/index.d.ts +1 -1
- package/dist/organisms/Combobox/combobox.d.ts +19 -0
- package/dist/organisms/DatePicker/datepicker.d.ts +33 -33
- package/dist/organisms/Drawer/drawer.d.ts +30 -0
- package/dist/organisms/Drawer/index.d.ts +1 -0
- package/dist/organisms/LeftMenu/index.d.ts +2 -0
- package/dist/organisms/LeftMenu/leftmenu-item.d.ts +14 -0
- package/dist/organisms/LeftMenu/leftmenu.d.ts +45 -0
- package/dist/organisms/Modal/modal.d.ts +29 -4
- package/dist/organisms/Toast/index.d.ts +2 -0
- package/dist/organisms/Toast/toast-container.d.ts +42 -0
- package/dist/organisms/Toast/toast.d.ts +48 -0
- package/dist/organisms/TreeMenu/index.d.ts +1 -0
- package/dist/organisms/TreeMenu/tree-menu.d.ts +41 -0
- package/dist/popover-BSfKsQni.js +143 -0
- package/dist/popover-DhEvLuOo.cjs +30 -0
- package/dist/popover.cjs +1 -1
- package/dist/popover.js +1 -1
- package/dist/styles/main.css +186 -182
- package/dist/switch-8RGGesy5.cjs +17 -0
- package/dist/switch-DNqPqH-R.js +64 -0
- package/dist/switch.cjs +1 -1
- package/dist/switch.js +1 -1
- package/dist/tab-BmrITzOL.cjs +40 -0
- package/dist/{tab-BKdN4xAz.js → tab-Ca_OyNqQ.js} +5 -5
- package/dist/tab.cjs +1 -1
- package/dist/tab.js +1 -1
- package/dist/text-area-BztUgBL1.cjs +51 -0
- package/dist/text-area-DUg5BGQh.js +235 -0
- package/dist/textarea.cjs +1 -1
- package/dist/textarea.js +1 -1
- package/dist/timepicker-BKUTi_AU.js +316 -0
- package/dist/timepicker-CRtoPBMn.cjs +119 -0
- package/dist/timepicker.cjs +1 -0
- package/dist/timepicker.js +4 -0
- package/dist/toast-container-CHrtU7X5.js +274 -0
- package/dist/toast-container-T77X56AG.cjs +64 -0
- package/dist/toast.cjs +1 -0
- package/dist/toast.js +6 -0
- package/dist/tree-menu-5dkAPsgJ.js +154 -0
- package/dist/tree-menu-CdNwvOjp.cjs +47 -0
- package/dist/tree-menu.cjs +1 -0
- package/dist/tree-menu.js +4 -0
- package/dist/ui-icon-DKZMrOTi.cjs +22 -0
- package/dist/ui-icon-DrrH0WhF.js +70 -0
- package/package.json +56 -12
- package/dist/badge-BbhaO73N.cjs +0 -13
- package/dist/badge-DE7Tgd8Z.js +0 -71
- package/dist/button-C1EwOosO.js +0 -58
- package/dist/button-CDRccsk9.cjs +0 -10
- package/dist/card-n8ka8Zk-.cjs +0 -43
- package/dist/chatbot-Ces7Xveb.js +0 -496
- package/dist/chatbot-oRwt64d8.cjs +0 -160
- package/dist/combobox-BJbI-Tgi.js +0 -268
- package/dist/combobox-pmE7bgEL.cjs +0 -99
- package/dist/datepicker-DFJx45C-.js +0 -750
- package/dist/datepicker-b9JGTTMx.cjs +0 -115
- package/dist/directive-Z_rhNYWK.js +0 -240
- package/dist/directive-ekjitgzi.cjs +0 -3
- package/dist/download-manager-BSIMTGaK.cjs +0 -97
- package/dist/formfield-D_7NFFoe.cjs +0 -27
- package/dist/formfield-d8fp9FTV.js +0 -118
- package/dist/input-ByllRq9M.js +0 -192
- package/dist/input-DsIOQPGV.cjs +0 -46
- package/dist/live-BX-yBGvT.cjs +0 -1
- package/dist/live-WTVSYE2F.js +0 -24
- package/dist/modal-Bfc6WQSL.js +0 -110
- package/dist/modal-DQ8VFL-P.cjs +0 -39
- package/dist/popover-C_Ob86CJ.cjs +0 -30
- package/dist/popover-D-FXdEdS.js +0 -1040
- package/dist/switch-Cpl53nRW.js +0 -64
- package/dist/switch-Rnnn10bn.cjs +0 -17
- package/dist/tab-DcjAlXzU.cjs +0 -40
- package/dist/text-area-CtZY3yLA.js +0 -204
- package/dist/text-area-DFDF5oos.cjs +0 -44
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
import { unsafeCSS as g, css as f, LitElement as v, nothing as p, html as h } from "lit";
|
|
2
|
+
import { property as n, state as b, customElement as T } from "lit/decorators.js";
|
|
3
|
+
import { repeat as y } from "lit/directives/repeat.js";
|
|
4
|
+
import "./ui-icon-DrrH0WhF.js";
|
|
5
|
+
import "./button-Uu9oaieg.js";
|
|
6
|
+
const _ = ".toast{position:relative;display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:start;width:100%;box-sizing:border-box;border-radius:var(--radius-md);border-left:4px solid var(--toast-accent);background:#fff;box-shadow:var(--shadow-md);padding:var(--spacing-4);color:#3d3d3d;font-family:var(--font-family-base);animation:toast-enter .22s cubic-bezier(.2,.8,.2,1);transform-origin:top right}.toast__icon{display:inline-flex;margin-top:2px;color:var(--toast-accent)}.toast__content{min-width:0}.toast__title{margin:0;font-size:var(--font-size-lg);line-height:var(--line-height-tight);font-weight:var(--font-weight-semibold)}.toast__title--as-text{font-size:var(--font-size-base);line-height:var(--line-height-normal);font-weight:var(--font-weight-regular);color:#555}.toast__text{margin:4px 0 0;font-size:var(--font-size-base);line-height:var(--line-height-normal);color:#555}.toast__actions{display:flex;gap:10px;margin-top:12px}.toast__close{border:0;background:transparent;color:#5a5a5a;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;margin-top:2px}.toast__close:hover{color:#2f2f2f}.toast--success{--toast-accent: var(--color-success-active)}.toast--danger{--toast-accent: var(--color-danger-active)}.toast--warning{--toast-accent: var(--color-warning-active)}.toast--info{--toast-accent: var(--color-info-active)}.toast[data-closing=true]{pointer-events:none;animation:toast-exit .22s cubic-bezier(.4,0,1,1) forwards}@keyframes toast-enter{0%{opacity:0;transform:translate3d(18px,-8px,0) scale(.98)}to{opacity:1;transform:translateZ(0) scale(1)}}@keyframes toast-exit{0%{opacity:1;transform:translateZ(0) scale(1);max-height:240px;margin-bottom:0}to{opacity:0;transform:translate3d(20px,-6px,0) scale(.97);max-height:0;margin-bottom:-12px}}";
|
|
7
|
+
var $ = Object.defineProperty, w = Object.getOwnPropertyDescriptor, a = (t, e, s, r) => {
|
|
8
|
+
for (var i = r > 1 ? void 0 : r ? w(e, s) : e, c = t.length - 1, l; c >= 0; c--)
|
|
9
|
+
(l = t[c]) && (i = (r ? l(e, s, i) : l(i)) || i);
|
|
10
|
+
return r && i && $(e, s, i), i;
|
|
11
|
+
};
|
|
12
|
+
const m = 6e3, C = 220, D = {
|
|
13
|
+
success: "uil-check-circle",
|
|
14
|
+
danger: "uil-exclamation-octagon",
|
|
15
|
+
warning: "uil-exclamation-triangle",
|
|
16
|
+
info: "uil-info-circle"
|
|
17
|
+
};
|
|
18
|
+
let o = class extends v {
|
|
19
|
+
constructor() {
|
|
20
|
+
super(...arguments), this.type = "info", this.title = "", this.text = "", this.icon = "", this.closeable = !0, this.duration = m, this.autoDismiss = !0, this.isClosing = !1, this.remainingMs = m, this.startedAt = 0;
|
|
21
|
+
}
|
|
22
|
+
connectedCallback() {
|
|
23
|
+
super.connectedCallback(), this.remainingMs = this.duration, this.startTimer();
|
|
24
|
+
}
|
|
25
|
+
disconnectedCallback() {
|
|
26
|
+
super.disconnectedCallback(), this.clearTimer(), this.closeTimerId && (clearTimeout(this.closeTimerId), this.closeTimerId = void 0);
|
|
27
|
+
}
|
|
28
|
+
updated(t) {
|
|
29
|
+
t.has("duration") && (this.remainingMs = this.duration, this.restartTimer()), (t.has("action") || t.has("autoDismiss") || t.has("type")) && this.restartTimer();
|
|
30
|
+
}
|
|
31
|
+
close(t = "manual") {
|
|
32
|
+
this.isClosing || (this.clearTimer(), this.isClosing = !0, this.closeTimerId = setTimeout(() => {
|
|
33
|
+
this.dispatchEvent(
|
|
34
|
+
new CustomEvent("toast-close", {
|
|
35
|
+
detail: { reason: t },
|
|
36
|
+
bubbles: !0,
|
|
37
|
+
composed: !0
|
|
38
|
+
})
|
|
39
|
+
);
|
|
40
|
+
}, C));
|
|
41
|
+
}
|
|
42
|
+
get canAutoDismiss() {
|
|
43
|
+
return this.autoDismiss && this.type !== "danger" && !this.hasActions;
|
|
44
|
+
}
|
|
45
|
+
get resolvedTitle() {
|
|
46
|
+
return this.title || this.text;
|
|
47
|
+
}
|
|
48
|
+
get resolvedText() {
|
|
49
|
+
return this.title ? this.text : "";
|
|
50
|
+
}
|
|
51
|
+
get resolvedIcon() {
|
|
52
|
+
return this.icon || D[this.type];
|
|
53
|
+
}
|
|
54
|
+
get hasActions() {
|
|
55
|
+
return !!this.action;
|
|
56
|
+
}
|
|
57
|
+
onActionClick(t) {
|
|
58
|
+
this.action && (t === "okay" ? this.action.onOkay?.() : this.action.onCancel?.(), (this.action.closeOnAction ?? !0) && this.close("manual"));
|
|
59
|
+
}
|
|
60
|
+
clearTimer() {
|
|
61
|
+
this.timerId && (clearTimeout(this.timerId), this.timerId = void 0);
|
|
62
|
+
}
|
|
63
|
+
startTimer() {
|
|
64
|
+
this.clearTimer(), !(!this.canAutoDismiss || this.remainingMs <= 0) && (this.startedAt = Date.now(), this.timerId = setTimeout(() => this.close("auto"), this.remainingMs));
|
|
65
|
+
}
|
|
66
|
+
pauseTimer() {
|
|
67
|
+
this.timerId && (this.clearTimer(), this.remainingMs = Math.max(0, this.remainingMs - (Date.now() - this.startedAt)));
|
|
68
|
+
}
|
|
69
|
+
resumeTimer() {
|
|
70
|
+
this.canAutoDismiss && this.startTimer();
|
|
71
|
+
}
|
|
72
|
+
restartTimer() {
|
|
73
|
+
this.clearTimer(), this.startTimer();
|
|
74
|
+
}
|
|
75
|
+
render() {
|
|
76
|
+
return h`
|
|
77
|
+
<article
|
|
78
|
+
class="toast toast--${this.type}"
|
|
79
|
+
data-closing=${this.isClosing ? "true" : "false"}
|
|
80
|
+
role="status"
|
|
81
|
+
aria-live=${this.type === "danger" ? "assertive" : "polite"}
|
|
82
|
+
@mouseenter=${this.pauseTimer}
|
|
83
|
+
@mouseleave=${this.resumeTimer}
|
|
84
|
+
>
|
|
85
|
+
<span class="toast__icon">
|
|
86
|
+
<ui-icon name=${this.resolvedIcon} size="20"></ui-icon>
|
|
87
|
+
</span>
|
|
88
|
+
|
|
89
|
+
<div class="toast__content">
|
|
90
|
+
<h4 class=${this.title ? "toast__title" : "toast__title toast__title--as-text"}>
|
|
91
|
+
${this.resolvedTitle}
|
|
92
|
+
</h4>
|
|
93
|
+
${this.resolvedText ? h`<p class="toast__text">${this.resolvedText}</p>` : p}
|
|
94
|
+
${this.hasActions ? h`
|
|
95
|
+
<div class="toast__actions">
|
|
96
|
+
<logosphere-button
|
|
97
|
+
variant="outline"
|
|
98
|
+
theme="primary"
|
|
99
|
+
@click=${() => this.onActionClick("okay")}
|
|
100
|
+
>
|
|
101
|
+
${this.action?.okayLabel || "Tamam"}
|
|
102
|
+
</logosphere-button>
|
|
103
|
+
<logosphere-button
|
|
104
|
+
variant="text"
|
|
105
|
+
theme="secondary"
|
|
106
|
+
@click=${() => this.onActionClick("cancel")}
|
|
107
|
+
>
|
|
108
|
+
${this.action?.cancelLabel || "İptal"}
|
|
109
|
+
</logosphere-button>
|
|
110
|
+
</div>
|
|
111
|
+
` : p}
|
|
112
|
+
</div>
|
|
113
|
+
|
|
114
|
+
${this.closeable ? h`
|
|
115
|
+
<button class="toast__close" @click=${() => this.close("manual")} aria-label="Close">
|
|
116
|
+
<ui-icon name="uil-times" size="20"></ui-icon>
|
|
117
|
+
</button>
|
|
118
|
+
` : p}
|
|
119
|
+
</article>
|
|
120
|
+
`;
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
o.styles = [
|
|
124
|
+
f`
|
|
125
|
+
${g(_)}
|
|
126
|
+
`
|
|
127
|
+
];
|
|
128
|
+
a([
|
|
129
|
+
n({ type: String })
|
|
130
|
+
], o.prototype, "type", 2);
|
|
131
|
+
a([
|
|
132
|
+
n({ type: String })
|
|
133
|
+
], o.prototype, "title", 2);
|
|
134
|
+
a([
|
|
135
|
+
n({ type: String })
|
|
136
|
+
], o.prototype, "text", 2);
|
|
137
|
+
a([
|
|
138
|
+
n({ type: String })
|
|
139
|
+
], o.prototype, "icon", 2);
|
|
140
|
+
a([
|
|
141
|
+
n({ type: Boolean })
|
|
142
|
+
], o.prototype, "closeable", 2);
|
|
143
|
+
a([
|
|
144
|
+
n({ type: Number })
|
|
145
|
+
], o.prototype, "duration", 2);
|
|
146
|
+
a([
|
|
147
|
+
n({ type: Boolean })
|
|
148
|
+
], o.prototype, "autoDismiss", 2);
|
|
149
|
+
a([
|
|
150
|
+
n({ attribute: !1 })
|
|
151
|
+
], o.prototype, "action", 2);
|
|
152
|
+
a([
|
|
153
|
+
b()
|
|
154
|
+
], o.prototype, "isClosing", 2);
|
|
155
|
+
o = a([
|
|
156
|
+
T("logosphere-toast")
|
|
157
|
+
], o);
|
|
158
|
+
const I = ":host{position:fixed;top:16px;right:16px;z-index:9999;width:min(420px,calc(100vw - 24px));box-sizing:border-box}.toast-container{display:flex;flex-direction:column;gap:12px}";
|
|
159
|
+
var A = Object.defineProperty, S = Object.getOwnPropertyDescriptor, x = (t, e, s, r) => {
|
|
160
|
+
for (var i = r > 1 ? void 0 : r ? S(e, s) : e, c = t.length - 1, l; c >= 0; c--)
|
|
161
|
+
(l = t[c]) && (i = (r ? l(e, s, i) : l(i)) || i);
|
|
162
|
+
return r && i && A(e, s, i), i;
|
|
163
|
+
};
|
|
164
|
+
const d = 4;
|
|
165
|
+
let u = class extends v {
|
|
166
|
+
constructor() {
|
|
167
|
+
super(...arguments), this.visibleToasts = [], this.queuedToasts = [];
|
|
168
|
+
}
|
|
169
|
+
show(t) {
|
|
170
|
+
const e = this.toToast(t);
|
|
171
|
+
return this.visibleToasts.length < d ? (this.visibleToasts = [e, ...this.visibleToasts], e.id) : (this.queuedToasts.push(e), e.id);
|
|
172
|
+
}
|
|
173
|
+
close(t) {
|
|
174
|
+
const e = this.visibleToasts.findIndex((s) => s.id === t);
|
|
175
|
+
if (e !== -1) {
|
|
176
|
+
const s = this.visibleToasts.slice();
|
|
177
|
+
s.splice(e, 1), this.visibleToasts = s, this.dequeue();
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
this.queuedToasts = this.queuedToasts.filter((s) => s.id !== t);
|
|
181
|
+
}
|
|
182
|
+
clear() {
|
|
183
|
+
this.visibleToasts = [], this.queuedToasts = [];
|
|
184
|
+
}
|
|
185
|
+
dequeue() {
|
|
186
|
+
if (!this.queuedToasts.length || this.visibleToasts.length >= d) return;
|
|
187
|
+
const t = this.queuedToasts.shift();
|
|
188
|
+
t && (this.visibleToasts = [t, ...this.visibleToasts]);
|
|
189
|
+
}
|
|
190
|
+
toToast(t) {
|
|
191
|
+
return {
|
|
192
|
+
id: t.id || this.createId(),
|
|
193
|
+
type: t.type || "info",
|
|
194
|
+
title: t.title || "",
|
|
195
|
+
text: t.text,
|
|
196
|
+
icon: t.icon || "",
|
|
197
|
+
closeable: t.closeable ?? !0,
|
|
198
|
+
autoDismiss: t.autoDismiss ?? !0,
|
|
199
|
+
duration: t.duration ?? 6e3,
|
|
200
|
+
action: t.action
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
createId() {
|
|
204
|
+
return `toast-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
205
|
+
}
|
|
206
|
+
render() {
|
|
207
|
+
return h`
|
|
208
|
+
<div class="toast-container" role="region" aria-label="Notifications">
|
|
209
|
+
${y(
|
|
210
|
+
this.visibleToasts,
|
|
211
|
+
(t) => t.id,
|
|
212
|
+
(t) => h`
|
|
213
|
+
<logosphere-toast
|
|
214
|
+
.type=${t.type}
|
|
215
|
+
.title=${t.title}
|
|
216
|
+
.text=${t.text}
|
|
217
|
+
.icon=${t.icon}
|
|
218
|
+
.closeable=${t.closeable}
|
|
219
|
+
.autoDismiss=${t.autoDismiss}
|
|
220
|
+
.duration=${t.duration}
|
|
221
|
+
.action=${t.action}
|
|
222
|
+
@toast-close=${() => this.close(t.id)}
|
|
223
|
+
>
|
|
224
|
+
</logosphere-toast>
|
|
225
|
+
`
|
|
226
|
+
)}
|
|
227
|
+
</div>
|
|
228
|
+
`;
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
u.styles = [f`${g(I)}`];
|
|
232
|
+
x([
|
|
233
|
+
b()
|
|
234
|
+
], u.prototype, "visibleToasts", 2);
|
|
235
|
+
u = x([
|
|
236
|
+
T("logosphere-toast-container")
|
|
237
|
+
], u);
|
|
238
|
+
class E {
|
|
239
|
+
static show(e) {
|
|
240
|
+
return this.getContainer().show(e);
|
|
241
|
+
}
|
|
242
|
+
static success(e) {
|
|
243
|
+
return this.show({ ...e, type: "success" });
|
|
244
|
+
}
|
|
245
|
+
static danger(e) {
|
|
246
|
+
return this.show({ ...e, type: "danger", autoDismiss: !1 });
|
|
247
|
+
}
|
|
248
|
+
static warning(e) {
|
|
249
|
+
return this.show({ ...e, type: "warning" });
|
|
250
|
+
}
|
|
251
|
+
static info(e) {
|
|
252
|
+
return this.show({ ...e, type: "info" });
|
|
253
|
+
}
|
|
254
|
+
static close(e) {
|
|
255
|
+
this.getContainer().close(e);
|
|
256
|
+
}
|
|
257
|
+
static clear() {
|
|
258
|
+
this.getContainer().clear();
|
|
259
|
+
}
|
|
260
|
+
static getContainer() {
|
|
261
|
+
if (this.container && document.body.contains(this.container))
|
|
262
|
+
return this.container;
|
|
263
|
+
const e = document.querySelector("logosphere-toast-container");
|
|
264
|
+
if (e && e instanceof u)
|
|
265
|
+
return this.container = e, e;
|
|
266
|
+
const s = document.createElement("logosphere-toast-container");
|
|
267
|
+
return document.body.appendChild(s), this.container = s, s;
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
export {
|
|
271
|
+
o as L,
|
|
272
|
+
E as T,
|
|
273
|
+
u as a
|
|
274
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";const o=require("lit"),a=require("lit/decorators.js"),m=require("lit/directives/repeat.js");require("./ui-icon-DKZMrOTi.cjs");require("./button-DRZ4sG4T.cjs");const d=".toast{position:relative;display:grid;grid-template-columns:auto 1fr auto;gap:12px;align-items:start;width:100%;box-sizing:border-box;border-radius:var(--radius-md);border-left:4px solid var(--toast-accent);background:#fff;box-shadow:var(--shadow-md);padding:var(--spacing-4);color:#3d3d3d;font-family:var(--font-family-base);animation:toast-enter .22s cubic-bezier(.2,.8,.2,1);transform-origin:top right}.toast__icon{display:inline-flex;margin-top:2px;color:var(--toast-accent)}.toast__content{min-width:0}.toast__title{margin:0;font-size:var(--font-size-lg);line-height:var(--line-height-tight);font-weight:var(--font-weight-semibold)}.toast__title--as-text{font-size:var(--font-size-base);line-height:var(--line-height-normal);font-weight:var(--font-weight-regular);color:#555}.toast__text{margin:4px 0 0;font-size:var(--font-size-base);line-height:var(--line-height-normal);color:#555}.toast__actions{display:flex;gap:10px;margin-top:12px}.toast__close{border:0;background:transparent;color:#5a5a5a;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;margin-top:2px}.toast__close:hover{color:#2f2f2f}.toast--success{--toast-accent: var(--color-success-active)}.toast--danger{--toast-accent: var(--color-danger-active)}.toast--warning{--toast-accent: var(--color-warning-active)}.toast--info{--toast-accent: var(--color-info-active)}.toast[data-closing=true]{pointer-events:none;animation:toast-exit .22s cubic-bezier(.4,0,1,1) forwards}@keyframes toast-enter{0%{opacity:0;transform:translate3d(18px,-8px,0) scale(.98)}to{opacity:1;transform:translateZ(0) scale(1)}}@keyframes toast-exit{0%{opacity:1;transform:translateZ(0) scale(1);max-height:240px;margin-bottom:0}to{opacity:0;transform:translate3d(20px,-6px,0) scale(.97);max-height:0;margin-bottom:-12px}}";var g=Object.defineProperty,f=Object.getOwnPropertyDescriptor,r=(n,t,e,s)=>{for(var i=s>1?void 0:s?f(t,e):t,c=n.length-1,l;c>=0;c--)(l=n[c])&&(i=(s?l(t,e,i):l(i))||i);return s&&i&&g(t,e,i),i};const h=6e3,T=220,v={success:"uil-check-circle",danger:"uil-exclamation-octagon",warning:"uil-exclamation-triangle",info:"uil-info-circle"};exports.LogosphereToast=class extends o.LitElement{constructor(){super(...arguments),this.type="info",this.title="",this.text="",this.icon="",this.closeable=!0,this.duration=h,this.autoDismiss=!0,this.isClosing=!1,this.remainingMs=h,this.startedAt=0}connectedCallback(){super.connectedCallback(),this.remainingMs=this.duration,this.startTimer()}disconnectedCallback(){super.disconnectedCallback(),this.clearTimer(),this.closeTimerId&&(clearTimeout(this.closeTimerId),this.closeTimerId=void 0)}updated(t){t.has("duration")&&(this.remainingMs=this.duration,this.restartTimer()),(t.has("action")||t.has("autoDismiss")||t.has("type"))&&this.restartTimer()}close(t="manual"){this.isClosing||(this.clearTimer(),this.isClosing=!0,this.closeTimerId=setTimeout(()=>{this.dispatchEvent(new CustomEvent("toast-close",{detail:{reason:t},bubbles:!0,composed:!0}))},T))}get canAutoDismiss(){return this.autoDismiss&&this.type!=="danger"&&!this.hasActions}get resolvedTitle(){return this.title||this.text}get resolvedText(){return this.title?this.text:""}get resolvedIcon(){return this.icon||v[this.type]}get hasActions(){return!!this.action}onActionClick(t){this.action&&(t==="okay"?this.action.onOkay?.():this.action.onCancel?.(),(this.action.closeOnAction??!0)&&this.close("manual"))}clearTimer(){this.timerId&&(clearTimeout(this.timerId),this.timerId=void 0)}startTimer(){this.clearTimer(),!(!this.canAutoDismiss||this.remainingMs<=0)&&(this.startedAt=Date.now(),this.timerId=setTimeout(()=>this.close("auto"),this.remainingMs))}pauseTimer(){this.timerId&&(this.clearTimer(),this.remainingMs=Math.max(0,this.remainingMs-(Date.now()-this.startedAt)))}resumeTimer(){this.canAutoDismiss&&this.startTimer()}restartTimer(){this.clearTimer(),this.startTimer()}render(){return o.html`
|
|
2
|
+
<article
|
|
3
|
+
class="toast toast--${this.type}"
|
|
4
|
+
data-closing=${this.isClosing?"true":"false"}
|
|
5
|
+
role="status"
|
|
6
|
+
aria-live=${this.type==="danger"?"assertive":"polite"}
|
|
7
|
+
@mouseenter=${this.pauseTimer}
|
|
8
|
+
@mouseleave=${this.resumeTimer}
|
|
9
|
+
>
|
|
10
|
+
<span class="toast__icon">
|
|
11
|
+
<ui-icon name=${this.resolvedIcon} size="20"></ui-icon>
|
|
12
|
+
</span>
|
|
13
|
+
|
|
14
|
+
<div class="toast__content">
|
|
15
|
+
<h4 class=${this.title?"toast__title":"toast__title toast__title--as-text"}>
|
|
16
|
+
${this.resolvedTitle}
|
|
17
|
+
</h4>
|
|
18
|
+
${this.resolvedText?o.html`<p class="toast__text">${this.resolvedText}</p>`:o.nothing}
|
|
19
|
+
${this.hasActions?o.html`
|
|
20
|
+
<div class="toast__actions">
|
|
21
|
+
<logosphere-button
|
|
22
|
+
variant="outline"
|
|
23
|
+
theme="primary"
|
|
24
|
+
@click=${()=>this.onActionClick("okay")}
|
|
25
|
+
>
|
|
26
|
+
${this.action?.okayLabel||"Tamam"}
|
|
27
|
+
</logosphere-button>
|
|
28
|
+
<logosphere-button
|
|
29
|
+
variant="text"
|
|
30
|
+
theme="secondary"
|
|
31
|
+
@click=${()=>this.onActionClick("cancel")}
|
|
32
|
+
>
|
|
33
|
+
${this.action?.cancelLabel||"İptal"}
|
|
34
|
+
</logosphere-button>
|
|
35
|
+
</div>
|
|
36
|
+
`:o.nothing}
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
${this.closeable?o.html`
|
|
40
|
+
<button class="toast__close" @click=${()=>this.close("manual")} aria-label="Close">
|
|
41
|
+
<ui-icon name="uil-times" size="20"></ui-icon>
|
|
42
|
+
</button>
|
|
43
|
+
`:o.nothing}
|
|
44
|
+
</article>
|
|
45
|
+
`}};exports.LogosphereToast.styles=[o.css`
|
|
46
|
+
${o.unsafeCSS(d)}
|
|
47
|
+
`];r([a.property({type:String})],exports.LogosphereToast.prototype,"type",2);r([a.property({type:String})],exports.LogosphereToast.prototype,"title",2);r([a.property({type:String})],exports.LogosphereToast.prototype,"text",2);r([a.property({type:String})],exports.LogosphereToast.prototype,"icon",2);r([a.property({type:Boolean})],exports.LogosphereToast.prototype,"closeable",2);r([a.property({type:Number})],exports.LogosphereToast.prototype,"duration",2);r([a.property({type:Boolean})],exports.LogosphereToast.prototype,"autoDismiss",2);r([a.property({attribute:!1})],exports.LogosphereToast.prototype,"action",2);r([a.state()],exports.LogosphereToast.prototype,"isClosing",2);exports.LogosphereToast=r([a.customElement("logosphere-toast")],exports.LogosphereToast);const b=":host{position:fixed;top:16px;right:16px;z-index:9999;width:min(420px,calc(100vw - 24px));box-sizing:border-box}.toast-container{display:flex;flex-direction:column;gap:12px}";var y=Object.defineProperty,x=Object.getOwnPropertyDescriptor,p=(n,t,e,s)=>{for(var i=s>1?void 0:s?x(t,e):t,c=n.length-1,l;c>=0;c--)(l=n[c])&&(i=(s?l(t,e,i):l(i))||i);return s&&i&&y(t,e,i),i};const u=4;exports.LogosphereToastContainer=class extends o.LitElement{constructor(){super(...arguments),this.visibleToasts=[],this.queuedToasts=[]}show(t){const e=this.toToast(t);return this.visibleToasts.length<u?(this.visibleToasts=[e,...this.visibleToasts],e.id):(this.queuedToasts.push(e),e.id)}close(t){const e=this.visibleToasts.findIndex(s=>s.id===t);if(e!==-1){const s=this.visibleToasts.slice();s.splice(e,1),this.visibleToasts=s,this.dequeue();return}this.queuedToasts=this.queuedToasts.filter(s=>s.id!==t)}clear(){this.visibleToasts=[],this.queuedToasts=[]}dequeue(){if(!this.queuedToasts.length||this.visibleToasts.length>=u)return;const t=this.queuedToasts.shift();t&&(this.visibleToasts=[t,...this.visibleToasts])}toToast(t){return{id:t.id||this.createId(),type:t.type||"info",title:t.title||"",text:t.text,icon:t.icon||"",closeable:t.closeable??!0,autoDismiss:t.autoDismiss??!0,duration:t.duration??6e3,action:t.action}}createId(){return`toast-${Date.now()}-${Math.random().toString(36).slice(2,8)}`}render(){return o.html`
|
|
48
|
+
<div class="toast-container" role="region" aria-label="Notifications">
|
|
49
|
+
${m.repeat(this.visibleToasts,t=>t.id,t=>o.html`
|
|
50
|
+
<logosphere-toast
|
|
51
|
+
.type=${t.type}
|
|
52
|
+
.title=${t.title}
|
|
53
|
+
.text=${t.text}
|
|
54
|
+
.icon=${t.icon}
|
|
55
|
+
.closeable=${t.closeable}
|
|
56
|
+
.autoDismiss=${t.autoDismiss}
|
|
57
|
+
.duration=${t.duration}
|
|
58
|
+
.action=${t.action}
|
|
59
|
+
@toast-close=${()=>this.close(t.id)}
|
|
60
|
+
>
|
|
61
|
+
</logosphere-toast>
|
|
62
|
+
`)}
|
|
63
|
+
</div>
|
|
64
|
+
`}};exports.LogosphereToastContainer.styles=[o.css`${o.unsafeCSS(b)}`];p([a.state()],exports.LogosphereToastContainer.prototype,"visibleToasts",2);exports.LogosphereToastContainer=p([a.customElement("logosphere-toast-container")],exports.LogosphereToastContainer);class _{static show(t){return this.getContainer().show(t)}static success(t){return this.show({...t,type:"success"})}static danger(t){return this.show({...t,type:"danger",autoDismiss:!1})}static warning(t){return this.show({...t,type:"warning"})}static info(t){return this.show({...t,type:"info"})}static close(t){this.getContainer().close(t)}static clear(){this.getContainer().clear()}static getContainer(){if(this.container&&document.body.contains(this.container))return this.container;const t=document.querySelector("logosphere-toast-container");if(t&&t instanceof exports.LogosphereToastContainer)return this.container=t,t;const e=document.createElement("logosphere-toast-container");return document.body.appendChild(e),this.container=e,e}}exports.ToastService=_;
|
package/dist/toast.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./toast-container-T77X56AG.cjs");Object.defineProperty(exports,"LogosphereToast",{enumerable:!0,get:()=>e.LogosphereToast});Object.defineProperty(exports,"LogosphereToastContainer",{enumerable:!0,get:()=>e.LogosphereToastContainer});exports.ToastService=e.ToastService;
|
package/dist/toast.js
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { unsafeCSS as p, css as _, LitElement as u, html as a, nothing as c } from "lit";
|
|
2
|
+
import { property as d, state as v, customElement as g } from "lit/decorators.js";
|
|
3
|
+
import { unsafeHTML as b } from "lit/directives/unsafe-html.js";
|
|
4
|
+
import "./ui-icon-DrrH0WhF.js";
|
|
5
|
+
const f = ".tree{width:100%;font-family:var(--font-family-base)}.tree__list,.tree__children{list-style:none;margin:0;padding:0}.tree__item{margin:0;padding:0}.tree__row{display:flex;align-items:center;gap:var(--spacing-1);padding:var(--spacing-2) var(--spacing-3);padding-left:calc(var(--spacing-3) + (var(--tree-level, 0) * 14px));border-radius:var(--radius-sm);color:var(--color-body-color);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--transition-speed-fast) var(--transition-timing)}.tree--icons .tree__row{justify-content:center;padding:0;width:44px;height:44px;min-height:44px;margin:0 auto}.tree__row:hover{background-color:var(--color-light)}.tree__row:focus-visible{outline:2px solid var(--color-secondary);outline-offset:1px}.tree__row--disabled{opacity:.5;cursor:not-allowed}.tree__row--active .tree__label,.tree__row--active .tree__icon{color:var(--color-primary)}.tree:not(.tree--icons) .tree__row--active{background-color:var(--color-light)}.tree__icon{width:20px;min-width:20px;display:inline-flex;align-items:center;justify-content:center;color:inherit}.tree--icons .tree__icon{width:20px;min-width:20px;height:20px}.tree--icons .tree__row--active{background-color:var(--color-primary)}.tree--icons .tree__row--active .tree__icon{color:#fff}.tree--icons .tree__row--active:hover{background-color:var(--color-primary-hover)}.tree__chevron-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border:none;background:transparent;color:var(--color-tertiary);cursor:pointer;padding:0;flex-shrink:0}.tree__chevron-btn--right{margin-left:auto}.tree__chevron{transform:rotate(-90deg);transition:transform var(--transition-speed-fast) var(--transition-timing)}.tree__chevron--open{transform:rotate(0)}.tree__chevron-spacer{width:20px;height:20px;flex-shrink:0}.tree__label{display:inline-flex;align-items:center;font-size:var(--font-size-sm);color:inherit}";
|
|
6
|
+
var w = Object.defineProperty, x = Object.getOwnPropertyDescriptor, l = (e, t, r, n) => {
|
|
7
|
+
for (var o = n > 1 ? void 0 : n ? x(t, r) : t, s = e.length - 1, h; s >= 0; s--)
|
|
8
|
+
(h = e[s]) && (o = (n ? h(t, r, o) : h(o)) || o);
|
|
9
|
+
return n && o && w(t, r, o), o;
|
|
10
|
+
};
|
|
11
|
+
let i = class extends u {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments), this.items = [], this.expandedIds = [], this.expandOnLabelClick = !0, this.chevronPosition = "left", this.showLabels = !0, this.iconSize = 16, this._expandedSet = /* @__PURE__ */ new Set();
|
|
14
|
+
}
|
|
15
|
+
willUpdate(e) {
|
|
16
|
+
e.has("expandedIds") && (this._expandedSet = new Set(this.expandedIds ?? []));
|
|
17
|
+
}
|
|
18
|
+
_isExpanded(e) {
|
|
19
|
+
return this._expandedSet.has(e);
|
|
20
|
+
}
|
|
21
|
+
_emitToggle(e, t) {
|
|
22
|
+
this.dispatchEvent(
|
|
23
|
+
new CustomEvent("toggle", {
|
|
24
|
+
detail: { item: e, expanded: t },
|
|
25
|
+
bubbles: !0,
|
|
26
|
+
composed: !0
|
|
27
|
+
})
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
_emitItemClick(e) {
|
|
31
|
+
this.dispatchEvent(
|
|
32
|
+
new CustomEvent("item-click", {
|
|
33
|
+
detail: { item: e },
|
|
34
|
+
bubbles: !0,
|
|
35
|
+
composed: !0
|
|
36
|
+
})
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
_emitNodeClick(e, t) {
|
|
40
|
+
this.dispatchEvent(
|
|
41
|
+
new CustomEvent("node-click", {
|
|
42
|
+
detail: { item: e, hasChildren: t },
|
|
43
|
+
bubbles: !0,
|
|
44
|
+
composed: !0
|
|
45
|
+
})
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
_setExpanded(e, t) {
|
|
49
|
+
t ? this._expandedSet.add(e.id) : this._expandedSet.delete(e.id), this.expandedIds = Array.from(this._expandedSet), this._emitToggle(e, t);
|
|
50
|
+
}
|
|
51
|
+
_toggle(e, t) {
|
|
52
|
+
t.stopPropagation(), !(e.disabled || !e.children?.length) && this._setExpanded(e, !this._isExpanded(e.id));
|
|
53
|
+
}
|
|
54
|
+
_handleItemClick(e, t) {
|
|
55
|
+
if (t.stopPropagation(), e.disabled) return;
|
|
56
|
+
const r = !!e.children?.length;
|
|
57
|
+
if (this._emitNodeClick(e, r), r && this.expandOnLabelClick) {
|
|
58
|
+
this._setExpanded(e, !this._isExpanded(e.id));
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
r || (e.onClick?.(e), this._emitItemClick(e));
|
|
62
|
+
}
|
|
63
|
+
_handleRowKeydown(e, t) {
|
|
64
|
+
t.key !== "Enter" && t.key !== " " || (t.preventDefault(), this._handleItemClick(e, t));
|
|
65
|
+
}
|
|
66
|
+
_renderIcon(e) {
|
|
67
|
+
return e.iconName ? a`
|
|
68
|
+
<span class="tree__icon">
|
|
69
|
+
<ui-icon name=${e.iconName} .size=${this.iconSize}></ui-icon>
|
|
70
|
+
</span>
|
|
71
|
+
` : e.iconHtml ? a`<span class="tree__icon">${b(e.iconHtml)}</span>` : c;
|
|
72
|
+
}
|
|
73
|
+
_renderChevron(e, t) {
|
|
74
|
+
const r = !!e.children?.length;
|
|
75
|
+
return this.showLabels ? r ? a`
|
|
76
|
+
<button
|
|
77
|
+
type="button"
|
|
78
|
+
class="tree__chevron-btn ${this.chevronPosition === "right" ? "tree__chevron-btn--right" : ""}"
|
|
79
|
+
aria-label=${t ? "Collapse" : "Expand"}
|
|
80
|
+
@click=${(n) => this._toggle(e, n)}
|
|
81
|
+
>
|
|
82
|
+
<ui-icon
|
|
83
|
+
class="tree__chevron ${t ? "tree__chevron--open" : ""}"
|
|
84
|
+
name="uil-angle-down"
|
|
85
|
+
size="20"
|
|
86
|
+
></ui-icon>
|
|
87
|
+
</button>
|
|
88
|
+
` : a`<span class="tree__chevron-spacer"></span>` : c;
|
|
89
|
+
}
|
|
90
|
+
_renderNode(e, t) {
|
|
91
|
+
const r = !!e.children?.length, n = r ? this._isExpanded(e.id) : !1, o = this.showLabels ? `--tree-level:${t};` : "--tree-level:0;";
|
|
92
|
+
return a`
|
|
93
|
+
<li class="tree__item">
|
|
94
|
+
<div
|
|
95
|
+
class="tree__row ${e.disabled ? "tree__row--disabled" : ""} ${e.active ? "tree__row--active" : ""}"
|
|
96
|
+
style=${o}
|
|
97
|
+
role="button"
|
|
98
|
+
tabindex=${e.disabled ? -1 : 0}
|
|
99
|
+
@click=${(s) => this._handleItemClick(e, s)}
|
|
100
|
+
@keydown=${(s) => this._handleRowKeydown(e, s)}
|
|
101
|
+
title=${this.showLabels ? "" : e.label}
|
|
102
|
+
>
|
|
103
|
+
${this.chevronPosition === "left" ? this._renderChevron(e, n) : c}
|
|
104
|
+
${this._renderIcon(e)}
|
|
105
|
+
${this.showLabels ? a`<span class="tree__label">${e.label}</span>` : c}
|
|
106
|
+
${this.chevronPosition === "right" ? this._renderChevron(e, n) : c}
|
|
107
|
+
</div>
|
|
108
|
+
|
|
109
|
+
${this.showLabels && r && n ? a`
|
|
110
|
+
<ul class="tree__children">
|
|
111
|
+
${e.children.map((s) => this._renderNode(s, t + 1))}
|
|
112
|
+
</ul>
|
|
113
|
+
` : c}
|
|
114
|
+
</li>
|
|
115
|
+
`;
|
|
116
|
+
}
|
|
117
|
+
render() {
|
|
118
|
+
return a`
|
|
119
|
+
<nav class="tree ${this.showLabels ? "" : "tree--icons"}" aria-label="Tree Menu">
|
|
120
|
+
<ul class="tree__list">
|
|
121
|
+
${this.items.map((e) => this._renderNode(e, 0))}
|
|
122
|
+
</ul>
|
|
123
|
+
</nav>
|
|
124
|
+
`;
|
|
125
|
+
}
|
|
126
|
+
};
|
|
127
|
+
i.styles = [_`${p(f)}`];
|
|
128
|
+
l([
|
|
129
|
+
d({ attribute: !1 })
|
|
130
|
+
], i.prototype, "items", 2);
|
|
131
|
+
l([
|
|
132
|
+
d({ type: Array })
|
|
133
|
+
], i.prototype, "expandedIds", 2);
|
|
134
|
+
l([
|
|
135
|
+
d({ type: Boolean })
|
|
136
|
+
], i.prototype, "expandOnLabelClick", 2);
|
|
137
|
+
l([
|
|
138
|
+
d({ type: String })
|
|
139
|
+
], i.prototype, "chevronPosition", 2);
|
|
140
|
+
l([
|
|
141
|
+
d({ type: Boolean })
|
|
142
|
+
], i.prototype, "showLabels", 2);
|
|
143
|
+
l([
|
|
144
|
+
d({ type: Number })
|
|
145
|
+
], i.prototype, "iconSize", 2);
|
|
146
|
+
l([
|
|
147
|
+
v()
|
|
148
|
+
], i.prototype, "_expandedSet", 2);
|
|
149
|
+
i = l([
|
|
150
|
+
g("logosphere-tree-menu")
|
|
151
|
+
], i);
|
|
152
|
+
export {
|
|
153
|
+
i as T
|
|
154
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";const r=require("lit"),s=require("lit/decorators.js"),d=require("lit/directives/unsafe-html.js");require("./ui-icon-DKZMrOTi.cjs");const h=".tree{width:100%;font-family:var(--font-family-base)}.tree__list,.tree__children{list-style:none;margin:0;padding:0}.tree__item{margin:0;padding:0}.tree__row{display:flex;align-items:center;gap:var(--spacing-1);padding:var(--spacing-2) var(--spacing-3);padding-left:calc(var(--spacing-3) + (var(--tree-level, 0) * 14px));border-radius:var(--radius-sm);color:var(--color-body-color);cursor:pointer;-webkit-user-select:none;user-select:none;transition:background-color var(--transition-speed-fast) var(--transition-timing)}.tree--icons .tree__row{justify-content:center;padding:0;width:44px;height:44px;min-height:44px;margin:0 auto}.tree__row:hover{background-color:var(--color-light)}.tree__row:focus-visible{outline:2px solid var(--color-secondary);outline-offset:1px}.tree__row--disabled{opacity:.5;cursor:not-allowed}.tree__row--active .tree__label,.tree__row--active .tree__icon{color:var(--color-primary)}.tree:not(.tree--icons) .tree__row--active{background-color:var(--color-light)}.tree__icon{width:20px;min-width:20px;display:inline-flex;align-items:center;justify-content:center;color:inherit}.tree--icons .tree__icon{width:20px;min-width:20px;height:20px}.tree--icons .tree__row--active{background-color:var(--color-primary)}.tree--icons .tree__row--active .tree__icon{color:#fff}.tree--icons .tree__row--active:hover{background-color:var(--color-primary-hover)}.tree__chevron-btn{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;border:none;background:transparent;color:var(--color-tertiary);cursor:pointer;padding:0;flex-shrink:0}.tree__chevron-btn--right{margin-left:auto}.tree__chevron{transform:rotate(-90deg);transition:transform var(--transition-speed-fast) var(--transition-timing)}.tree__chevron--open{transform:rotate(0)}.tree__chevron-spacer{width:20px;height:20px;flex-shrink:0}.tree__label{display:inline-flex;align-items:center;font-size:var(--font-size-sm);color:inherit}";var p=Object.defineProperty,_=Object.getOwnPropertyDescriptor,a=(c,e,t,n)=>{for(var i=n>1?void 0:n?_(e,t):e,l=c.length-1,o;l>=0;l--)(o=c[l])&&(i=(n?o(e,t,i):o(i))||i);return n&&i&&p(e,t,i),i};exports.TreeMenu=class extends r.LitElement{constructor(){super(...arguments),this.items=[],this.expandedIds=[],this.expandOnLabelClick=!0,this.chevronPosition="left",this.showLabels=!0,this.iconSize=16,this._expandedSet=new Set}willUpdate(e){e.has("expandedIds")&&(this._expandedSet=new Set(this.expandedIds??[]))}_isExpanded(e){return this._expandedSet.has(e)}_emitToggle(e,t){this.dispatchEvent(new CustomEvent("toggle",{detail:{item:e,expanded:t},bubbles:!0,composed:!0}))}_emitItemClick(e){this.dispatchEvent(new CustomEvent("item-click",{detail:{item:e},bubbles:!0,composed:!0}))}_emitNodeClick(e,t){this.dispatchEvent(new CustomEvent("node-click",{detail:{item:e,hasChildren:t},bubbles:!0,composed:!0}))}_setExpanded(e,t){t?this._expandedSet.add(e.id):this._expandedSet.delete(e.id),this.expandedIds=Array.from(this._expandedSet),this._emitToggle(e,t)}_toggle(e,t){t.stopPropagation(),!(e.disabled||!e.children?.length)&&this._setExpanded(e,!this._isExpanded(e.id))}_handleItemClick(e,t){if(t.stopPropagation(),e.disabled)return;const n=!!e.children?.length;if(this._emitNodeClick(e,n),n&&this.expandOnLabelClick){this._setExpanded(e,!this._isExpanded(e.id));return}n||(e.onClick?.(e),this._emitItemClick(e))}_handleRowKeydown(e,t){t.key!=="Enter"&&t.key!==" "||(t.preventDefault(),this._handleItemClick(e,t))}_renderIcon(e){return e.iconName?r.html`
|
|
2
|
+
<span class="tree__icon">
|
|
3
|
+
<ui-icon name=${e.iconName} .size=${this.iconSize}></ui-icon>
|
|
4
|
+
</span>
|
|
5
|
+
`:e.iconHtml?r.html`<span class="tree__icon">${d.unsafeHTML(e.iconHtml)}</span>`:r.nothing}_renderChevron(e,t){const n=!!e.children?.length;return this.showLabels?n?r.html`
|
|
6
|
+
<button
|
|
7
|
+
type="button"
|
|
8
|
+
class="tree__chevron-btn ${this.chevronPosition==="right"?"tree__chevron-btn--right":""}"
|
|
9
|
+
aria-label=${t?"Collapse":"Expand"}
|
|
10
|
+
@click=${i=>this._toggle(e,i)}
|
|
11
|
+
>
|
|
12
|
+
<ui-icon
|
|
13
|
+
class="tree__chevron ${t?"tree__chevron--open":""}"
|
|
14
|
+
name="uil-angle-down"
|
|
15
|
+
size="20"
|
|
16
|
+
></ui-icon>
|
|
17
|
+
</button>
|
|
18
|
+
`:r.html`<span class="tree__chevron-spacer"></span>`:r.nothing}_renderNode(e,t){const n=!!e.children?.length,i=n?this._isExpanded(e.id):!1,l=this.showLabels?`--tree-level:${t};`:"--tree-level:0;";return r.html`
|
|
19
|
+
<li class="tree__item">
|
|
20
|
+
<div
|
|
21
|
+
class="tree__row ${e.disabled?"tree__row--disabled":""} ${e.active?"tree__row--active":""}"
|
|
22
|
+
style=${l}
|
|
23
|
+
role="button"
|
|
24
|
+
tabindex=${e.disabled?-1:0}
|
|
25
|
+
@click=${o=>this._handleItemClick(e,o)}
|
|
26
|
+
@keydown=${o=>this._handleRowKeydown(e,o)}
|
|
27
|
+
title=${this.showLabels?"":e.label}
|
|
28
|
+
>
|
|
29
|
+
${this.chevronPosition==="left"?this._renderChevron(e,i):r.nothing}
|
|
30
|
+
${this._renderIcon(e)}
|
|
31
|
+
${this.showLabels?r.html`<span class="tree__label">${e.label}</span>`:r.nothing}
|
|
32
|
+
${this.chevronPosition==="right"?this._renderChevron(e,i):r.nothing}
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
${this.showLabels&&n&&i?r.html`
|
|
36
|
+
<ul class="tree__children">
|
|
37
|
+
${e.children.map(o=>this._renderNode(o,t+1))}
|
|
38
|
+
</ul>
|
|
39
|
+
`:r.nothing}
|
|
40
|
+
</li>
|
|
41
|
+
`}render(){return r.html`
|
|
42
|
+
<nav class="tree ${this.showLabels?"":"tree--icons"}" aria-label="Tree Menu">
|
|
43
|
+
<ul class="tree__list">
|
|
44
|
+
${this.items.map(e=>this._renderNode(e,0))}
|
|
45
|
+
</ul>
|
|
46
|
+
</nav>
|
|
47
|
+
`}};exports.TreeMenu.styles=[r.css`${r.unsafeCSS(h)}`];a([s.property({attribute:!1})],exports.TreeMenu.prototype,"items",2);a([s.property({type:Array})],exports.TreeMenu.prototype,"expandedIds",2);a([s.property({type:Boolean})],exports.TreeMenu.prototype,"expandOnLabelClick",2);a([s.property({type:String})],exports.TreeMenu.prototype,"chevronPosition",2);a([s.property({type:Boolean})],exports.TreeMenu.prototype,"showLabels",2);a([s.property({type:Number})],exports.TreeMenu.prototype,"iconSize",2);a([s.state()],exports.TreeMenu.prototype,"_expandedSet",2);exports.TreeMenu=a([s.customElement("logosphere-tree-menu")],exports.TreeMenu);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./tree-menu-CdNwvOjp.cjs");Object.defineProperty(exports,"TreeMenu",{enumerable:!0,get:()=>e.TreeMenu});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";const a=require("lit"),w=require("lit/directives/unsafe-html.js"),g='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M13.41,12l4.3-4.29a1,1,0,1,0-1.42-1.42L12,10.59,7.71,6.29A1,1,0,0,0,6.29,7.71L10.59,12l-4.3,4.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L12,13.41l4.29,4.3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z"/></svg>',e='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.09814,12.63379,13,11.42285V7a1,1,0,0,0-2,0v5a.99985.99985,0,0,0,.5.86621l2.59814,1.5a1.00016,1.00016,0,1,0,1-1.73242ZM12,2A10,10,0,1,0,22,12,10.01114,10.01114,0,0,0,12,2Zm0,18a8,8,0,1,1,8-8A8.00917,8.00917,0,0,1,12,20Z"/></svg>',o='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M18.71,7.21a1,1,0,0,0-1.42,0L9.84,14.67,6.71,11.53A1,1,0,1,0,5.29,13l3.84,3.84a1,1,0,0,0,1.42,0l8.16-8.16A1,1,0,0,0,18.71,7.21Z"/></svg>',n='<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 24 24"><path d="M12,19a1,1,0,1,0-1-1A1,1,0,0,0,12,19Zm5,0a1,1,0,1,0-1-1A1,1,0,0,0,17,19Zm0-4a1,1,0,1,0-1-1A1,1,0,0,0,17,15Zm-5,0a1,1,0,1,0-1-1A1,1,0,0,0,12,15ZM19,3H18V2a1,1,0,0,0-2,0V3H8V2A1,1,0,0,0,6,2V3H5A3,3,0,0,0,2,6V20a3,3,0,0,0,3,3H19a3,3,0,0,0,3-3V6A3,3,0,0,0,19,3Zm1,17a1,1,0,0,1-1,1H5a1,1,0,0,1-1-1V11H20ZM20,9H4V6A1,1,0,0,1,5,5H6V6A1,1,0,0,0,8,6V5h8V6a1,1,0,0,0,2,0V5h1a1,1,0,0,1,1,1ZM7,15a1,1,0,1,0-1-1A1,1,0,0,0,7,15Zm0,4a1,1,0,1,0-1-1A1,1,0,0,0,7,19Z"/></svg>',v='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,4H17V3a1,1,0,0,0-2,0V4H9V3A1,1,0,0,0,7,3V4H5A3,3,0,0,0,2,7V19a3,3,0,0,0,3,3H19a3,3,0,0,0,3-3V7A3,3,0,0,0,19,4Zm1,15a1,1,0,0,1-1,1H5a1,1,0,0,1-1-1V12H20Zm0-9H4V7A1,1,0,0,1,5,6H7V7A1,1,0,0,0,9,7V6h6V7a1,1,0,0,0,2,0V6h2a1,1,0,0,1,1,1Z"/></svg>',i='<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 24 24"><path d="M17,11H9.41l3.3-3.29a1,1,0,1,0-1.42-1.42l-5,5a1,1,0,0,0-.21.33,1,1,0,0,0,0,.76,1,1,0,0,0,.21.33l5,5a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42L9.41,13H17a1,1,0,0,0,0-2Z"/></svg>',h='<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 24 24"><path d="M17.92,11.62a1,1,0,0,0-.21-.33l-5-5a1,1,0,0,0-1.42,1.42L14.59,11H7a1,1,0,0,0,0,2h7.59l-3.3,3.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0l5-5a1,1,0,0,0,.21-.33A1,1,0,0,0,17.92,11.62Z"/></svg>',r='<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 24 24"><path d="M17.71,11.29l-5-5a1,1,0,0,0-.33-.21,1,1,0,0,0-.76,0,1,1,0,0,0-.33.21l-5,5a1,1,0,0,0,1.42,1.42L11,9.41V17a1,1,0,0,0,2,0V9.41l3.29,3.3a1,1,0,0,0,1.42,0A1,1,0,0,0,17.71,11.29Z"/></svg>',A='<svg xmlns="http://www.w3.org/2000/svg" data-name="Layer 1" viewBox="0 0 24 24"><path d="M17.71,11.29a1,1,0,0,0-1.42,0L13,14.59V7a1,1,0,0,0-2,0v7.59l-3.29-3.3a1,1,0,0,0-1.42,1.42l5,5a1,1,0,0,0,.33.21.94.94,0,0,0,.76,0,1,1,0,0,0,.33-.21l5-5A1,1,0,0,0,17.71,11.29Z"/></svg>',c='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17,9.17a1,1,0,0,0-1.41,0L12,12.71,8.46,9.17a1,1,0,0,0-1.41,0,1,1,0,0,0,0,1.42l4.24,4.24a1,1,0,0,0,1.42,0L17,10.59A1,1,0,0,0,17,9.17Z"/></svg>',m='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.29,12l3.54-3.54a1,1,0,0,0,0-1.41,1,1,0,0,0-1.42,0L9.17,11.29a1,1,0,0,0,0,1.42L13.41,17a1,1,0,0,0,.71.29,1,1,0,0,0,.71-.29,1,1,0,0,0,0-1.41Z"/></svg>',p='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.83,11.29,10.59,7.05a1,1,0,0,0-1.42,0,1,1,0,0,0,0,1.41L12.71,12,9.17,15.54a1,1,0,0,0,0,1.41,1,1,0,0,0,.71.29,1,1,0,0,0,.71-.29l4.24-4.24A1,1,0,0,0,14.83,11.29Z"/></svg>',Z='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M11.46,8.29a1,1,0,0,0-1.42,0l-3,3a1,1,0,0,0,0,1.42l3,3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42L9.16,12l2.3-2.29A1,1,0,0,0,11.46,8.29ZM14.66,12,17,9.71a1,1,0,0,0-1.42-1.42l-3,3a1,1,0,0,0,0,1.42l3,3a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Z"/></svg>',x='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M8.46,8.29A1,1,0,1,0,7,9.71L9.34,12,7,14.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0l3-3a1,1,0,0,0,0-1.42Zm8.5,3-3-3a1,1,0,0,0-1.42,1.42L14.84,12l-2.3,2.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0l3-3A1,1,0,0,0,17,11.29Z"/></svg>',H='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20,6H16V5a3,3,0,0,0-3-3H11A3,3,0,0,0,8,5V6H4A1,1,0,0,0,4,8H5V19a3,3,0,0,0,3,3h8a3,3,0,0,0,3-3V8h1a1,1,0,0,0,0-2ZM10,5a1,1,0,0,1,1-1h2a1,1,0,0,1,1,1V6H10Zm7,14a1,1,0,0,1-1,1H8a1,1,0,0,1-1-1V8H17Z"/></svg>',V='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.71,2.29a1,1,0,0,0-1.42,0L14.5,8.09V6.5a1,1,0,0,0-2,0v4a1,1,0,0,0,.08.38,1,1,0,0,0,.54.54,1,1,0,0,0,.38.08h4a1,1,0,0,0,0-2H15.91l5.8-5.79A1,1,0,0,0,21.71,2.29ZM10.88,12.58a1,1,0,0,0-.38-.08h-4a1,1,0,0,0,0,2H8.09l-5.8,5.79a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0l5.79-5.8V17.5a1,1,0,0,0,2,0v-4a1,1,0,0,0-.08-.38A1,1,0,0,0,10.88,12.58Z"/></svg>',M='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.79,12.79,4,18.59V17a1,1,0,0,0-2,0v4a1,1,0,0,0,.08.38,1,1,0,0,0,.54.54A1,1,0,0,0,3,22H7a1,1,0,0,0,0-2H5.41l5.8-5.79a1,1,0,0,0-1.42-1.42ZM21.92,2.62a1,1,0,0,0-.54-.54A1,1,0,0,0,21,2H17a1,1,0,0,0,0,2h1.59l-5.8,5.79a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0L20,5.41V7a1,1,0,0,0,2,0V3A1,1,0,0,0,21.92,2.62Z"/></svg>',u='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21,8.94a1.31,1.31,0,0,0-.06-.27l0-.09a1.07,1.07,0,0,0-.19-.28h0l-6-6h0a1.07,1.07,0,0,0-.28-.19.32.32,0,0,0-.09,0A.88.88,0,0,0,14.05,2H10A3,3,0,0,0,7,5V6H6A3,3,0,0,0,3,9V19a3,3,0,0,0,3,3h8a3,3,0,0,0,3-3V18h1a3,3,0,0,0,3-3V9S21,9,21,8.94ZM15,5.41,17.59,8H16a1,1,0,0,1-1-1ZM15,19a1,1,0,0,1-1,1H6a1,1,0,0,1-1-1V9A1,1,0,0,1,6,8H7v7a3,3,0,0,0,3,3h5Zm4-4a1,1,0,0,1-1,1H10a1,1,0,0,1-1-1V5a1,1,0,0,1,1-1h3V7a3,3,0,0,0,3,3h3Z"/></svg>',d='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.3,10.08A3,3,0,0,0,19,9H14.44L15,7.57A4.13,4.13,0,0,0,11.11,2a1,1,0,0,0-.91.59L7.35,9H5a3,3,0,0,0-3,3v7a3,3,0,0,0,3,3H17.73a3,3,0,0,0,2.95-2.46l1.27-7A3,3,0,0,0,21.3,10.08ZM7,20H5a1,1,0,0,1-1-1V12a1,1,0,0,1,1-1H7Zm13-7.82-1.27,7a1,1,0,0,1-1,.82H9V10.21l2.72-6.12A2.11,2.11,0,0,1,13.1,6.87L12.57,8.3A2,2,0,0,0,14.44,11H19a1,1,0,0,1,.77.36A1,1,0,0,1,20,12.18Z"/></svg>',L='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19,2H6.27A3,3,0,0,0,3.32,4.46l-1.27,7A3,3,0,0,0,5,15H9.56L9,16.43A4.13,4.13,0,0,0,12.89,22a1,1,0,0,0,.91-.59L16.65,15H19a3,3,0,0,0,3-3V5A3,3,0,0,0,19,2ZM15,13.79l-2.72,6.12a2.13,2.13,0,0,1-1.38-2.78l.53-1.43A2,2,0,0,0,9.56,13H5a1,1,0,0,1-.77-.36A1,1,0,0,1,4,11.82l1.27-7a1,1,0,0,1,1-.82H15ZM20,12a1,1,0,0,1-1,1H17V4h2a1,1,0,0,1,1,1Z"/></svg>',B='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M15.71,12.71a1,1,0,0,0,.21-.33,1,1,0,0,0,0-.76,1,1,0,0,0-.21-.33l-3-3a1,1,0,0,0-1.42,1.42L12.59,11H9a1,1,0,0,0,0,2h3.59l-1.3,1.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0ZM22,12A10,10,0,1,0,12,22,10,10,0,0,0,22,12ZM4,12a8,8,0,1,1,8,8A8,8,0,0,1,4,12Z"/></svg>',f='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.92,11.6C19.9,6.91,16.1,4,12,4S4.1,6.91,2.08,11.6a1,1,0,0,0,0,.8C4.1,17.09,7.9,20,12,20s7.9-2.91,9.92-7.6A1,1,0,0,0,21.92,11.6ZM12,18c-3.17,0-6.17-2.29-7.9-6C5.83,8.29,8.83,6,12,6s6.17,2.29,7.9,6C18.17,15.71,15.17,18,12,18ZM12,8a4,4,0,1,0,4,4A4,4,0,0,0,12,8Zm0,6a2,2,0,1,1,2-2A2,2,0,0,1,12,14Z"/></svg>',y='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M10.94,6.08A6.93,6.93,0,0,1,12,6c3.18,0,6.17,2.29,7.91,6a15.23,15.23,0,0,1-.9,1.64,1,1,0,0,0-.16.55,1,1,0,0,0,1.86.5,15.77,15.77,0,0,0,1.21-2.3,1,1,0,0,0,0-.79C19.9,6.91,16.1,4,12,4a7.77,7.77,0,0,0-1.4.12,1,1,0,1,0,.34,2ZM3.71,2.29A1,1,0,0,0,2.29,3.71L5.39,6.8a14.62,14.62,0,0,0-3.31,4.8,1,1,0,0,0,0,.8C4.1,17.09,7.9,20,12,20a9.26,9.26,0,0,0,5.05-1.54l3.24,3.25a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42Zm6.36,9.19,2.45,2.45A1.81,1.81,0,0,1,12,14a2,2,0,0,1-2-2A1.81,1.81,0,0,1,10.07,11.48ZM12,18c-3.18,0-6.17-2.29-7.9-6A12.09,12.09,0,0,1,6.8,8.21L8.57,10A4,4,0,0,0,14,15.43L15.59,17A7.24,7.24,0,0,1,12,18Z"/></svg>',C='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21.71,20.29,18,16.61A9,9,0,1,0,16.61,18l3.68,3.68a1,1,0,0,0,1.42,0A1,1,0,0,0,21.71,20.29ZM11,18a7,7,0,1,1,7-7A7,7,0,0,1,11,18Z"/></svg>',b='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M21,11H9.41l2.3-2.29a1,1,0,1,0-1.42-1.42l-4,4a1,1,0,0,0-.21.33,1,1,0,0,0,0,.76,1,1,0,0,0,.21.33l4,4a1,1,0,0,0,1.42,0,1,1,0,0,0,0-1.42L9.41,13H21a1,1,0,0,0,0-2ZM3,3A1,1,0,0,0,2,4V20a1,1,0,0,0,2,0V4A1,1,0,0,0,3,3Z"/></svg>',k='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M17.71,11.29l-4-4a1,1,0,1,0-1.42,1.42L14.59,11H3a1,1,0,0,0,0,2H14.59l-2.3,2.29a1,1,0,0,0,0,1.42,1,1,0,0,0,1.42,0l4-4a1,1,0,0,0,.21-.33,1,1,0,0,0,0-.76A1,1,0,0,0,17.71,11.29ZM21,4a1,1,0,0,0-1,1V19a1,1,0,0,0,2,0V5A1,1,0,0,0,21,4Z"/></svg>',D='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.37,12.79a1,1,0,0,0-.74,1.86C17.09,15.23,18,16.13,18,17c0,1.42-2.46,3-6,3s-6-1.58-6-3c0-.87.91-1.77,2.37-2.35a1,1,0,0,0-.74-1.86C5.36,13.69,4,15.26,4,17c0,2.8,3.51,5,8,5s8-2.2,8-5C20,15.26,18.64,13.69,16.37,12.79ZM11,9.86V17a1,1,0,0,0,2,0V9.86a4,4,0,1,0-2,0ZM12,4a2,2,0,1,1-2,2A2,2,0,0,1,12,4Z"/></svg>',R='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14.72,8.79l-4.29,4.3L8.78,11.44a1,1,0,1,0-1.41,1.41l2.35,2.36a1,1,0,0,0,.71.29,1,1,0,0,0,.7-.29l5-5a1,1,0,0,0,0-1.42A1,1,0,0,0,14.72,8.79ZM12,2A10,10,0,1,0,22,12,10,10,0,0,0,12,2Zm0,18a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z"/></svg>',z='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,16a1,1,0,1,0,1,1A1,1,0,0,0,12,16Zm10.67,1.47-8.05-14a3,3,0,0,0-5.24,0l-8,14A3,3,0,0,0,3.94,22H20.06a3,3,0,0,0,2.61-4.53Zm-1.73,2a1,1,0,0,1-.88.51H3.94a1,1,0,0,1-.88-.51,1,1,0,0,1,0-1l8-14a1,1,0,0,1,1.78,0l8.05,14A1,1,0,0,1,20.94,19.49ZM12,8a1,1,0,0,0-1,1v4a1,1,0,0,0,2,0V9A1,1,0,0,0,12,8Z"/></svg>',S='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,7a1,1,0,0,0-1,1v4a1,1,0,0,0,2,0V8A1,1,0,0,0,12,7Zm0,8a1,1,0,1,0,1,1A1,1,0,0,0,12,15Zm9.71-7.44L16.44,2.29A1.05,1.05,0,0,0,15.73,2H8.27a1.05,1.05,0,0,0-.71.29L2.29,7.56A1.05,1.05,0,0,0,2,8.27v7.46a1.05,1.05,0,0,0,.29.71l5.27,5.27a1.05,1.05,0,0,0,.71.29h7.46a1.05,1.05,0,0,0,.71-.29l5.27-5.27a1.05,1.05,0,0,0,.29-.71V8.27A1.05,1.05,0,0,0,21.71,7.56ZM20,15.31,15.31,20H8.69L4,15.31V8.69L8.69,4h6.62L20,8.69Z"/></svg>',T='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12,2A10,10,0,1,0,22,12,10.01114,10.01114,0,0,0,12,2Zm0,18a8,8,0,1,1,8-8A8.00917,8.00917,0,0,1,12,20Zm0-8.5a1,1,0,0,0-1,1v3a1,1,0,0,0,2,0v-3A1,1,0,0,0,12,11.5Zm0-4a1.25,1.25,0,1,0,1.25,1.25A1.25,1.25,0,0,0,12,7.5Z"/></svg>',$={"uil-times":g,"uil-clock":e,"uil-check":o,"uil-calendar":v,"uil-calendar-alt":n,"uil-arrow-left":i,"uil-arrow-right":h,"uil-arrow-up":r,"uil-arrow-down":A,"uil-angle-down":c,"uil-angle-left":m,"uil-angle-right":p,"uil-angle-double-left":Z,"uil-angle-double-right":x,"uil-trash":H,"uil-compress-alt":V,"uil-expand-alt":M,"uil-copy":u,"uil-thumbs-up":d,"uil-thumbs-down":L,"uil-arrow-circle-right":B,"uil-eye":f,"uil-eye-slash":y,"uil-search":C,"uil-left-arrow-to-left":b,"uil-right-arrow-to-right":k,"uil-pin":D,"uil-check-circle":R,"uil-exclamation-triangle":z,"uil-exclamation-octagon":S,"uil-info-circle":T},t=class t extends a.LitElement{constructor(){super(...arguments),this.name="",this.size=20}render(){const l=$[this.name];return l?a.html`
|
|
2
|
+
<span
|
|
3
|
+
style="font-size: ${this.size}px;"
|
|
4
|
+
aria-hidden="true"
|
|
5
|
+
>
|
|
6
|
+
${w.unsafeHTML(l)}
|
|
7
|
+
</span>
|
|
8
|
+
`:(console.warn(`Icon "${this.name}" not found.`),a.html``)}};t.properties={name:{type:String},size:{type:Number}},t.styles=a.css`
|
|
9
|
+
:host {
|
|
10
|
+
display: inline-flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
line-height: 0;
|
|
14
|
+
color: inherit;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
svg {
|
|
18
|
+
width: 1em;
|
|
19
|
+
height: 1em;
|
|
20
|
+
fill: currentColor;
|
|
21
|
+
}
|
|
22
|
+
`;let s=t;customElements.define("ui-icon",s);
|