@samtv12345/etherpad-webcomponents 0.0.13 → 0.0.15

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 (73) hide show
  1. package/README.md +52 -10
  2. package/dist/EpAvatar.d.ts +25 -0
  3. package/dist/EpAvatar.d.ts.map +1 -0
  4. package/dist/EpAvatar.js +115 -0
  5. package/dist/EpAvatar.js.map +1 -0
  6. package/dist/EpButton.js +4 -4
  7. package/dist/EpCard.js +2 -2
  8. package/dist/EpChatMessage.d.ts.map +1 -1
  9. package/dist/EpChatMessage.js +3 -1
  10. package/dist/EpChatMessage.js.map +1 -1
  11. package/dist/EpChatPanel.d.ts +81 -0
  12. package/dist/EpChatPanel.d.ts.map +1 -0
  13. package/dist/EpChatPanel.js +368 -0
  14. package/dist/EpChatPanel.js.map +1 -0
  15. package/dist/EpCheckbox.d.ts +3 -0
  16. package/dist/EpCheckbox.d.ts.map +1 -1
  17. package/dist/EpCheckbox.js +11 -3
  18. package/dist/EpCheckbox.js.map +1 -1
  19. package/dist/EpColorPicker.js +2 -2
  20. package/dist/EpDropdown.js +2 -2
  21. package/dist/EpDropdownItem.js +1 -1
  22. package/dist/EpInput.js +3 -3
  23. package/dist/EpModal.js +6 -6
  24. package/dist/EpModal.js.map +1 -1
  25. package/dist/EpNotification.js +6 -6
  26. package/dist/EpPopup.d.ts +57 -0
  27. package/dist/EpPopup.d.ts.map +1 -0
  28. package/dist/EpPopup.js +323 -0
  29. package/dist/EpPopup.js.map +1 -0
  30. package/dist/EpSegmented.d.ts +35 -0
  31. package/dist/EpSegmented.d.ts.map +1 -0
  32. package/dist/EpSegmented.js +149 -0
  33. package/dist/EpSegmented.js.map +1 -0
  34. package/dist/EpSelect.js +3 -3
  35. package/dist/EpSettings.d.ts +47 -0
  36. package/dist/EpSettings.d.ts.map +1 -0
  37. package/dist/EpSettings.js +226 -0
  38. package/dist/EpSettings.js.map +1 -0
  39. package/dist/EpTabs.d.ts +64 -0
  40. package/dist/EpTabs.d.ts.map +1 -0
  41. package/dist/EpTabs.js +296 -0
  42. package/dist/EpTabs.js.map +1 -0
  43. package/dist/EpTheme.d.ts +23 -16
  44. package/dist/EpTheme.d.ts.map +1 -1
  45. package/dist/EpTheme.js +91 -64
  46. package/dist/EpTheme.js.map +1 -1
  47. package/dist/EpToast.js +7 -7
  48. package/dist/EpToast.js.map +1 -1
  49. package/dist/EpToolbar.d.ts +90 -0
  50. package/dist/EpToolbar.d.ts.map +1 -0
  51. package/dist/EpToolbar.js +431 -0
  52. package/dist/EpToolbar.js.map +1 -0
  53. package/dist/EpToolbarSelect.js +2 -2
  54. package/dist/EpUserBadge.d.ts.map +1 -1
  55. package/dist/EpUserBadge.js +3 -1
  56. package/dist/EpUserBadge.js.map +1 -1
  57. package/dist/EpUserList.d.ts +52 -0
  58. package/dist/EpUserList.d.ts.map +1 -0
  59. package/dist/EpUserList.js +225 -0
  60. package/dist/EpUserList.js.map +1 -0
  61. package/dist/index.d.ts +13 -1
  62. package/dist/index.d.ts.map +1 -1
  63. package/dist/index.js +10 -1
  64. package/dist/index.js.map +1 -1
  65. package/dist/internal/color.d.ts +15 -0
  66. package/dist/internal/color.d.ts.map +1 -0
  67. package/dist/internal/color.js +44 -0
  68. package/dist/internal/color.js.map +1 -0
  69. package/dist/themes.d.ts +81 -0
  70. package/dist/themes.d.ts.map +1 -0
  71. package/dist/themes.js +227 -0
  72. package/dist/themes.js.map +1 -0
  73. package/package.json +24 -23
@@ -0,0 +1,57 @@
1
+ import { LitElement } from 'lit';
2
+ /**
3
+ * Non-modal panel that drops down from a toolbar button (settings, share,
4
+ * import/export, users …). The page stays usable behind it.
5
+ *
6
+ * Positioned below `anchor` (an element or its id) and right-aligned to it,
7
+ * or fixed top-right without an anchor. On narrow screens it becomes a
8
+ * full-width sheet. Escape and a click outside close it (unless
9
+ * `persistent`); focus moves into it on open and back to the anchor on
10
+ * close.
11
+ *
12
+ * Events: `ep-popup-open`, `ep-popup-close` (detail `{ reason }`:
13
+ * `escape` | `outside` | `button` | `api`).
14
+ */
15
+ export declare class EpPopup extends LitElement {
16
+ static styles: import("lit").CSSResult;
17
+ open: boolean;
18
+ heading: string;
19
+ /** Element or element id the popup hangs below. */
20
+ anchor: string | HTMLElement;
21
+ /** `end` (default) aligns the right edges, `start` the left edges. */
22
+ align: 'start' | 'end';
23
+ /** Escape and clicks outside do not close it. */
24
+ persistent: boolean;
25
+ closeLabel: string;
26
+ hideClose: boolean;
27
+ private _panel;
28
+ private _returnFocus;
29
+ private _hasFooter;
30
+ private _closeReason;
31
+ private _hadFocus;
32
+ show(): void;
33
+ hide(): void;
34
+ toggle(): void;
35
+ connectedCallback(): void;
36
+ disconnectedCallback(): void;
37
+ private _listen;
38
+ private _anchorEl;
39
+ private _position;
40
+ private _onOutside;
41
+ private _onKeydown;
42
+ private _close;
43
+ protected willUpdate(changed: Map<string, unknown>): void;
44
+ protected updated(changed: Map<string, unknown>): void;
45
+ /** Runs for every way of closing, including `open = false` set by the app. */
46
+ private _didClose;
47
+ private _focusFirst;
48
+ private _focusInside;
49
+ private _onFooterSlot;
50
+ render(): import("lit-html").TemplateResult<1>;
51
+ }
52
+ declare global {
53
+ interface HTMLElementTagNameMap {
54
+ 'ep-popup': EpPopup;
55
+ }
56
+ }
57
+ //# sourceMappingURL=EpPopup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpPopup.d.ts","sourceRoot":"","sources":["../src/EpPopup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAKrD;;;;;;;;;;;;GAYG;AACH,qBACa,OAAQ,SAAQ,UAAU;IACrC,MAAM,CAAC,MAAM,0BA6FX;IAE0C,IAAI,UAAS;IAC5B,OAAO,SAAM;IAC1C,mDAAmD;IACvC,MAAM,EAAE,MAAM,GAAG,WAAW,CAAM;IAC9C,sEAAsE;IAC1D,KAAK,EAAE,OAAO,GAAG,KAAK,CAAS;IAC3C,iDAAiD;IACpB,UAAU,UAAS;IACR,UAAU,SAAW;IACP,SAAS,UAAS;IAEvD,OAAO,CAAC,MAAM,CAAe;IAE9C,OAAO,CAAC,YAAY,CAA4B;IAChD,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,YAAY,CAAkD;IACtE,OAAO,CAAC,SAAS,CAAS;IAE1B,IAAI;IACJ,IAAI;IACJ,MAAM;IAEN,iBAAiB;IAKjB,oBAAoB;IAKpB,OAAO,CAAC,OAAO;IAcf,OAAO,CAAC,SAAS;IAOjB,OAAO,CAAC,SAAS,CAef;IAEF,OAAO,CAAC,UAAU,CAQhB;IAEF,OAAO,CAAC,UAAU,CAIhB;IAEF,OAAO,CAAC,MAAM;IAMd,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAOlD,SAAS,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC;IAgB/C,8EAA8E;IAC9E,OAAO,CAAC,SAAS;IAgBjB,OAAO,CAAC,WAAW;IAUnB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,aAAa;IAKrB,MAAM;CAmBP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,UAAU,EAAE,OAAO,CAAC;KACrB;CACF"}
@@ -0,0 +1,323 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, html, css, nothing } from 'lit';
8
+ import { customElement, property, query } from 'lit/decorators.js';
9
+ const FOCUSABLE = 'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"]), ep-checkbox, ep-select, ep-dropdown, ep-button, ep-segmented';
10
+ /**
11
+ * Non-modal panel that drops down from a toolbar button (settings, share,
12
+ * import/export, users …). The page stays usable behind it.
13
+ *
14
+ * Positioned below `anchor` (an element or its id) and right-aligned to it,
15
+ * or fixed top-right without an anchor. On narrow screens it becomes a
16
+ * full-width sheet. Escape and a click outside close it (unless
17
+ * `persistent`); focus moves into it on open and back to the anchor on
18
+ * close.
19
+ *
20
+ * Events: `ep-popup-open`, `ep-popup-close` (detail `{ reason }`:
21
+ * `escape` | `outside` | `button` | `api`).
22
+ */
23
+ let EpPopup = class EpPopup extends LitElement {
24
+ constructor() {
25
+ super(...arguments);
26
+ this.open = false;
27
+ this.heading = '';
28
+ /** Element or element id the popup hangs below. */
29
+ this.anchor = '';
30
+ /** `end` (default) aligns the right edges, `start` the left edges. */
31
+ this.align = 'end';
32
+ /** Escape and clicks outside do not close it. */
33
+ this.persistent = false;
34
+ this.closeLabel = 'Close';
35
+ this.hideClose = false;
36
+ this._returnFocus = null;
37
+ this._hasFooter = false;
38
+ this._closeReason = 'api';
39
+ this._hadFocus = false;
40
+ this._position = () => {
41
+ const a = this._anchorEl();
42
+ if (!a || !this.open)
43
+ return;
44
+ const r = a.getBoundingClientRect();
45
+ const viewport = document.documentElement.clientWidth;
46
+ const width = this.getBoundingClientRect().width || 360;
47
+ const margin = 12;
48
+ this.style.top = `${Math.round(r.bottom + 6)}px`;
49
+ this.style.setProperty('--ep-popup-top', `${Math.round(r.bottom + 6)}px`);
50
+ // Keep the whole panel inside the viewport on both sides.
51
+ const maxLeft = Math.max(margin, viewport - width - margin);
52
+ let left = this.align === 'start' ? r.left : r.right - width;
53
+ left = Math.min(Math.max(margin, left), maxLeft);
54
+ this.style.left = `${Math.round(left)}px`;
55
+ this.style.right = 'auto';
56
+ };
57
+ this._onOutside = (e) => {
58
+ if (this.persistent || !this.open)
59
+ return;
60
+ const path = e.composedPath();
61
+ if (path.includes(this))
62
+ return;
63
+ const a = this._anchorEl();
64
+ // The anchor usually toggles the popup itself.
65
+ if (a && path.includes(a))
66
+ return;
67
+ this._close('outside');
68
+ };
69
+ this._onKeydown = (e) => {
70
+ if (e.key !== 'Escape' || this.persistent || !this.open)
71
+ return;
72
+ e.stopPropagation();
73
+ this._close('escape');
74
+ };
75
+ }
76
+ show() { this.open = true; }
77
+ hide() { this._close('api'); }
78
+ toggle() { if (this.open)
79
+ this.hide();
80
+ else
81
+ this.show(); }
82
+ connectedCallback() {
83
+ super.connectedCallback();
84
+ if (this.open)
85
+ this._listen(true);
86
+ }
87
+ disconnectedCallback() {
88
+ super.disconnectedCallback();
89
+ this._listen(false);
90
+ }
91
+ _listen(on) {
92
+ if (on) {
93
+ document.addEventListener('pointerdown', this._onOutside, true);
94
+ document.addEventListener('keydown', this._onKeydown);
95
+ window.addEventListener('resize', this._position);
96
+ window.addEventListener('scroll', this._position, true);
97
+ }
98
+ else {
99
+ document.removeEventListener('pointerdown', this._onOutside, true);
100
+ document.removeEventListener('keydown', this._onKeydown);
101
+ window.removeEventListener('resize', this._position);
102
+ window.removeEventListener('scroll', this._position, true);
103
+ }
104
+ }
105
+ _anchorEl() {
106
+ if (!this.anchor)
107
+ return null;
108
+ if (typeof this.anchor !== 'string')
109
+ return this.anchor;
110
+ const root = this.getRootNode();
111
+ return (root.getElementById?.(this.anchor) ?? document.getElementById(this.anchor));
112
+ }
113
+ _close(reason) {
114
+ if (!this.open)
115
+ return;
116
+ this._closeReason = reason;
117
+ this.open = false;
118
+ }
119
+ willUpdate(changed) {
120
+ // Before the panel is hidden: was focus inside it?
121
+ if (changed.has('open') && !this.open && changed.get('open')) {
122
+ this._hadFocus = this.matches(':focus-within');
123
+ }
124
+ }
125
+ updated(changed) {
126
+ if (changed.has('open')) {
127
+ const was = changed.get('open');
128
+ if (this.open) {
129
+ this._returnFocus = document.activeElement ?? null;
130
+ this._listen(true);
131
+ this._position();
132
+ this.dispatchEvent(new CustomEvent('ep-popup-open', { bubbles: true, composed: true }));
133
+ requestAnimationFrame(() => { this._position(); this._focusFirst(); });
134
+ }
135
+ else if (was) {
136
+ this._didClose();
137
+ }
138
+ }
139
+ if (changed.has('anchor') || changed.has('align'))
140
+ this._position();
141
+ }
142
+ /** Runs for every way of closing, including `open = false` set by the app. */
143
+ _didClose() {
144
+ const reason = this._closeReason;
145
+ this._closeReason = 'api';
146
+ this._listen(false);
147
+ this.dispatchEvent(new CustomEvent('ep-popup-close', {
148
+ bubbles: true, composed: true, detail: { reason },
149
+ }));
150
+ // Return focus only if it was in the popup (an outside click put it elsewhere).
151
+ if (this._hadFocus && reason !== 'outside') {
152
+ const target = this._returnFocus ?? this._anchorEl();
153
+ target?.focus?.();
154
+ }
155
+ this._hadFocus = false;
156
+ this._returnFocus = null;
157
+ }
158
+ _focusFirst() {
159
+ if (!this.open)
160
+ return;
161
+ for (const el of Array.from(this.querySelectorAll(FOCUSABLE))) {
162
+ if (el.disabled || el.closest('[hidden]'))
163
+ continue;
164
+ el.focus();
165
+ if (this._focusInside())
166
+ return;
167
+ }
168
+ this._panel?.focus();
169
+ }
170
+ _focusInside() {
171
+ let a = document.activeElement;
172
+ while (a?.shadowRoot?.activeElement)
173
+ a = a.shadowRoot.activeElement;
174
+ const host = document.activeElement;
175
+ return !!host && (host === this || this.contains(host) || a === this._panel);
176
+ }
177
+ _onFooterSlot(e) {
178
+ this._hasFooter = e.target.assignedNodes({ flatten: true }).length > 0;
179
+ this.requestUpdate();
180
+ }
181
+ render() {
182
+ return html `
183
+ <div class="panel" part="panel" role="dialog" aria-modal="false"
184
+ aria-labelledby=${this.heading ? 'title' : nothing} tabindex="-1">
185
+ ${this.heading || !this.hideClose ? html `
186
+ <header part="header">
187
+ <h2 id="title" part="heading">${this.heading}</h2>
188
+ ${this.hideClose ? nothing : html `
189
+ <button class="close" part="close-button" type="button"
190
+ title=${this.closeLabel} aria-label=${this.closeLabel}
191
+ @click=${() => this._close('button')}>
192
+ <svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.75.75 0 1 1 1.06 1.06L9.06 8l3.22 3.22a.75.75 0 1 1-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 0 1-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06z"/></svg>
193
+ </button>`}
194
+ </header>` : nothing}
195
+ <div class="body" part="body"><slot></slot></div>
196
+ <footer part="footer" ?hidden=${!this._hasFooter}><slot name="footer" @slotchange=${this._onFooterSlot}></slot></footer>
197
+ </div>
198
+ `;
199
+ }
200
+ };
201
+ EpPopup.styles = css `
202
+ :host {
203
+ position: fixed;
204
+ z-index: var(--ep-popup-z-index, 1000);
205
+ display: none;
206
+ top: var(--ep-popup-top, 56px);
207
+ right: var(--ep-popup-right, 12px);
208
+ width: var(--ep-popup-width, 360px);
209
+ max-width: calc(100vw - 24px);
210
+ max-height: calc(100vh - var(--ep-popup-top, 56px) - 12px);
211
+ font-family: var(--main-font-family, Quicksand, Cantarell, "Open Sans", "Helvetica Neue", sans-serif);
212
+ font-size: 14px;
213
+ color: var(--text-color, #485365);
214
+ }
215
+ :host([open]) { display: flex; }
216
+ .panel {
217
+ display: flex;
218
+ flex-direction: column;
219
+ width: 100%;
220
+ max-height: inherit;
221
+ background: var(--bg-color, #ffffff);
222
+ border-radius: var(--radius-large, 5px);
223
+ box-shadow: var(--shadow, 0 0 0 1px rgba(99, 114, 130, 0.16), 0 8px 16px rgba(27, 39, 51, 0.08));
224
+ overflow: hidden;
225
+ animation: ep-popup-in 0.12s ease-out;
226
+ }
227
+ @keyframes ep-popup-in {
228
+ from { opacity: 0; transform: translateY(-4px); }
229
+ to { opacity: 1; transform: none; }
230
+ }
231
+ @media (prefers-reduced-motion: reduce) {
232
+ .panel { animation: none; }
233
+ }
234
+ header {
235
+ display: flex;
236
+ align-items: center;
237
+ gap: 8px;
238
+ padding: 14px 12px 10px 18px;
239
+ }
240
+ h2 {
241
+ flex: 1;
242
+ margin: 0;
243
+ font-size: 16px;
244
+ font-weight: 700;
245
+ }
246
+ .close {
247
+ display: inline-flex;
248
+ align-items: center;
249
+ justify-content: center;
250
+ width: 28px;
251
+ height: 28px;
252
+ padding: 0;
253
+ border: none;
254
+ border-radius: var(--radius, 4px);
255
+ background: transparent;
256
+ color: var(--text-soft-color, #576273);
257
+ cursor: pointer;
258
+ }
259
+ .close:hover { background: var(--bg-soft-color, #f2f3f4); color: var(--text-color, #485365); }
260
+ .close:focus-visible {
261
+ outline: 2px solid var(--focus-color, var(--dark-color, #576273));
262
+ outline-offset: 1px;
263
+ }
264
+ .body {
265
+ padding: 0 18px 16px;
266
+ overflow-y: auto;
267
+ overscroll-behavior: contain;
268
+ }
269
+ :host(:not([heading])) .body { padding-top: 16px; }
270
+ footer {
271
+ display: flex;
272
+ justify-content: flex-end;
273
+ gap: 8px;
274
+ padding: 10px 18px;
275
+ border-top: 1px solid var(--middle-color, #d2d2d2);
276
+ }
277
+ footer[hidden] { display: none; }
278
+
279
+ @media (max-width: 600px) {
280
+ :host {
281
+ left: 0 !important;
282
+ right: 0 !important;
283
+ width: 100%;
284
+ max-width: 100%;
285
+ top: auto !important;
286
+ bottom: 0;
287
+ max-height: 85vh;
288
+ }
289
+ .panel {
290
+ border-bottom-left-radius: 0;
291
+ border-bottom-right-radius: 0;
292
+ }
293
+ }
294
+ `;
295
+ __decorate([
296
+ property({ type: Boolean, reflect: true })
297
+ ], EpPopup.prototype, "open", void 0);
298
+ __decorate([
299
+ property({ reflect: true })
300
+ ], EpPopup.prototype, "heading", void 0);
301
+ __decorate([
302
+ property()
303
+ ], EpPopup.prototype, "anchor", void 0);
304
+ __decorate([
305
+ property()
306
+ ], EpPopup.prototype, "align", void 0);
307
+ __decorate([
308
+ property({ type: Boolean })
309
+ ], EpPopup.prototype, "persistent", void 0);
310
+ __decorate([
311
+ property({ attribute: 'close-label' })
312
+ ], EpPopup.prototype, "closeLabel", void 0);
313
+ __decorate([
314
+ property({ type: Boolean, attribute: 'hide-close' })
315
+ ], EpPopup.prototype, "hideClose", void 0);
316
+ __decorate([
317
+ query('.panel')
318
+ ], EpPopup.prototype, "_panel", void 0);
319
+ EpPopup = __decorate([
320
+ customElement('ep-popup')
321
+ ], EpPopup);
322
+ export { EpPopup };
323
+ //# sourceMappingURL=EpPopup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpPopup.js","sourceRoot":"","sources":["../src/EpPopup.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEnE,MAAM,SAAS,GAAG,wIAAwI,CAAC;AAE3J;;;;;;;;;;;;GAYG;AAEI,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,UAAU;IAAhC;;QAgGuC,SAAI,GAAG,KAAK,CAAC;QAC5B,YAAO,GAAG,EAAE,CAAC;QAC1C,mDAAmD;QACvC,WAAM,GAAyB,EAAE,CAAC;QAC9C,sEAAsE;QAC1D,UAAK,GAAoB,KAAK,CAAC;QAC3C,iDAAiD;QACpB,eAAU,GAAG,KAAK,CAAC;QACR,eAAU,GAAG,OAAO,CAAC;QACP,cAAS,GAAG,KAAK,CAAC;QAIhE,iBAAY,GAAuB,IAAI,CAAC;QACxC,eAAU,GAAG,KAAK,CAAC;QACnB,iBAAY,GAA4C,KAAK,CAAC;QAC9D,cAAS,GAAG,KAAK,CAAC;QAqClB,cAAS,GAAG,GAAG,EAAE;YACvB,MAAM,CAAC,GAAG,IAAI,CAAC,SAAS,EAAE,CAAC;YAC3B,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI;gBAAE,OAAO;YAC7B,MAAM,CAAC,GAAG,CAAC,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AE,CAAC;2CAAsB;AACP;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;0CAAmB;AAE/C;IAAxB,KAAK,CAAC,QAAQ,CAAC;uCAA8B;AA3GnC,OAAO;IADnB,aAAa,CAAC,UAAU,CAAC;GACb,OAAO,CA6QnB"}
@@ -0,0 +1,35 @@
1
+ import { LitElement } from 'lit';
2
+ export interface EpSegmentedOption {
3
+ value: string;
4
+ label: string;
5
+ /**
6
+ * Optional inline SVG markup shown before the label. It is inserted as is,
7
+ * so only pass trusted, static markup.
8
+ */
9
+ icon?: string;
10
+ disabled?: boolean;
11
+ }
12
+ /**
13
+ * A row of mutually exclusive options (e.g. light / dark / system). Behaves
14
+ * like a radio group: arrow keys change the selection.
15
+ *
16
+ * Fires `ep-change` (detail `{ value }`).
17
+ */
18
+ export declare class EpSegmented extends LitElement {
19
+ static styles: import("lit").CSSResult;
20
+ options: EpSegmentedOption[];
21
+ value: string;
22
+ disabled: boolean;
23
+ /** Accessible name of the group. */
24
+ label: string;
25
+ private _choose;
26
+ focus(options?: FocusOptions): void;
27
+ private _onKeydown;
28
+ render(): import("lit-html").TemplateResult<1>;
29
+ }
30
+ declare global {
31
+ interface HTMLElementTagNameMap {
32
+ 'ep-segmented': EpSegmented;
33
+ }
34
+ }
35
+ //# sourceMappingURL=EpSegmented.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpSegmented.d.ts","sourceRoot":"","sources":["../src/EpSegmented.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAIrD,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;GAKG;AACH,qBACa,WAAY,SAAQ,UAAU;IACzC,MAAM,CAAC,MAAM,0BAyCX;IAE8B,OAAO,EAAE,iBAAiB,EAAE,CAAM;IACrC,KAAK,SAAM;IACI,QAAQ,UAAS;IAC7D,oCAAoC;IACxB,KAAK,SAAM;IAEvB,OAAO,CAAC,OAAO;IAcf,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAK5B,OAAO,CAAC,UAAU;IAiBlB,MAAM;CAoBP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,cAAc,EAAE,WAAW,CAAC;KAC7B;CACF"}
@@ -0,0 +1,149 @@
1
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
6
+ };
7
+ import { LitElement, html, css, nothing } from 'lit';
8
+ import { customElement, property } from 'lit/decorators.js';
9
+ import { unsafeSVG } from 'lit/directives/unsafe-svg.js';
10
+ /**
11
+ * A row of mutually exclusive options (e.g. light / dark / system). Behaves
12
+ * like a radio group: arrow keys change the selection.
13
+ *
14
+ * Fires `ep-change` (detail `{ value }`).
15
+ */
16
+ let EpSegmented = class EpSegmented extends LitElement {
17
+ constructor() {
18
+ super(...arguments);
19
+ this.options = [];
20
+ this.value = '';
21
+ this.disabled = false;
22
+ /** Accessible name of the group. */
23
+ this.label = '';
24
+ }
25
+ _choose(value, focus = false) {
26
+ if (this.disabled)
27
+ return;
28
+ if (value !== this.value) {
29
+ this.value = value;
30
+ this.dispatchEvent(new CustomEvent('ep-change', {
31
+ bubbles: true, composed: true, detail: { value },
32
+ }));
33
+ }
34
+ if (focus) {
35
+ this.updateComplete.then(() => this.renderRoot.querySelector('button[aria-checked="true"]')?.focus());
36
+ }
37
+ }
38
+ focus(options) {
39
+ const btn = this.renderRoot.querySelector('button[tabindex="0"]');
40
+ btn?.focus(options);
41
+ }
42
+ _onKeydown(e) {
43
+ if (this.disabled)
44
+ return;
45
+ const enabled = this.options.filter((o) => !o.disabled);
46
+ if (!enabled.length)
47
+ return;
48
+ const at = enabled.findIndex((o) => o.value === this.value);
49
+ let next;
50
+ switch (e.key) {
51
+ case 'ArrowRight':
52
+ case 'ArrowDown':
53
+ next = at < 0 ? 0 : (at + 1) % enabled.length;
54
+ break;
55
+ case 'ArrowLeft':
56
+ case 'ArrowUp':
57
+ next = at < 0 ? enabled.length - 1 : (at - 1 + enabled.length) % enabled.length;
58
+ break;
59
+ case 'Home':
60
+ next = 0;
61
+ break;
62
+ case 'End':
63
+ next = enabled.length - 1;
64
+ break;
65
+ default: return;
66
+ }
67
+ e.preventDefault();
68
+ this._choose(enabled[next].value, true);
69
+ }
70
+ render() {
71
+ const hasSelection = this.options.some((o) => o.value === this.value && !o.disabled);
72
+ const firstEnabled = this.options.find((o) => !o.disabled)?.value;
73
+ return html `
74
+ <div role="radiogroup" part="group" aria-label=${this.label || nothing}
75
+ aria-disabled=${this.disabled ? 'true' : nothing} @keydown=${this._onKeydown}>
76
+ ${this.options.map((o) => {
77
+ const checked = o.value === this.value;
78
+ const tabbable = hasSelection ? checked : o.value === firstEnabled;
79
+ return html `<button type="button" role="radio" part="option"
80
+ aria-checked=${String(checked)}
81
+ tabindex=${tabbable ? '0' : '-1'}
82
+ ?disabled=${this.disabled || !!o.disabled}
83
+ @click=${() => this._choose(o.value)}>
84
+ ${o.icon ? unsafeSVG(o.icon) : nothing}<span>${o.label}</span>
85
+ </button>`;
86
+ })}
87
+ </div>
88
+ `;
89
+ }
90
+ };
91
+ EpSegmented.styles = css `
92
+ :host {
93
+ display: inline-flex;
94
+ font-family: var(--main-font-family, Quicksand, Cantarell, "Open Sans", "Helvetica Neue", sans-serif);
95
+ font-size: 13px;
96
+ }
97
+ :host([disabled]) { opacity: 0.5; pointer-events: none; }
98
+ [role="radiogroup"] {
99
+ display: inline-flex;
100
+ gap: 2px;
101
+ padding: 2px;
102
+ background: var(--bg-soft-color, #f2f3f4);
103
+ border: 1px solid var(--middle-color, #d2d2d2);
104
+ border-radius: var(--radius, 4px);
105
+ }
106
+ button {
107
+ display: inline-flex;
108
+ align-items: center;
109
+ gap: 6px;
110
+ padding: 4px 10px;
111
+ border: none;
112
+ border-radius: calc(var(--radius, 4px) - 1px);
113
+ background: transparent;
114
+ color: var(--text-soft-color, #576273);
115
+ font: inherit;
116
+ font-weight: 600;
117
+ cursor: pointer;
118
+ white-space: nowrap;
119
+ }
120
+ button:hover { color: var(--text-color, #485365); }
121
+ button[aria-checked="true"] {
122
+ background: var(--bg-color, #ffffff);
123
+ color: var(--text-color, #485365);
124
+ box-shadow: 0 1px 2px rgba(27, 39, 51, 0.12);
125
+ }
126
+ button:disabled { opacity: 0.4; cursor: not-allowed; }
127
+ button:focus-visible {
128
+ outline: 2px solid var(--focus-color, var(--dark-color, #576273));
129
+ outline-offset: 1px;
130
+ }
131
+ svg { width: 16px; height: 16px; flex-shrink: 0; }
132
+ `;
133
+ __decorate([
134
+ property({ attribute: false })
135
+ ], EpSegmented.prototype, "options", void 0);
136
+ __decorate([
137
+ property({ reflect: true })
138
+ ], EpSegmented.prototype, "value", void 0);
139
+ __decorate([
140
+ property({ type: Boolean, reflect: true })
141
+ ], EpSegmented.prototype, "disabled", void 0);
142
+ __decorate([
143
+ property()
144
+ ], EpSegmented.prototype, "label", void 0);
145
+ EpSegmented = __decorate([
146
+ customElement('ep-segmented')
147
+ ], EpSegmented);
148
+ export { EpSegmented };
149
+ //# sourceMappingURL=EpSegmented.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpSegmented.js","sourceRoot":"","sources":["../src/EpSegmented.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,E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C;4CAAmC;AACrC;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0CAAY;AACI;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAAkB;AAEjD;IAAX,QAAQ,EAAE;0CAAY;AAhDZ,WAAW;IADvB,aAAa,CAAC,cAAc,CAAC;GACjB,WAAW,CA0GvB"}
package/dist/EpSelect.js CHANGED
@@ -149,7 +149,7 @@ EpSelect.styles = css `
149
149
  height: 28px;
150
150
  line-height: 28px;
151
151
  padding: 0 25px 0 10px;
152
- border-radius: 3px;
152
+ border-radius: calc(var(--radius, 4px) - 1px);
153
153
  border: 1px solid var(--bg-soft-color, #f2f3f4);
154
154
  background-color: var(--bg-soft-color, #f2f3f4);
155
155
  color: var(--text-color, #485365);
@@ -196,8 +196,8 @@ EpSelect.styles = css `
196
196
  min-width: 100%;
197
197
  box-sizing: border-box;
198
198
  background-color: var(--bg-soft-color, #f2f3f4);
199
- border-radius: 3px;
200
- box-shadow: 0 0 0 1px rgba(68, 68, 68, 0.11), 0 8px 16px rgba(27, 39, 51, 0.12);
199
+ border-radius: calc(var(--radius, 4px) - 1px);
200
+ box-shadow: var(--shadow, 0 0 0 1px rgba(68, 68, 68, 0.11), 0 8px 16px rgba(27, 39, 51, 0.12));
201
201
  opacity: 0;
202
202
  pointer-events: none;
203
203
  max-height: 0;
@@ -0,0 +1,47 @@
1
+ import { LitElement } from 'lit';
2
+ /** Group of settings rows with a heading. */
3
+ export declare class EpSettingsSection extends LitElement {
4
+ static styles: import("lit").CSSResult;
5
+ heading: string;
6
+ description: string;
7
+ render(): import("lit-html").TemplateResult<1>;
8
+ }
9
+ /**
10
+ * One setting: label (and optional description) on the left, the control
11
+ * (slotted, e.g. `<ep-checkbox>`, `<ep-select>`, `<ep-segmented>`) on the
12
+ * right. `stacked` puts the control below the label.
13
+ *
14
+ * Clicking the label activates a slotted `ep-checkbox` or focuses the
15
+ * control.
16
+ */
17
+ export declare class EpSettingsRow extends LitElement {
18
+ static styles: import("lit").CSSResult;
19
+ label: string;
20
+ description: string;
21
+ stacked: boolean;
22
+ divided: boolean;
23
+ disabled: boolean;
24
+ private _control;
25
+ updated(): void;
26
+ private _syncControl;
27
+ /**
28
+ * Gives the control the row label as accessible name. Names set by the row
29
+ * are marked with `data-ep-row-label` so they follow label changes (e.g. a
30
+ * language switch); names set by the page are left alone.
31
+ */
32
+ private _nameControl;
33
+ /**
34
+ * A disabled row disables its control too (keyboard included). Controls
35
+ * that were disabled by the page stay disabled when the row is enabled.
36
+ */
37
+ private _disableControl;
38
+ private _onLabelClick;
39
+ render(): import("lit-html").TemplateResult<1>;
40
+ }
41
+ declare global {
42
+ interface HTMLElementTagNameMap {
43
+ 'ep-settings-section': EpSettingsSection;
44
+ 'ep-settings-row': EpSettingsRow;
45
+ }
46
+ }
47
+ //# sourceMappingURL=EpSettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpSettings.d.ts","sourceRoot":"","sources":["../src/EpSettings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAsB,MAAM,KAAK,CAAC;AAGrD,6CAA6C;AAC7C,qBACa,iBAAkB,SAAQ,UAAU;IAC/C,MAAM,CAAC,MAAM,0BAyBX;IAEU,OAAO,SAAM;IACb,WAAW,SAAM;IAE7B,MAAM;CASP;AAED;;;;;;;GAOG;AACH,qBACa,aAAc,SAAQ,UAAU;IAC3C,MAAM,CAAC,MAAM,0BAqCX;IAEU,KAAK,SAAM;IACX,WAAW,SAAM;IACe,OAAO,UAAS;IAChB,OAAO,UAAS;IAChB,QAAQ,UAAS;IAE7D,OAAO,CAAC,QAAQ;IAKhB,OAAO;IAIP,OAAO,CAAC,YAAY;IAOpB;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAmBpB;;;OAGG;IACH,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,aAAa;IAWrB,MAAM;CASP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,qBAAqB,EAAE,iBAAiB,CAAC;QACzC,iBAAiB,EAAE,aAAa,CAAC;KAClC;CACF"}