@samtv12345/etherpad-webcomponents 0.0.14 → 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 (48) hide show
  1. package/README.md +11 -0
  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/EpChatMessage.d.ts.map +1 -1
  7. package/dist/EpChatMessage.js +3 -1
  8. package/dist/EpChatMessage.js.map +1 -1
  9. package/dist/EpChatPanel.d.ts +81 -0
  10. package/dist/EpChatPanel.d.ts.map +1 -0
  11. package/dist/EpChatPanel.js +368 -0
  12. package/dist/EpChatPanel.js.map +1 -0
  13. package/dist/EpCheckbox.d.ts +3 -0
  14. package/dist/EpCheckbox.d.ts.map +1 -1
  15. package/dist/EpCheckbox.js +9 -1
  16. package/dist/EpCheckbox.js.map +1 -1
  17. package/dist/EpPopup.d.ts +57 -0
  18. package/dist/EpPopup.d.ts.map +1 -0
  19. package/dist/EpPopup.js +323 -0
  20. package/dist/EpPopup.js.map +1 -0
  21. package/dist/EpSegmented.d.ts +35 -0
  22. package/dist/EpSegmented.d.ts.map +1 -0
  23. package/dist/EpSegmented.js +149 -0
  24. package/dist/EpSegmented.js.map +1 -0
  25. package/dist/EpSettings.d.ts +47 -0
  26. package/dist/EpSettings.d.ts.map +1 -0
  27. package/dist/EpSettings.js +226 -0
  28. package/dist/EpSettings.js.map +1 -0
  29. package/dist/EpToolbar.d.ts +90 -0
  30. package/dist/EpToolbar.d.ts.map +1 -0
  31. package/dist/EpToolbar.js +431 -0
  32. package/dist/EpToolbar.js.map +1 -0
  33. package/dist/EpUserBadge.d.ts.map +1 -1
  34. package/dist/EpUserBadge.js +3 -1
  35. package/dist/EpUserBadge.js.map +1 -1
  36. package/dist/EpUserList.d.ts +52 -0
  37. package/dist/EpUserList.d.ts.map +1 -0
  38. package/dist/EpUserList.js +225 -0
  39. package/dist/EpUserList.js.map +1 -0
  40. package/dist/index.d.ts +10 -0
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +7 -0
  43. package/dist/index.js.map +1 -1
  44. package/dist/internal/color.d.ts +15 -0
  45. package/dist/internal/color.d.ts.map +1 -0
  46. package/dist/internal/color.js +44 -0
  47. package/dist/internal/color.js.map +1 -0
  48. package/package.json +8 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EpChatPanel.js","sourceRoot":"","sources":["../src/EpChatPanel.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,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAC;AAClD,OAAO,oBAAoB,CAAC;AAW5B;;;;;;;;;;;GAWG;AAEI,IAAM,WAAW,GAAjB,MAAM,WAAY,SAAQ,UAAU;IAApC;;QAwGO,YAAO,GAAG,MAAM,CAAC;QACG,aAAQ,GAAkB,EAAE,CAAC;QACjD,gBAAW,GAAG,iBAAiB,CAAC;QACL,cAAS,GAAG,MAAM,CAAC;QAClB,eAAU,GAAG,OAAO,CAAC;QACpB,gBAAW,GAAG,gBAAgB,CAAC;QAChC,eAAU,GAAG,EAAE,CAAC;QACd,iBAAY,GAAG,UAAU,CAAC;QACpE,mDAAmD;QACP,WAAM,GAAG,KAAK,CAAC;QACJ,eAAU,GAAG,KAAK,CAAC;QACpB,cAAS,GAAG,KAAK,CAAC;QACxE,sDAAsD;QACV,aAAQ,GAAG,KAAK,CAAC;QAC7D,qEAAqE;QACjB,YAAO,GAAG,KAAK,CAAC;QACpE,4CAA4C;QACf,YAAO,GAAG,KAAK,CAAC;QAC7C,wDAAwD;QACZ,aAAQ,GAAG,KAAK,CAAC;QACjC,c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+CAAiB;AACd;IAAzC,QAAQ,CAAC,EAAE,SAAS,EAAE,eAAe,EAAE,CAAC;iDAA2B;AAExB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2CAAgB;AACJ;IAAtD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;+CAAoB;AACpB;IAArD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAC;8CAAmB;AAE5B;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAAkB;AAET;IAAnD,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC;4CAAiB;AAEvC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;4CAAiB;AAED;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;6CAAkB;AACjC;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;8CAAkB;AAEtB;IAAtB,KAAK,CAAC,MAAM,CAAC;yCAA4B;AACf;IAA1B,KAAK,CAAC,UAAU,CAAC;2CAAsC;AAOvC;IAAhB,KAAK,EAAE;6CAAsB;AAtInB,WAAW;IADvB,aAAa,CAAC,eAAe,CAAC;GAClB,WAAW,CA2SvB"}
@@ -5,7 +5,10 @@ export declare class EpCheckbox extends LitElement {
5
5
  variant: 'default' | 'retro';
6
6
  disabled: boolean;
7
7
  label: string;
8
+ /** Accessible name when no visible `label` is shown (e.g. inside a settings row). */
9
+ accessibleName: string;
8
10
  render(): import("lit-html").TemplateResult<1>;
11
+ focus(options?: FocusOptions): void;
9
12
  private _toggle;
10
13
  }
11
14
  declare global {
@@ -1 +1 @@
1
- {"version":3,"file":"EpCheckbox.d.ts","sourceRoot":"","sources":["../src/EpCheckbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,qBACa,UAAW,SAAQ,UAAU;IACxC,MAAM,CAAC,MAAM,0BAiGX;IAE0C,OAAO,UAAS;IAC/B,OAAO,EAAE,SAAS,GAAG,OAAO,CAAa;IAC1B,QAAQ,UAAS;IACjD,KAAK,SAAM;IAEvB,MAAM;IAcN,OAAO,CAAC,OAAO;CAQhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
1
+ {"version":3,"file":"EpCheckbox.d.ts","sourceRoot":"","sources":["../src/EpCheckbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAa,MAAM,KAAK,CAAC;AAG5C,qBACa,UAAW,SAAQ,UAAU;IACxC,MAAM,CAAC,MAAM,0BAiGX;IAE0C,OAAO,UAAS;IAC/B,OAAO,EAAE,SAAS,GAAG,OAAO,CAAa;IAC1B,QAAQ,UAAS;IACjD,KAAK,SAAM;IACvB,qFAAqF;IACzC,cAAc,SAAM;IAEhE,MAAM;IAcN,KAAK,CAAC,OAAO,CAAC,EAAE,YAAY;IAI5B,OAAO,CAAC,OAAO;CAQhB;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,aAAa,EAAE,UAAU,CAAC;KAC3B;CACF"}
@@ -13,6 +13,8 @@ let EpCheckbox = class EpCheckbox extends LitElement {
13
13
  this.variant = 'default';
14
14
  this.disabled = false;
15
15
  this.label = '';
16
+ /** Accessible name when no visible `label` is shown (e.g. inside a settings row). */
17
+ this.accessibleName = '';
16
18
  }
17
19
  render() {
18
20
  return html `
@@ -23,10 +25,13 @@ let EpCheckbox = class EpCheckbox extends LitElement {
23
25
  .checked="${this.checked}"
24
26
  ?disabled="${this.disabled}"
25
27
  @change="${this._toggle}"
26
- aria-label="${this.label}" />
28
+ aria-label="${this.label || this.accessibleName}" />
27
29
  ${this.label ? html `<span class="label" @click="${this._toggle}">${this.label}</span>` : ''}
28
30
  `;
29
31
  }
32
+ focus(options) {
33
+ this.renderRoot.querySelector('input')?.focus(options);
34
+ }
30
35
  _toggle() {
31
36
  if (this.disabled)
32
37
  return;
@@ -147,6 +152,9 @@ __decorate([
147
152
  __decorate([
148
153
  property()
149
154
  ], EpCheckbox.prototype, "label", void 0);
155
+ __decorate([
156
+ property({ attribute: 'accessible-name' })
157
+ ], EpCheckbox.prototype, "accessibleName", void 0);
150
158
  EpCheckbox = __decorate([
151
159
  customElement('ep-checkbox')
152
160
  ], EpCheckbox);
@@ -1 +1 @@
1
- {"version":3,"file":"EpCheckbox.js","sourceRoot":"","sources":["../src/EpCheckbox.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGrD,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,UAAU;IAAnC;;QAoGuC,YAAO,GAAG,KAAK,CAAC;QAC/B,YAAO,GAAwB,SAAS,CAAC;QAC1B,aAAQ,GAAG,KAAK,CAAC;QACjD,UAAK,GAAG,EAAE,CAAC;IAwBzB,CAAC;IAtBC,MAAM;QACJ,OAAO,IAAI,CAAA;mCACoB,IAAI,CAAC,OAAO;;;;yBAItB,IAAI,CAAC,OAAO;0BACX,IAAI,CAAC,QAAQ;wBACf,IAAI,CAAC,OAAO;2BACT,IAAI,CAAC,KAAK;QAC7B,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA,+BAA+B,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE;KAC5F,CAAC;IACJ,CAAC;IAEO,OAAO;QACb,IAAI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Q,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4CAAkB;AACjD;IAAX,QAAQ,EAAE;yCAAY;AAEqB;IAA3C,QAAQ,CAAC,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;kDAAqB;AAzGrD,UAAU;IADtB,aAAa,CAAC,aAAa,CAAC;GAChB,UAAU,CAqItB"}
@@ -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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CAAC,aAAa;;KAEzG,CAAC;IACJ,CAAC;;AA3QM,cAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6FlB,AA7FY,CA6FX;AAE0C;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;qCAAc;AAC5B;IAA5B,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wCAAc;AAE9B;IAAX,QAAQ,EAAE;uCAAmC;AAElC;IAAX,QAAQ,EAAE;sCAAgC;AAEd;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;2CAAoB;AACR;IAAvC,QAAQ,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,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