@eui/eds-wc 22.0.0-alpha.29 → 22.0.0-alpha.31
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/eds-breadcrumb/eds-wc-breadcrumb.d.ts +7 -1
- package/eds-breadcrumb/eds-wc-breadcrumb.d.ts.map +1 -1
- package/eds-breadcrumb/eds-wc-breadcrumb.js +21 -7
- package/eds-breadcrumb/eds-wc-breadcrumb.js.map +1 -1
- package/eds-button/eds-wc-button.d.ts +41 -17
- package/eds-button/eds-wc-button.d.ts.map +1 -1
- package/eds-button/eds-wc-button.js +172 -150
- package/eds-button/eds-wc-button.js.map +1 -1
- package/eds-button/index.d.ts +2 -2
- package/eds-button/index.d.ts.map +1 -1
- package/eds-button/index.js +1 -1
- package/eds-button/index.js.map +1 -1
- package/eds-chat-bubble/eds-wc-chat-bubble.d.ts +83 -0
- package/eds-chat-bubble/eds-wc-chat-bubble.d.ts.map +1 -0
- package/eds-chat-bubble/eds-wc-chat-bubble.js +238 -0
- package/eds-chat-bubble/eds-wc-chat-bubble.js.map +1 -0
- package/eds-chat-bubble/index.d.ts +3 -0
- package/eds-chat-bubble/index.d.ts.map +1 -0
- package/eds-chat-bubble/index.js +2 -0
- package/eds-chat-bubble/index.js.map +1 -0
- package/eds-input-addon/eds-wc-input-addon.d.ts +55 -0
- package/eds-input-addon/eds-wc-input-addon.d.ts.map +1 -0
- package/eds-input-addon/eds-wc-input-addon.js +177 -0
- package/eds-input-addon/eds-wc-input-addon.js.map +1 -0
- package/eds-input-addon/index.d.ts +3 -0
- package/eds-input-addon/index.d.ts.map +1 -0
- package/eds-input-addon/index.js +2 -0
- package/eds-input-addon/index.js.map +1 -0
- package/eds-input-prompt/eds-wc-input-prompt.d.ts +97 -0
- package/eds-input-prompt/eds-wc-input-prompt.d.ts.map +1 -0
- package/eds-input-prompt/eds-wc-input-prompt.js +363 -0
- package/eds-input-prompt/eds-wc-input-prompt.js.map +1 -0
- package/eds-input-prompt/index.d.ts +3 -0
- package/eds-input-prompt/index.d.ts.map +1 -0
- package/eds-input-prompt/index.js +2 -0
- package/eds-input-prompt/index.js.map +1 -0
- package/eds-segmented-control/eds-wc-segmented-control.d.ts +67 -0
- package/eds-segmented-control/eds-wc-segmented-control.d.ts.map +1 -0
- package/{eds-button-group/eds-wc-button-group.js → eds-segmented-control/eds-wc-segmented-control.js} +40 -35
- package/eds-segmented-control/eds-wc-segmented-control.js.map +1 -0
- package/eds-segmented-control/index.d.ts +3 -0
- package/eds-segmented-control/index.d.ts.map +1 -0
- package/eds-segmented-control/index.js +2 -0
- package/eds-segmented-control/index.js.map +1 -0
- package/index.d.ts +9 -2
- package/index.d.ts.map +1 -1
- package/index.js +4 -1
- package/index.js.map +1 -1
- package/package.json +16 -4
- package/eds-button-group/eds-wc-button-group.d.ts +0 -62
- package/eds-button-group/eds-wc-button-group.d.ts.map +0 -1
- package/eds-button-group/eds-wc-button-group.js.map +0 -1
- package/eds-button-group/index.d.ts +0 -2
- package/eds-button-group/index.d.ts.map +0 -1
- package/eds-button-group/index.js +0 -2
- package/eds-button-group/index.js.map +0 -1
|
@@ -0,0 +1,363 @@
|
|
|
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 { html, css, nothing } from 'lit';
|
|
8
|
+
import { customElement, property, query } from 'lit/decorators.js';
|
|
9
|
+
import { EdsBaseElement } from '../shared/eds-base.js';
|
|
10
|
+
import '../eds-icon-button/eds-wc-icon-button.js';
|
|
11
|
+
/**
|
|
12
|
+
* `<eds-wc-input-prompt>` — EDS Input Prompt Web Component.
|
|
13
|
+
*
|
|
14
|
+
* A generic, AI-style rich-text composer (comparable to assistant prompt fields): an auto-growing
|
|
15
|
+
* multi-line `<textarea>`, a toolbar row for leading/trailing actions, and a built-in send/stop
|
|
16
|
+
* icon button. Mirrors the Angular `eds-input-prompt` 1:1: reflected `size` / `disabled` /
|
|
17
|
+
* `readonly` / `invalid` / `loading` / `send-position`, `submit-on-enter`, and the projected
|
|
18
|
+
* `leading` / `trailing` slots.
|
|
19
|
+
*
|
|
20
|
+
* Form-associated (`ElementInternals`): the current value participates in a surrounding `<form>`.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```html
|
|
24
|
+
* <eds-wc-input-prompt placeholder="Ask anything…">
|
|
25
|
+
* <eds-wc-icon-button slot="leading" icon="paperclip" aria-label="Attach"></eds-wc-icon-button>
|
|
26
|
+
* <eds-wc-icon-button slot="trailing" icon="microphone" aria-label="Voice input"></eds-wc-icon-button>
|
|
27
|
+
* </eds-wc-input-prompt>
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @fires value-change - Fired whenever the composed value changes. `detail: string`
|
|
31
|
+
* @fires prompt-submit - Fired when the prompt is submitted (Enter or send button). `detail: string` (trimmed)
|
|
32
|
+
* @fires prompt-stop - Fired when the stop button is clicked while `loading`. `detail: void`
|
|
33
|
+
*
|
|
34
|
+
* @slot leading - Leading (start-aligned) toolbar actions.
|
|
35
|
+
* @slot trailing - Trailing (end-aligned) toolbar actions, before the built-in send button.
|
|
36
|
+
*/
|
|
37
|
+
let EdsWcInputPrompt = class EdsWcInputPrompt extends EdsBaseElement {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
/** Placeholder text shown when the composer is empty. @default 'Type your prompt…' */
|
|
41
|
+
this.placeholder = 'Type your prompt…';
|
|
42
|
+
/** Size of the composer. @default 'm' */
|
|
43
|
+
this.size = 'm';
|
|
44
|
+
/** The current composed value. */
|
|
45
|
+
this.value = '';
|
|
46
|
+
/** Whether the composer is disabled. */
|
|
47
|
+
this.disabled = false;
|
|
48
|
+
/** Whether the composer is readonly. */
|
|
49
|
+
this.readonly = false;
|
|
50
|
+
/** Whether the composer shows an invalid/error state. */
|
|
51
|
+
this.invalid = false;
|
|
52
|
+
/** Minimum number of rows the textarea occupies. @default 1 */
|
|
53
|
+
this.minRows = 1;
|
|
54
|
+
/** Maximum rows the textarea grows to before scrolling (0 = unlimited). @default 8 */
|
|
55
|
+
this.maxRows = 8;
|
|
56
|
+
/** Optional native `maxlength` cap on the textarea. @default null */
|
|
57
|
+
this.maxLength = null;
|
|
58
|
+
/** When true, Enter submits and Shift+Enter inserts a newline. @default true */
|
|
59
|
+
this.submitOnEnter = true;
|
|
60
|
+
/** When true, hides the built-in send button. @default false */
|
|
61
|
+
this.hideSendButton = false;
|
|
62
|
+
/** Placement of the built-in send button. @default 'toolbar' */
|
|
63
|
+
this.sendPosition = 'toolbar';
|
|
64
|
+
/** Busy/streaming state: the send button becomes a stop button. @default false */
|
|
65
|
+
this.loading = false;
|
|
66
|
+
/** Icon name for the built-in send button. @default 'arrow-up' */
|
|
67
|
+
this.sendIcon = 'arrow-up';
|
|
68
|
+
/** Icon name for the built-in stop button (shown while `loading`). @default 'stop' */
|
|
69
|
+
this.stopIcon = 'stop';
|
|
70
|
+
/** Accessible label for the send button. @default 'Send prompt' */
|
|
71
|
+
this.sendAriaLabel = 'Send prompt';
|
|
72
|
+
/** Accessible label for the stop button. @default 'Stop generating' */
|
|
73
|
+
this.stopAriaLabel = 'Stop generating';
|
|
74
|
+
/** Accessible label for the textarea. @default 'Prompt' */
|
|
75
|
+
this.fieldAriaLabel = 'Prompt';
|
|
76
|
+
this._internals = this.attachInternals();
|
|
77
|
+
}
|
|
78
|
+
static { this.formAssociated = true; }
|
|
79
|
+
static { this.styles = css `
|
|
80
|
+
:host {
|
|
81
|
+
--_eds-input-prompt-gap: var(--eds-sp-2xs);
|
|
82
|
+
--_eds-input-prompt-padding: var(--eds-sp-xs) var(--eds-sp-s);
|
|
83
|
+
--_eds-input-prompt-font: var(--eds-f-paragraph-m);
|
|
84
|
+
--_eds-input-prompt-radius: var(--eds-br-l);
|
|
85
|
+
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
gap: var(--_eds-input-prompt-gap);
|
|
89
|
+
width: 100%;
|
|
90
|
+
padding: var(--_eds-input-prompt-padding);
|
|
91
|
+
background-color: var(--eds-c-surface-elevation);
|
|
92
|
+
border: var(--eds-bw-xs) solid var(--eds-c-border-neutral);
|
|
93
|
+
border-radius: var(--_eds-input-prompt-radius);
|
|
94
|
+
box-sizing: border-box;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
:host(:focus-within) {
|
|
98
|
+
border-color: var(--eds-c-border-focus);
|
|
99
|
+
outline: var(--eds-bw-s) solid var(--eds-c-border-focus);
|
|
100
|
+
outline-offset: -1px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.eds-input-prompt__field {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: flex-start;
|
|
106
|
+
gap: var(--eds-sp-xs);
|
|
107
|
+
width: 100%;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.eds-input-prompt__textarea {
|
|
111
|
+
flex: 1 1 auto;
|
|
112
|
+
font: var(--_eds-input-prompt-font);
|
|
113
|
+
appearance: none;
|
|
114
|
+
width: 100%;
|
|
115
|
+
margin: 0;
|
|
116
|
+
padding: var(--eds-sp-2xs);
|
|
117
|
+
border: none;
|
|
118
|
+
background-color: transparent;
|
|
119
|
+
color: var(--eds-c-foreground);
|
|
120
|
+
resize: none;
|
|
121
|
+
box-shadow: none;
|
|
122
|
+
box-sizing: border-box;
|
|
123
|
+
font-family: inherit;
|
|
124
|
+
}
|
|
125
|
+
.eds-input-prompt__textarea:focus,
|
|
126
|
+
.eds-input-prompt__textarea:focus-visible {
|
|
127
|
+
outline: none;
|
|
128
|
+
}
|
|
129
|
+
.eds-input-prompt__textarea::placeholder {
|
|
130
|
+
color: var(--eds-c-foreground-subtler);
|
|
131
|
+
opacity: 1;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
.eds-input-prompt__toolbar {
|
|
135
|
+
display: flex;
|
|
136
|
+
align-items: center;
|
|
137
|
+
justify-content: space-between;
|
|
138
|
+
gap: var(--eds-sp-xs);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
.eds-input-prompt__actions {
|
|
142
|
+
display: flex;
|
|
143
|
+
align-items: center;
|
|
144
|
+
gap: var(--eds-sp-2xs);
|
|
145
|
+
min-width: 0;
|
|
146
|
+
}
|
|
147
|
+
.eds-input-prompt__actions--leading {
|
|
148
|
+
flex-wrap: nowrap;
|
|
149
|
+
overflow: hidden;
|
|
150
|
+
}
|
|
151
|
+
.eds-input-prompt__actions--trailing {
|
|
152
|
+
margin-inline-start: auto;
|
|
153
|
+
flex-shrink: 0;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
eds-wc-icon-button.eds-input-prompt__send {
|
|
157
|
+
--_eds-icon-button-surface: var(--eds-c-surface-brand);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/* Size variants */
|
|
161
|
+
:host([size="s"]) {
|
|
162
|
+
--_eds-input-prompt-font: var(--eds-f-paragraph-s);
|
|
163
|
+
--_eds-input-prompt-padding: var(--eds-sp-2xs) var(--eds-sp-xs);
|
|
164
|
+
--_eds-input-prompt-radius: var(--eds-br-m);
|
|
165
|
+
}
|
|
166
|
+
:host([size="l"]) {
|
|
167
|
+
--_eds-input-prompt-font: var(--eds-f-paragraph-l);
|
|
168
|
+
--_eds-input-prompt-padding: var(--eds-sp-s) var(--eds-sp-m);
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
/* States */
|
|
172
|
+
:host([invalid]) { border-color: var(--eds-c-border-critical); }
|
|
173
|
+
:host([disabled]) {
|
|
174
|
+
background-color: var(--eds-c-surface-disabled);
|
|
175
|
+
border-color: var(--eds-c-border-disabled);
|
|
176
|
+
pointer-events: none;
|
|
177
|
+
}
|
|
178
|
+
:host([disabled]) .eds-input-prompt__textarea { color: var(--eds-c-foreground-subtler); }
|
|
179
|
+
:host([readonly]) {
|
|
180
|
+
background-color: transparent;
|
|
181
|
+
border-color: var(--eds-c-border-divider);
|
|
182
|
+
}
|
|
183
|
+
:host([loading]) { border-color: var(--eds-c-border-primary); }
|
|
184
|
+
`; }
|
|
185
|
+
/** True when the send button can submit the current prompt. */
|
|
186
|
+
get _canSubmit() {
|
|
187
|
+
return !this.disabled && !this.readonly && !this.loading && this.value.trim().length > 0;
|
|
188
|
+
}
|
|
189
|
+
get _primaryActionEnabled() {
|
|
190
|
+
return this.loading || this._canSubmit;
|
|
191
|
+
}
|
|
192
|
+
connectedCallback() {
|
|
193
|
+
super.connectedCallback();
|
|
194
|
+
this._syncForm();
|
|
195
|
+
}
|
|
196
|
+
updated(changed) {
|
|
197
|
+
if (changed.has('value')) {
|
|
198
|
+
this._syncForm();
|
|
199
|
+
this._autoResize();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
firstUpdated() {
|
|
203
|
+
this._autoResize();
|
|
204
|
+
}
|
|
205
|
+
_syncForm() {
|
|
206
|
+
this._internals.setFormValue(this.value ?? '');
|
|
207
|
+
this._internals.setValidity(this.invalid ? { customError: true } : {}, this.invalid ? 'Invalid value' : undefined);
|
|
208
|
+
}
|
|
209
|
+
_autoResize() {
|
|
210
|
+
const el = this._textarea;
|
|
211
|
+
if (!el)
|
|
212
|
+
return;
|
|
213
|
+
el.style.height = 'auto';
|
|
214
|
+
const lineHeight = parseFloat(getComputedStyle(el).lineHeight) || 20;
|
|
215
|
+
const maxHeight = this.maxRows > 0 ? this.maxRows * lineHeight : Infinity;
|
|
216
|
+
const next = Math.min(el.scrollHeight, maxHeight);
|
|
217
|
+
el.style.height = `${next}px`;
|
|
218
|
+
el.style.overflowY = el.scrollHeight > maxHeight ? 'auto' : 'hidden';
|
|
219
|
+
}
|
|
220
|
+
/** Reset participation when the surrounding form resets. */
|
|
221
|
+
formResetCallback() {
|
|
222
|
+
this.value = '';
|
|
223
|
+
this._syncForm();
|
|
224
|
+
}
|
|
225
|
+
formDisabledCallback(disabled) {
|
|
226
|
+
this.disabled = disabled;
|
|
227
|
+
}
|
|
228
|
+
submit() {
|
|
229
|
+
if (!this._canSubmit)
|
|
230
|
+
return;
|
|
231
|
+
this.dispatchEvent(new CustomEvent('prompt-submit', {
|
|
232
|
+
bubbles: true, composed: true, detail: this.value.trim(),
|
|
233
|
+
}));
|
|
234
|
+
}
|
|
235
|
+
_onInput(e) {
|
|
236
|
+
this.value = e.target.value;
|
|
237
|
+
this.dispatchEvent(new CustomEvent('value-change', {
|
|
238
|
+
bubbles: true, composed: true, detail: this.value,
|
|
239
|
+
}));
|
|
240
|
+
}
|
|
241
|
+
_onKeydown(e) {
|
|
242
|
+
if (e.key !== 'Enter' || e.shiftKey || !this.submitOnEnter || e.isComposing)
|
|
243
|
+
return;
|
|
244
|
+
e.preventDefault();
|
|
245
|
+
this.submit();
|
|
246
|
+
}
|
|
247
|
+
_onSendClick() {
|
|
248
|
+
if (this.loading) {
|
|
249
|
+
this.dispatchEvent(new CustomEvent('prompt-stop', { bubbles: true, composed: true }));
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
this.submit();
|
|
253
|
+
this._textarea?.focus();
|
|
254
|
+
}
|
|
255
|
+
_renderSendButton() {
|
|
256
|
+
if (this.hideSendButton)
|
|
257
|
+
return nothing;
|
|
258
|
+
return html `
|
|
259
|
+
<eds-wc-icon-button
|
|
260
|
+
class="eds-input-prompt__send"
|
|
261
|
+
color="brand"
|
|
262
|
+
rounded
|
|
263
|
+
.icon="${this.loading ? this.stopIcon : this.sendIcon}"
|
|
264
|
+
size="${this.size === 's' ? 'xs' : 's'}"
|
|
265
|
+
aria-label="${this.loading ? this.stopAriaLabel : this.sendAriaLabel}"
|
|
266
|
+
?disabled="${!this._primaryActionEnabled}"
|
|
267
|
+
@button-click="${this._onSendClick}">
|
|
268
|
+
</eds-wc-icon-button>
|
|
269
|
+
`;
|
|
270
|
+
}
|
|
271
|
+
render() {
|
|
272
|
+
return html `
|
|
273
|
+
<div class="eds-input-prompt__field">
|
|
274
|
+
<textarea
|
|
275
|
+
class="eds-input-prompt__textarea"
|
|
276
|
+
rows="${this.minRows}"
|
|
277
|
+
placeholder="${this.placeholder}"
|
|
278
|
+
aria-label="${this.fieldAriaLabel}"
|
|
279
|
+
maxlength="${this.maxLength ?? nothing}"
|
|
280
|
+
aria-invalid="${this.invalid ? 'true' : nothing}"
|
|
281
|
+
.value="${this.value}"
|
|
282
|
+
?disabled="${this.disabled}"
|
|
283
|
+
?readonly="${this.readonly}"
|
|
284
|
+
@input="${this._onInput}"
|
|
285
|
+
@keydown="${this._onKeydown}"></textarea>
|
|
286
|
+
|
|
287
|
+
${this.sendPosition === 'top' ? this._renderSendButton() : nothing}
|
|
288
|
+
</div>
|
|
289
|
+
|
|
290
|
+
<div class="eds-input-prompt__toolbar">
|
|
291
|
+
<div class="eds-input-prompt__actions eds-input-prompt__actions--leading">
|
|
292
|
+
<slot name="leading"></slot>
|
|
293
|
+
</div>
|
|
294
|
+
<div class="eds-input-prompt__actions eds-input-prompt__actions--trailing">
|
|
295
|
+
<slot name="trailing"></slot>
|
|
296
|
+
${this.sendPosition === 'toolbar' ? this._renderSendButton() : nothing}
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
`;
|
|
300
|
+
}
|
|
301
|
+
};
|
|
302
|
+
__decorate([
|
|
303
|
+
property({ type: String })
|
|
304
|
+
], EdsWcInputPrompt.prototype, "placeholder", void 0);
|
|
305
|
+
__decorate([
|
|
306
|
+
property({ type: String, reflect: true })
|
|
307
|
+
], EdsWcInputPrompt.prototype, "size", void 0);
|
|
308
|
+
__decorate([
|
|
309
|
+
property({ type: String })
|
|
310
|
+
], EdsWcInputPrompt.prototype, "value", void 0);
|
|
311
|
+
__decorate([
|
|
312
|
+
property({ type: Boolean, reflect: true })
|
|
313
|
+
], EdsWcInputPrompt.prototype, "disabled", void 0);
|
|
314
|
+
__decorate([
|
|
315
|
+
property({ type: Boolean, reflect: true })
|
|
316
|
+
], EdsWcInputPrompt.prototype, "readonly", void 0);
|
|
317
|
+
__decorate([
|
|
318
|
+
property({ type: Boolean, reflect: true })
|
|
319
|
+
], EdsWcInputPrompt.prototype, "invalid", void 0);
|
|
320
|
+
__decorate([
|
|
321
|
+
property({ type: Number, attribute: 'min-rows' })
|
|
322
|
+
], EdsWcInputPrompt.prototype, "minRows", void 0);
|
|
323
|
+
__decorate([
|
|
324
|
+
property({ type: Number, attribute: 'max-rows' })
|
|
325
|
+
], EdsWcInputPrompt.prototype, "maxRows", void 0);
|
|
326
|
+
__decorate([
|
|
327
|
+
property({ type: Number, attribute: 'max-length' })
|
|
328
|
+
], EdsWcInputPrompt.prototype, "maxLength", void 0);
|
|
329
|
+
__decorate([
|
|
330
|
+
property({ type: Boolean, attribute: 'submit-on-enter' })
|
|
331
|
+
], EdsWcInputPrompt.prototype, "submitOnEnter", void 0);
|
|
332
|
+
__decorate([
|
|
333
|
+
property({ type: Boolean, attribute: 'hide-send-button' })
|
|
334
|
+
], EdsWcInputPrompt.prototype, "hideSendButton", void 0);
|
|
335
|
+
__decorate([
|
|
336
|
+
property({ type: String, reflect: true, attribute: 'send-position' })
|
|
337
|
+
], EdsWcInputPrompt.prototype, "sendPosition", void 0);
|
|
338
|
+
__decorate([
|
|
339
|
+
property({ type: Boolean, reflect: true })
|
|
340
|
+
], EdsWcInputPrompt.prototype, "loading", void 0);
|
|
341
|
+
__decorate([
|
|
342
|
+
property({ type: String, attribute: 'send-icon' })
|
|
343
|
+
], EdsWcInputPrompt.prototype, "sendIcon", void 0);
|
|
344
|
+
__decorate([
|
|
345
|
+
property({ type: String, attribute: 'stop-icon' })
|
|
346
|
+
], EdsWcInputPrompt.prototype, "stopIcon", void 0);
|
|
347
|
+
__decorate([
|
|
348
|
+
property({ type: String, attribute: 'send-aria-label' })
|
|
349
|
+
], EdsWcInputPrompt.prototype, "sendAriaLabel", void 0);
|
|
350
|
+
__decorate([
|
|
351
|
+
property({ type: String, attribute: 'stop-aria-label' })
|
|
352
|
+
], EdsWcInputPrompt.prototype, "stopAriaLabel", void 0);
|
|
353
|
+
__decorate([
|
|
354
|
+
property({ type: String, attribute: 'field-aria-label' })
|
|
355
|
+
], EdsWcInputPrompt.prototype, "fieldAriaLabel", void 0);
|
|
356
|
+
__decorate([
|
|
357
|
+
query('textarea')
|
|
358
|
+
], EdsWcInputPrompt.prototype, "_textarea", void 0);
|
|
359
|
+
EdsWcInputPrompt = __decorate([
|
|
360
|
+
customElement('eds-wc-input-prompt')
|
|
361
|
+
], EdsWcInputPrompt);
|
|
362
|
+
export { EdsWcInputPrompt };
|
|
363
|
+
//# sourceMappingURL=eds-wc-input-prompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eds-wc-input-prompt.js","sourceRoot":"","sources":["../../src/eds-input-prompt/eds-wc-input-prompt.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,0CAA0C,CAAC;AAQlD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,cAAc;IAA7C;;QAGH,sFAAsF;QAC1D,gBAAW,GAAG,mBAAmB,CAAC;QAE9D,yCAAyC;QACE,SAAI,GAAyB,GAAG,CAAC;QAE5E,kCAAkC;QACN,UAAK,GAAG,EAAE,CAAC;QAEvC,wCAAwC;QACI,a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O,EAAE,IAAI,EAAE,CAAC;iDAAiB;AAGR;IAAnD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;kDAAuB;AAGtB;IAAnD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,CAAC;kDAAmB;AAGZ;IAAzD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;uDAA+B;AAG9B;IAAzD,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,CAAC;uDAAmC;AAGjC;IAA1D,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,kBAAkB,EAAE,CAAC;wDAA2B;AAE1D;IAA1B,KAAK,CAAC,UAAU,CAAC;mDAAyC;AA1DlD,gBAAgB;IAD5B,aAAa,CAAC,qBAAqB,CAAC;GACxB,gBAAgB,CA0S5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eds-input-prompt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,YAAY,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eds-input-prompt/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import { EdsBaseElement } from '../shared/eds-base.js';
|
|
3
|
+
/**
|
|
4
|
+
* Sizes the segmented control styles (ported 1:1 from the Angular `EdsSegmentedControlSize`).
|
|
5
|
+
*/
|
|
6
|
+
export type EdsWcSegmentedControlSize = 's' | 'm' | 'l';
|
|
7
|
+
/**
|
|
8
|
+
* `<eds-wc-segmented-control>` — EDS Segmented Control Web Component.
|
|
9
|
+
*
|
|
10
|
+
* A pill-shaped selection group with single or multiple selection modes, projecting
|
|
11
|
+
* `<eds-wc-segmented-control-item>` children. Mirrors the Angular `eds-segmented-control` 1:1:
|
|
12
|
+
* reflected `size` (`s|m|l`), boolean `multiple` / `connected` / `fluid`, `radiogroup` / `toolbar`
|
|
13
|
+
* roles, and roving-tabindex keyboard navigation.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```html
|
|
17
|
+
* <eds-wc-segmented-control size="m">
|
|
18
|
+
* <eds-wc-segmented-control-item value="all" checked>All</eds-wc-segmented-control-item>
|
|
19
|
+
* <eds-wc-segmented-control-item value="draft">Draft</eds-wc-segmented-control-item>
|
|
20
|
+
* <eds-wc-segmented-control-item value="done">Done</eds-wc-segmented-control-item>
|
|
21
|
+
* </eds-wc-segmented-control>
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @fires selection-change - Fired when the selection changes. `detail: { values: string[] }`
|
|
25
|
+
* @slot - `<eds-wc-segmented-control-item>` elements
|
|
26
|
+
*/
|
|
27
|
+
export declare class EdsWcSegmentedControl extends EdsBaseElement {
|
|
28
|
+
size: EdsWcSegmentedControlSize;
|
|
29
|
+
multiple: boolean;
|
|
30
|
+
connected: boolean;
|
|
31
|
+
fluid: boolean;
|
|
32
|
+
ariaLabel: string | null;
|
|
33
|
+
static styles: import("lit").CSSResult;
|
|
34
|
+
connectedCallback(): void;
|
|
35
|
+
disconnectedCallback(): void;
|
|
36
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
37
|
+
private get _items();
|
|
38
|
+
private _onSlotChange;
|
|
39
|
+
private _onItemClick;
|
|
40
|
+
private _onKeydown;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* `<eds-wc-segmented-control-item>` — A single item in the segmented control.
|
|
44
|
+
*
|
|
45
|
+
* @fires item-click - Internal event consumed by the parent group.
|
|
46
|
+
* @slot - Item content (text, icons)
|
|
47
|
+
*/
|
|
48
|
+
export declare class EdsWcSegmentedControlItem extends LitElement {
|
|
49
|
+
value: string;
|
|
50
|
+
checked: boolean;
|
|
51
|
+
disabled: boolean;
|
|
52
|
+
connected: boolean;
|
|
53
|
+
fluid: boolean;
|
|
54
|
+
static styles: import("lit").CSSResult;
|
|
55
|
+
connectedCallback(): void;
|
|
56
|
+
protected updated(): void;
|
|
57
|
+
protected render(): import("lit-html").TemplateResult<1>;
|
|
58
|
+
focus(): void;
|
|
59
|
+
private _onClick;
|
|
60
|
+
}
|
|
61
|
+
declare global {
|
|
62
|
+
interface HTMLElementTagNameMap {
|
|
63
|
+
'eds-wc-segmented-control': EdsWcSegmentedControl;
|
|
64
|
+
'eds-wc-segmented-control-item': EdsWcSegmentedControlItem;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
//# sourceMappingURL=eds-wc-segmented-control.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eds-wc-segmented-control.d.ts","sourceRoot":"","sources":["../../src/eds-segmented-control/eds-wc-segmented-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,UAAU,EAAE,MAAM,KAAK,CAAC;AAE5C,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD;;GAEG;AACH,MAAM,MAAM,yBAAyB,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAExD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBACa,qBAAsB,SAAQ,cAAc;IACV,IAAI,EAAE,yBAAyB,CAAO;IACrC,QAAQ,UAAS;IACjB,SAAS,UAAS;IAClB,KAAK,UAAS;IACI,SAAS,EAAE,MAAM,GAAG,IAAI,CAAqB;IAE3G,OAAgB,MAAM,0BAWpB;IAEO,iBAAiB,IAAI,IAAI;IAQzB,oBAAoB,IAAI,IAAI;cAMlB,MAAM;IAIzB,OAAO,KAAK,MAAM,GAEjB;IAED,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,YAAY,CAgBlB;IAEF,OAAO,CAAC,UAAU,CAchB;CACL;AAED;;;;;GAKG;AACH,qBACa,yBAA0B,SAAQ,UAAU;IACzB,KAAK,SAAM;IACK,OAAO,UAAS;IAChB,QAAQ,UAAS;IACjB,SAAS,UAAS;IAClB,KAAK,UAAS;IAE1D,OAAgB,MAAM,0BA4BpB;IAEO,iBAAiB,IAAI,IAAI;cAKf,OAAO,IAAI,IAAI;cAIf,MAAM;IAIhB,KAAK,IAAI,IAAI;IAItB,OAAO,CAAC,QAAQ;CAGnB;AAED,OAAO,CAAC,MAAM,CAAC;IACX,UAAU,qBAAqB;QAC3B,0BAA0B,EAAE,qBAAqB,CAAC;QAClD,+BAA+B,EAAE,yBAAyB,CAAC;KAC9D;CACJ"}
|
|
@@ -6,29 +6,31 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
6
6
|
};
|
|
7
7
|
import { html, css, LitElement } from 'lit';
|
|
8
8
|
import { customElement, property } from 'lit/decorators.js';
|
|
9
|
-
import { SizeMixin } from '../shared/size-mixin.js';
|
|
10
9
|
import { EdsBaseElement } from '../shared/eds-base.js';
|
|
11
10
|
/**
|
|
12
|
-
* `<eds-wc-
|
|
11
|
+
* `<eds-wc-segmented-control>` — EDS Segmented Control Web Component.
|
|
13
12
|
*
|
|
14
|
-
* A pill-shaped selection group with single or multiple selection modes
|
|
15
|
-
*
|
|
13
|
+
* A pill-shaped selection group with single or multiple selection modes, projecting
|
|
14
|
+
* `<eds-wc-segmented-control-item>` children. Mirrors the Angular `eds-segmented-control` 1:1:
|
|
15
|
+
* reflected `size` (`s|m|l`), boolean `multiple` / `connected` / `fluid`, `radiogroup` / `toolbar`
|
|
16
|
+
* roles, and roving-tabindex keyboard navigation.
|
|
16
17
|
*
|
|
17
18
|
* @example
|
|
18
19
|
* ```html
|
|
19
|
-
* <eds-wc-
|
|
20
|
-
* <eds-wc-
|
|
21
|
-
* <eds-wc-
|
|
22
|
-
* <eds-wc-
|
|
23
|
-
* </eds-wc-
|
|
20
|
+
* <eds-wc-segmented-control size="m">
|
|
21
|
+
* <eds-wc-segmented-control-item value="all" checked>All</eds-wc-segmented-control-item>
|
|
22
|
+
* <eds-wc-segmented-control-item value="draft">Draft</eds-wc-segmented-control-item>
|
|
23
|
+
* <eds-wc-segmented-control-item value="done">Done</eds-wc-segmented-control-item>
|
|
24
|
+
* </eds-wc-segmented-control>
|
|
24
25
|
* ```
|
|
25
26
|
*
|
|
26
|
-
* @fires selection-change - `detail: { values: string[] }`
|
|
27
|
-
* @slot - `<eds-wc-
|
|
27
|
+
* @fires selection-change - Fired when the selection changes. `detail: { values: string[] }`
|
|
28
|
+
* @slot - `<eds-wc-segmented-control-item>` elements
|
|
28
29
|
*/
|
|
29
|
-
let
|
|
30
|
+
let EdsWcSegmentedControl = class EdsWcSegmentedControl extends EdsBaseElement {
|
|
30
31
|
constructor() {
|
|
31
32
|
super(...arguments);
|
|
33
|
+
this.size = 'm';
|
|
32
34
|
this.multiple = false;
|
|
33
35
|
this.connected = false;
|
|
34
36
|
this.fluid = false;
|
|
@@ -110,7 +112,7 @@ let EdsWcButtonGroup = class EdsWcButtonGroup extends SizeMixin(EdsBaseElement)
|
|
|
110
112
|
return html `<slot @slotchange="${this._onSlotChange}"></slot>`;
|
|
111
113
|
}
|
|
112
114
|
get _items() {
|
|
113
|
-
return Array.from(this.querySelectorAll('eds-wc-
|
|
115
|
+
return Array.from(this.querySelectorAll('eds-wc-segmented-control-item'));
|
|
114
116
|
}
|
|
115
117
|
_onSlotChange() {
|
|
116
118
|
this._items.forEach(item => {
|
|
@@ -121,29 +123,32 @@ let EdsWcButtonGroup = class EdsWcButtonGroup extends SizeMixin(EdsBaseElement)
|
|
|
121
123
|
});
|
|
122
124
|
}
|
|
123
125
|
};
|
|
126
|
+
__decorate([
|
|
127
|
+
property({ type: String, reflect: true })
|
|
128
|
+
], EdsWcSegmentedControl.prototype, "size", void 0);
|
|
124
129
|
__decorate([
|
|
125
130
|
property({ type: Boolean, reflect: true })
|
|
126
|
-
],
|
|
131
|
+
], EdsWcSegmentedControl.prototype, "multiple", void 0);
|
|
127
132
|
__decorate([
|
|
128
133
|
property({ type: Boolean, reflect: true })
|
|
129
|
-
],
|
|
134
|
+
], EdsWcSegmentedControl.prototype, "connected", void 0);
|
|
130
135
|
__decorate([
|
|
131
136
|
property({ type: Boolean, reflect: true })
|
|
132
|
-
],
|
|
137
|
+
], EdsWcSegmentedControl.prototype, "fluid", void 0);
|
|
133
138
|
__decorate([
|
|
134
139
|
property({ type: String, attribute: 'aria-label' })
|
|
135
|
-
],
|
|
136
|
-
|
|
137
|
-
customElement('eds-wc-
|
|
138
|
-
],
|
|
139
|
-
export {
|
|
140
|
+
], EdsWcSegmentedControl.prototype, "ariaLabel", void 0);
|
|
141
|
+
EdsWcSegmentedControl = __decorate([
|
|
142
|
+
customElement('eds-wc-segmented-control')
|
|
143
|
+
], EdsWcSegmentedControl);
|
|
144
|
+
export { EdsWcSegmentedControl };
|
|
140
145
|
/**
|
|
141
|
-
* `<eds-wc-
|
|
146
|
+
* `<eds-wc-segmented-control-item>` — A single item in the segmented control.
|
|
142
147
|
*
|
|
143
|
-
* @fires item-click - Internal event consumed by parent group
|
|
144
|
-
* @slot -
|
|
148
|
+
* @fires item-click - Internal event consumed by the parent group.
|
|
149
|
+
* @slot - Item content (text, icons)
|
|
145
150
|
*/
|
|
146
|
-
let
|
|
151
|
+
let EdsWcSegmentedControlItem = class EdsWcSegmentedControlItem extends LitElement {
|
|
147
152
|
constructor() {
|
|
148
153
|
super(...arguments);
|
|
149
154
|
this.value = '';
|
|
@@ -200,21 +205,21 @@ let EdsWcButtonGroupItem = class EdsWcButtonGroupItem extends LitElement {
|
|
|
200
205
|
};
|
|
201
206
|
__decorate([
|
|
202
207
|
property({ type: String })
|
|
203
|
-
],
|
|
208
|
+
], EdsWcSegmentedControlItem.prototype, "value", void 0);
|
|
204
209
|
__decorate([
|
|
205
210
|
property({ type: Boolean, reflect: true })
|
|
206
|
-
],
|
|
211
|
+
], EdsWcSegmentedControlItem.prototype, "checked", void 0);
|
|
207
212
|
__decorate([
|
|
208
213
|
property({ type: Boolean, reflect: true })
|
|
209
|
-
],
|
|
214
|
+
], EdsWcSegmentedControlItem.prototype, "disabled", void 0);
|
|
210
215
|
__decorate([
|
|
211
216
|
property({ type: Boolean, reflect: true })
|
|
212
|
-
],
|
|
217
|
+
], EdsWcSegmentedControlItem.prototype, "connected", void 0);
|
|
213
218
|
__decorate([
|
|
214
219
|
property({ type: Boolean, reflect: true })
|
|
215
|
-
],
|
|
216
|
-
|
|
217
|
-
customElement('eds-wc-
|
|
218
|
-
],
|
|
219
|
-
export {
|
|
220
|
-
//# sourceMappingURL=eds-wc-
|
|
220
|
+
], EdsWcSegmentedControlItem.prototype, "fluid", void 0);
|
|
221
|
+
EdsWcSegmentedControlItem = __decorate([
|
|
222
|
+
customElement('eds-wc-segmented-control-item')
|
|
223
|
+
], EdsWcSegmentedControlItem);
|
|
224
|
+
export { EdsWcSegmentedControlItem };
|
|
225
|
+
//# sourceMappingURL=eds-wc-segmented-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eds-wc-segmented-control.js","sourceRoot":"","sources":["../../src/eds-segmented-control/eds-wc-segmented-control.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAOvD;;;;;;;;;;;;;;;;;;;GAmBG;AAEI,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,cAAc;IAAlD;;QACwC,SAAI,GAA8B,GAAG,CAAC;QAC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AAoC,IAAI,CAAC,QAAQ,aAAa,IAAI,CAAC,QAAQ,0BAA0B,CAAC;IACrH,CAAC;IAEQ,KAAK;QACV,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC;IACtD,CAAC;IAEO,QAAQ;QACZ,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,YAAY,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACzF,CAAC;;AAvD2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAAY;AACK;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;0DAAiB;AAChB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;2DAAkB;AACjB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;4DAAmB;AAClB;IAA3C,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;wDAAe;AALjD,yBAAyB;IADrC,aAAa,CAAC,+BAA+B,CAAC;GAClC,yBAAyB,CAyDrC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/eds-segmented-control/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAC9F,YAAY,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/eds-segmented-control/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC"}
|