@api-client/ui 0.5.6 → 0.5.8
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/.cursor/rules/html-and-css-best-practices.mdc +63 -0
- package/.cursor/rules/lit-best-practices.mdc +78 -0
- package/.github/instructions/html-and-css-best-practices.instructions.md +70 -0
- package/.github/instructions/lit-best-practices.instructions.md +86 -0
- package/build/src/elements/currency/currency-picker.d.ts +10 -0
- package/build/src/elements/currency/currency-picker.d.ts.map +1 -0
- package/build/src/elements/currency/currency-picker.js +27 -0
- package/build/src/elements/currency/currency-picker.js.map +1 -0
- package/build/src/elements/currency/internals/Picker.d.ts +311 -0
- package/build/src/elements/currency/internals/Picker.d.ts.map +1 -0
- package/build/src/elements/currency/internals/Picker.js +857 -0
- package/build/src/elements/currency/internals/Picker.js.map +1 -0
- package/build/src/elements/currency/internals/Picker.styles.d.ts +3 -0
- package/build/src/elements/currency/internals/Picker.styles.d.ts.map +1 -0
- package/build/src/elements/currency/internals/Picker.styles.js +58 -0
- package/build/src/elements/currency/internals/Picker.styles.js.map +1 -0
- package/build/src/elements/mention-textarea/internals/MentionTextArea.d.ts +216 -0
- package/build/src/elements/mention-textarea/internals/MentionTextArea.d.ts.map +1 -0
- package/build/src/elements/mention-textarea/internals/MentionTextArea.js +1037 -0
- package/build/src/elements/mention-textarea/internals/MentionTextArea.js.map +1 -0
- package/build/src/elements/mention-textarea/internals/MentionTextArea.styles.d.ts +3 -0
- package/build/src/elements/mention-textarea/internals/MentionTextArea.styles.d.ts.map +1 -0
- package/build/src/elements/mention-textarea/internals/MentionTextArea.styles.js +274 -0
- package/build/src/elements/mention-textarea/internals/MentionTextArea.styles.js.map +1 -0
- package/build/src/elements/mention-textarea/ui-mention-textarea.d.ts +13 -0
- package/build/src/elements/mention-textarea/ui-mention-textarea.d.ts.map +1 -0
- package/build/src/elements/mention-textarea/ui-mention-textarea.js +28 -0
- package/build/src/elements/mention-textarea/ui-mention-textarea.js.map +1 -0
- package/build/src/md/button/internals/base.d.ts +1 -0
- package/build/src/md/button/internals/base.d.ts.map +1 -1
- package/build/src/md/button/internals/base.js +7 -0
- package/build/src/md/button/internals/base.js.map +1 -1
- package/build/src/md/chip/internals/Chip.styles.d.ts.map +1 -1
- package/build/src/md/chip/internals/Chip.styles.js +2 -0
- package/build/src/md/chip/internals/Chip.styles.js.map +1 -1
- package/build/src/md/date-picker/internals/DatePicker.styles.d.ts.map +1 -1
- package/build/src/md/date-picker/internals/DatePicker.styles.js +73 -0
- package/build/src/md/date-picker/internals/DatePicker.styles.js.map +1 -1
- package/build/src/md/date-picker/internals/DatePickerCalendar.d.ts +164 -51
- package/build/src/md/date-picker/internals/DatePickerCalendar.d.ts.map +1 -1
- package/build/src/md/date-picker/internals/DatePickerCalendar.js +660 -368
- package/build/src/md/date-picker/internals/DatePickerCalendar.js.map +1 -1
- package/build/src/md/date-picker/ui-date-picker-input.d.ts +65 -13
- package/build/src/md/date-picker/ui-date-picker-input.d.ts.map +1 -1
- package/build/src/md/date-picker/ui-date-picker-input.js +143 -76
- package/build/src/md/date-picker/ui-date-picker-input.js.map +1 -1
- package/build/src/md/date-picker/ui-date-picker-modal-input.d.ts +76 -17
- package/build/src/md/date-picker/ui-date-picker-modal-input.d.ts.map +1 -1
- package/build/src/md/date-picker/ui-date-picker-modal-input.js +192 -127
- package/build/src/md/date-picker/ui-date-picker-modal-input.js.map +1 -1
- package/build/src/md/date-picker/ui-date-picker-modal.d.ts +63 -15
- package/build/src/md/date-picker/ui-date-picker-modal.d.ts.map +1 -1
- package/build/src/md/date-picker/ui-date-picker-modal.js +143 -64
- package/build/src/md/date-picker/ui-date-picker-modal.js.map +1 -1
- package/demo/elements/currency/index.html +91 -0
- package/demo/elements/currency/index.ts +272 -0
- package/demo/elements/index.html +6 -0
- package/demo/elements/mention-textarea/index.html +19 -0
- package/demo/elements/mention-textarea/index.ts +205 -0
- package/demo/md/date-picker/date-picker.ts +138 -103
- package/package.json +2 -2
- package/src/elements/currency/currency-picker.ts +14 -0
- package/src/elements/currency/internals/Picker.styles.ts +58 -0
- package/src/elements/currency/internals/Picker.ts +846 -0
- package/src/elements/mention-textarea/internals/MentionTextArea.styles.ts +274 -0
- package/src/elements/mention-textarea/internals/MentionTextArea.ts +1036 -0
- package/src/elements/mention-textarea/ui-mention-textarea.ts +18 -0
- package/src/md/button/internals/base.ts +7 -0
- package/src/md/chip/internals/Chip.styles.ts +2 -0
- package/src/md/date-picker/internals/DatePicker.styles.ts +73 -0
- package/src/md/date-picker/internals/DatePickerCalendar.ts +643 -309
- package/src/md/date-picker/ui-date-picker-input.ts +110 -49
- package/src/md/date-picker/ui-date-picker-modal-input.ts +168 -99
- package/src/md/date-picker/ui-date-picker-modal.ts +136 -53
- package/test/README.md +3 -2
- package/test/elements/currency/CurrencyPicker.accessibility.test.ts +328 -0
- package/test/elements/currency/CurrencyPicker.core.test.ts +318 -0
- package/test/elements/currency/CurrencyPicker.integration.test.ts +482 -0
- package/test/elements/currency/CurrencyPicker.test.ts +486 -0
- package/test/elements/mention-textarea/MentionTextArea.basic.test.ts +63 -0
- package/test/elements/mention-textarea/MentionTextArea.test.ts +321 -0
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CSSResultOrNative } from 'lit'
|
|
2
|
+
import { customElement } from 'lit/decorators.js'
|
|
3
|
+
import Element from './internals/MentionTextArea.js'
|
|
4
|
+
import styles from './internals/MentionTextArea.styles.js'
|
|
5
|
+
|
|
6
|
+
@customElement('mention-textarea')
|
|
7
|
+
export class MentionTextAreaElement extends Element {
|
|
8
|
+
static override styles: CSSResultOrNative[] = [styles]
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
declare global {
|
|
12
|
+
interface HTMLElementTagNameMap {
|
|
13
|
+
'mention-textarea': MentionTextAreaElement
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default MentionTextAreaElement
|
|
18
|
+
export type { MentionSuggestion, MentionInsertEvent, MentionRemoveEvent } from './internals/MentionTextArea.js'
|
|
@@ -234,6 +234,8 @@ export default class BaseButton extends UiElement {
|
|
|
234
234
|
const allowedReasons = reason === 'enter' || reason === 'space'
|
|
235
235
|
if (this.type === 'submit' && (!reason || allowedReasons)) {
|
|
236
236
|
this.handleSubmit()
|
|
237
|
+
} else if (this.type === 'reset' && (!reason || allowedReasons)) {
|
|
238
|
+
this.handleReset()
|
|
237
239
|
} else if (allowedReasons) {
|
|
238
240
|
this.click()
|
|
239
241
|
}
|
|
@@ -337,6 +339,11 @@ export default class BaseButton extends UiElement {
|
|
|
337
339
|
}
|
|
338
340
|
}
|
|
339
341
|
|
|
342
|
+
protected handleReset(): void {
|
|
343
|
+
const form = this.form as HTMLFormElement
|
|
344
|
+
form?.reset()
|
|
345
|
+
}
|
|
346
|
+
|
|
340
347
|
override handlePointerEnter(e: PointerEvent): void {
|
|
341
348
|
super.handlePointerEnter(e)
|
|
342
349
|
this.ripple?.beginHover(e)
|
|
@@ -14,6 +14,8 @@ export default css`
|
|
|
14
14
|
letter-spacing: var(--md-sys-typescale-label-large-tracking);
|
|
15
15
|
line-height: var(--md-sys-typescale-label-large-height);
|
|
16
16
|
|
|
17
|
+
white-space: normal;
|
|
18
|
+
|
|
17
19
|
--md-ripple-hover-state-layer-color: var(--md-sys-color-on-surface);
|
|
18
20
|
--md-ripple-focus-state-layer-color: var(--md-sys-color-on-surface);
|
|
19
21
|
--md-ripple-pressed-state-layer-color: var(--md-sys-color-primary);
|
|
@@ -218,6 +218,10 @@ export const inputStyles = css`
|
|
|
218
218
|
z-index: 999;
|
|
219
219
|
background: transparent;
|
|
220
220
|
}
|
|
221
|
+
|
|
222
|
+
.calendar-icon {
|
|
223
|
+
cursor: pointer;
|
|
224
|
+
}
|
|
221
225
|
`
|
|
222
226
|
|
|
223
227
|
export const modalStyles = css`
|
|
@@ -283,6 +287,75 @@ export const modalStyles = css`
|
|
|
283
287
|
font-size: 18px;
|
|
284
288
|
}
|
|
285
289
|
|
|
290
|
+
/* Input container and format help styles */
|
|
291
|
+
.input-container {
|
|
292
|
+
display: flex;
|
|
293
|
+
flex-direction: column;
|
|
294
|
+
gap: 16px;
|
|
295
|
+
width: 100%;
|
|
296
|
+
max-width: 320px;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.format-help {
|
|
300
|
+
padding: 12px 16px;
|
|
301
|
+
background: var(--md-sys-color-surface-container-highest);
|
|
302
|
+
border-radius: 8px;
|
|
303
|
+
border: 1px solid var(--md-sys-color-outline-variant);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.help-title {
|
|
307
|
+
margin: 0 0 8px 0;
|
|
308
|
+
font-size: 14px;
|
|
309
|
+
color: var(--md-sys-color-on-surface);
|
|
310
|
+
line-height: 1.4;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.help-examples {
|
|
314
|
+
margin: 0;
|
|
315
|
+
font-size: 13px;
|
|
316
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
317
|
+
line-height: 1.4;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* Accessibility utilities */
|
|
321
|
+
.visually-hidden {
|
|
322
|
+
position: absolute;
|
|
323
|
+
width: 1px;
|
|
324
|
+
height: 1px;
|
|
325
|
+
padding: 0;
|
|
326
|
+
margin: -1px;
|
|
327
|
+
overflow: hidden;
|
|
328
|
+
clip: rect(0, 0, 0, 0);
|
|
329
|
+
white-space: nowrap;
|
|
330
|
+
border: 0;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
fieldset {
|
|
334
|
+
border: none;
|
|
335
|
+
margin: 0;
|
|
336
|
+
padding: 0;
|
|
337
|
+
display: flex;
|
|
338
|
+
flex-direction: column;
|
|
339
|
+
gap: 16px;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/* Modal header actions and input mode styles */
|
|
343
|
+
.header-actions {
|
|
344
|
+
display: flex;
|
|
345
|
+
gap: 8px;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
.input-mode-placeholder {
|
|
349
|
+
padding: 24px;
|
|
350
|
+
text-align: center;
|
|
351
|
+
color: var(--md-sys-color-on-surface-variant);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
.input-mode-icon {
|
|
355
|
+
font-size: 48px;
|
|
356
|
+
margin-bottom: 16px;
|
|
357
|
+
}
|
|
358
|
+
|
|
286
359
|
.modal-actions {
|
|
287
360
|
display: flex;
|
|
288
361
|
justify-content: flex-end;
|