@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.
Files changed (82) hide show
  1. package/.cursor/rules/html-and-css-best-practices.mdc +63 -0
  2. package/.cursor/rules/lit-best-practices.mdc +78 -0
  3. package/.github/instructions/html-and-css-best-practices.instructions.md +70 -0
  4. package/.github/instructions/lit-best-practices.instructions.md +86 -0
  5. package/build/src/elements/currency/currency-picker.d.ts +10 -0
  6. package/build/src/elements/currency/currency-picker.d.ts.map +1 -0
  7. package/build/src/elements/currency/currency-picker.js +27 -0
  8. package/build/src/elements/currency/currency-picker.js.map +1 -0
  9. package/build/src/elements/currency/internals/Picker.d.ts +311 -0
  10. package/build/src/elements/currency/internals/Picker.d.ts.map +1 -0
  11. package/build/src/elements/currency/internals/Picker.js +857 -0
  12. package/build/src/elements/currency/internals/Picker.js.map +1 -0
  13. package/build/src/elements/currency/internals/Picker.styles.d.ts +3 -0
  14. package/build/src/elements/currency/internals/Picker.styles.d.ts.map +1 -0
  15. package/build/src/elements/currency/internals/Picker.styles.js +58 -0
  16. package/build/src/elements/currency/internals/Picker.styles.js.map +1 -0
  17. package/build/src/elements/mention-textarea/internals/MentionTextArea.d.ts +216 -0
  18. package/build/src/elements/mention-textarea/internals/MentionTextArea.d.ts.map +1 -0
  19. package/build/src/elements/mention-textarea/internals/MentionTextArea.js +1037 -0
  20. package/build/src/elements/mention-textarea/internals/MentionTextArea.js.map +1 -0
  21. package/build/src/elements/mention-textarea/internals/MentionTextArea.styles.d.ts +3 -0
  22. package/build/src/elements/mention-textarea/internals/MentionTextArea.styles.d.ts.map +1 -0
  23. package/build/src/elements/mention-textarea/internals/MentionTextArea.styles.js +274 -0
  24. package/build/src/elements/mention-textarea/internals/MentionTextArea.styles.js.map +1 -0
  25. package/build/src/elements/mention-textarea/ui-mention-textarea.d.ts +13 -0
  26. package/build/src/elements/mention-textarea/ui-mention-textarea.d.ts.map +1 -0
  27. package/build/src/elements/mention-textarea/ui-mention-textarea.js +28 -0
  28. package/build/src/elements/mention-textarea/ui-mention-textarea.js.map +1 -0
  29. package/build/src/md/button/internals/base.d.ts +1 -0
  30. package/build/src/md/button/internals/base.d.ts.map +1 -1
  31. package/build/src/md/button/internals/base.js +7 -0
  32. package/build/src/md/button/internals/base.js.map +1 -1
  33. package/build/src/md/chip/internals/Chip.styles.d.ts.map +1 -1
  34. package/build/src/md/chip/internals/Chip.styles.js +2 -0
  35. package/build/src/md/chip/internals/Chip.styles.js.map +1 -1
  36. package/build/src/md/date-picker/internals/DatePicker.styles.d.ts.map +1 -1
  37. package/build/src/md/date-picker/internals/DatePicker.styles.js +73 -0
  38. package/build/src/md/date-picker/internals/DatePicker.styles.js.map +1 -1
  39. package/build/src/md/date-picker/internals/DatePickerCalendar.d.ts +164 -51
  40. package/build/src/md/date-picker/internals/DatePickerCalendar.d.ts.map +1 -1
  41. package/build/src/md/date-picker/internals/DatePickerCalendar.js +660 -368
  42. package/build/src/md/date-picker/internals/DatePickerCalendar.js.map +1 -1
  43. package/build/src/md/date-picker/ui-date-picker-input.d.ts +65 -13
  44. package/build/src/md/date-picker/ui-date-picker-input.d.ts.map +1 -1
  45. package/build/src/md/date-picker/ui-date-picker-input.js +143 -76
  46. package/build/src/md/date-picker/ui-date-picker-input.js.map +1 -1
  47. package/build/src/md/date-picker/ui-date-picker-modal-input.d.ts +76 -17
  48. package/build/src/md/date-picker/ui-date-picker-modal-input.d.ts.map +1 -1
  49. package/build/src/md/date-picker/ui-date-picker-modal-input.js +192 -127
  50. package/build/src/md/date-picker/ui-date-picker-modal-input.js.map +1 -1
  51. package/build/src/md/date-picker/ui-date-picker-modal.d.ts +63 -15
  52. package/build/src/md/date-picker/ui-date-picker-modal.d.ts.map +1 -1
  53. package/build/src/md/date-picker/ui-date-picker-modal.js +143 -64
  54. package/build/src/md/date-picker/ui-date-picker-modal.js.map +1 -1
  55. package/demo/elements/currency/index.html +91 -0
  56. package/demo/elements/currency/index.ts +272 -0
  57. package/demo/elements/index.html +6 -0
  58. package/demo/elements/mention-textarea/index.html +19 -0
  59. package/demo/elements/mention-textarea/index.ts +205 -0
  60. package/demo/md/date-picker/date-picker.ts +138 -103
  61. package/package.json +2 -2
  62. package/src/elements/currency/currency-picker.ts +14 -0
  63. package/src/elements/currency/internals/Picker.styles.ts +58 -0
  64. package/src/elements/currency/internals/Picker.ts +846 -0
  65. package/src/elements/mention-textarea/internals/MentionTextArea.styles.ts +274 -0
  66. package/src/elements/mention-textarea/internals/MentionTextArea.ts +1036 -0
  67. package/src/elements/mention-textarea/ui-mention-textarea.ts +18 -0
  68. package/src/md/button/internals/base.ts +7 -0
  69. package/src/md/chip/internals/Chip.styles.ts +2 -0
  70. package/src/md/date-picker/internals/DatePicker.styles.ts +73 -0
  71. package/src/md/date-picker/internals/DatePickerCalendar.ts +643 -309
  72. package/src/md/date-picker/ui-date-picker-input.ts +110 -49
  73. package/src/md/date-picker/ui-date-picker-modal-input.ts +168 -99
  74. package/src/md/date-picker/ui-date-picker-modal.ts +136 -53
  75. package/test/README.md +3 -2
  76. package/test/elements/currency/CurrencyPicker.accessibility.test.ts +328 -0
  77. package/test/elements/currency/CurrencyPicker.core.test.ts +318 -0
  78. package/test/elements/currency/CurrencyPicker.integration.test.ts +482 -0
  79. package/test/elements/currency/CurrencyPicker.test.ts +486 -0
  80. package/test/elements/mention-textarea/MentionTextArea.basic.test.ts +63 -0
  81. package/test/elements/mention-textarea/MentionTextArea.test.ts +321 -0
  82. package/tsconfig.json +1 -1
@@ -0,0 +1,274 @@
1
+ import { css } from 'lit'
2
+
3
+ export default css`
4
+ :host {
5
+ display: inline-flex;
6
+ flex-direction: column;
7
+ vertical-align: top;
8
+ outline: none;
9
+ -webkit-tap-highlight-color: transparent;
10
+ cursor: text;
11
+ min-width: 200px;
12
+ font-family: var(--md-sys-typescale-body-large-font);
13
+ font-size: var(--md-sys-typescale-body-large-size);
14
+ letter-spacing: var(--md-sys-typescale-body-large-tracking);
15
+ line-height: var(--md-sys-typescale-body-large-height);
16
+ }
17
+
18
+ .surface {
19
+ height: auto;
20
+ min-height: 56px;
21
+ position: relative;
22
+ display: flex;
23
+ align-items: flex-start;
24
+ cursor: inherit;
25
+ border-radius: var(--md-sys-shape-corner-extra-small);
26
+ }
27
+
28
+ .container {
29
+ position: absolute;
30
+ inset: 0;
31
+ z-index: 1;
32
+ border-radius: inherit;
33
+ background-color: transparent;
34
+ border: 1px solid var(--md-sys-color-outline);
35
+ outline: 0px solid var(--md-sys-color-primary);
36
+ outline-offset: -1px;
37
+ transition:
38
+ border-color 150ms cubic-bezier(0.4, 0, 0.2, 1),
39
+ outline-width 150ms cubic-bezier(0.4, 0, 0.2, 1),
40
+ outline-offset 150ms cubic-bezier(0.4, 0, 0.2, 1);
41
+ }
42
+
43
+ .content {
44
+ height: inherit;
45
+ min-height: inherit;
46
+ display: flex;
47
+ align-items: flex-start;
48
+ justify-content: start;
49
+ box-sizing: border-box;
50
+ position: relative;
51
+ z-index: 2;
52
+ flex: 1;
53
+ cursor: inherit;
54
+ padding: 16px;
55
+ }
56
+
57
+ .body {
58
+ flex: 1;
59
+ box-sizing: border-box;
60
+ position: relative;
61
+ cursor: inherit;
62
+ min-height: 24px;
63
+ }
64
+
65
+ .label {
66
+ color: var(--md-sys-color-on-surface-variant);
67
+ position: absolute;
68
+ top: 0px;
69
+ left: 0px;
70
+ max-width: calc(100% - 32px);
71
+ pointer-events: none;
72
+ overflow: hidden;
73
+ text-overflow: ellipsis;
74
+ white-space: nowrap;
75
+ z-index: 3;
76
+ font-family: var(--md-sys-typescale-body-large-font);
77
+ font-weight: var(--md-sys-typescale-body-large-weight);
78
+ font-size: var(--md-sys-typescale-body-large-size);
79
+ letter-spacing: var(--md-sys-typescale-body-large-tracking);
80
+ line-height: var(--md-sys-typescale-body-large-height);
81
+ transform-origin: left center;
82
+ transition:
83
+ transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
84
+ color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
85
+ background-color: var(--md-sys-color-surface);
86
+ padding: 0 4px;
87
+ margin-left: -4px;
88
+ }
89
+
90
+ .label.floating {
91
+ transform: translateY(-28px) scale(0.75);
92
+ color: var(--md-sys-color-primary);
93
+ }
94
+
95
+ .editor {
96
+ width: 100%;
97
+ min-height: 24px;
98
+ background: transparent;
99
+ border: none;
100
+ outline: none;
101
+ padding: 0;
102
+ margin: 0;
103
+ color: var(--md-sys-color-on-surface);
104
+ font-family: inherit;
105
+ font-size: inherit;
106
+ letter-spacing: inherit;
107
+ line-height: inherit;
108
+ cursor: inherit;
109
+ word-wrap: break-word;
110
+ overflow-wrap: break-word;
111
+ white-space: pre-wrap;
112
+ resize: none;
113
+ }
114
+
115
+ .editor:empty::before {
116
+ content: attr(data-placeholder);
117
+ color: var(--md-sys-color-on-surface-variant);
118
+ opacity: 0.6;
119
+ }
120
+
121
+ .mention-chip {
122
+ display: inline-flex;
123
+ align-items: center;
124
+ margin: 0 2px;
125
+ vertical-align: baseline;
126
+ user-select: none;
127
+ }
128
+
129
+ .mention-chip ui-chip {
130
+ margin: 0;
131
+ font-size: inherit;
132
+ line-height: inherit;
133
+ }
134
+
135
+ .suggestions-popover {
136
+ position: fixed;
137
+ border: none;
138
+ margin: 0;
139
+ padding: 0;
140
+ background: var(--md-sys-color-surface-container);
141
+ box-shadow: var(--md-sys-elevation-2);
142
+ border-radius: var(--md-sys-shape-corner-medium);
143
+ max-height: 300px;
144
+ overflow-y: auto;
145
+ min-width: 200px;
146
+ max-width: 400px;
147
+ /* Popover API handles z-index and layering automatically */
148
+ }
149
+
150
+ .suggestion-item {
151
+ display: flex;
152
+ align-items: center;
153
+ padding: 12px 16px;
154
+ cursor: pointer;
155
+ border: none;
156
+ background: none;
157
+ width: 100%;
158
+ text-align: left;
159
+ font-family: inherit;
160
+ color: var(--md-sys-color-on-surface);
161
+ transition: background-color 150ms cubic-bezier(0.4, 0, 0.2, 1);
162
+ }
163
+
164
+ .suggestion-item:hover {
165
+ background-color: var(--md-sys-color-surface-container-highest);
166
+ }
167
+
168
+ .suggestion-item.selected {
169
+ background-color: var(--md-sys-color-secondary-container);
170
+ color: var(--md-sys-color-on-secondary-container);
171
+ }
172
+
173
+ .suggestion-content {
174
+ flex: 1;
175
+ min-width: 0;
176
+ }
177
+
178
+ .suggestion-headline {
179
+ font-weight: var(--md-sys-typescale-label-large-weight);
180
+ font-size: var(--md-sys-typescale-label-large-size);
181
+ line-height: var(--md-sys-typescale-label-large-height);
182
+ margin-bottom: 2px;
183
+ }
184
+
185
+ .suggestion-supporting-text {
186
+ font-weight: var(--md-sys-typescale-body-small-weight);
187
+ font-size: var(--md-sys-typescale-body-small-size);
188
+ line-height: var(--md-sys-typescale-body-small-height);
189
+ color: var(--md-sys-color-on-surface-variant);
190
+ overflow: hidden;
191
+ text-overflow: ellipsis;
192
+ white-space: nowrap;
193
+ }
194
+
195
+ .suggestion-suffix {
196
+ margin-left: 8px;
197
+ font-weight: var(--md-sys-typescale-body-small-weight);
198
+ font-size: var(--md-sys-typescale-body-small-size);
199
+ line-height: var(--md-sys-typescale-body-small-height);
200
+ color: var(--md-sys-color-on-surface-variant);
201
+ flex-shrink: 0;
202
+ }
203
+
204
+ .supporting-text {
205
+ margin-top: 4px;
206
+ padding: 0 16px;
207
+ color: var(--md-sys-color-on-surface-variant);
208
+ font-family: var(--md-sys-typescale-body-small-font);
209
+ font-weight: var(--md-sys-typescale-body-small-weight);
210
+ font-size: var(--md-sys-typescale-body-small-size);
211
+ letter-spacing: var(--md-sys-typescale-body-small-tracking);
212
+ line-height: var(--md-sys-typescale-body-small-height);
213
+ }
214
+
215
+ /* Hover state */
216
+ :host(:hover:not(:focus-within):not([disabled])) .container {
217
+ border-color: var(--md-sys-color-on-surface);
218
+ }
219
+
220
+ /* Focus states */
221
+ :host(:focus-within) .container {
222
+ border-color: var(--md-sys-color-primary);
223
+ outline-width: 2px;
224
+ outline-offset: -2px;
225
+ }
226
+
227
+ :host(:focus-within) .label {
228
+ color: var(--md-sys-color-primary);
229
+ }
230
+
231
+ /* Disabled state */
232
+ :host([disabled]) {
233
+ pointer-events: none;
234
+ opacity: 0.38;
235
+ }
236
+
237
+ :host([disabled]) .container {
238
+ border-color: var(--md-sys-color-on-surface);
239
+ opacity: 0.12;
240
+ }
241
+
242
+ :host([disabled]) .label,
243
+ :host([disabled]) .editor {
244
+ color: var(--md-sys-color-on-surface);
245
+ opacity: 0.38;
246
+ }
247
+
248
+ /* Invalid state */
249
+ :host([invalid]) .container {
250
+ border-color: var(--md-sys-color-error);
251
+ }
252
+
253
+ :host([invalid]:focus-within) .container {
254
+ outline-color: var(--md-sys-color-error);
255
+ }
256
+
257
+ :host([invalid]) .label,
258
+ :host([invalid]:focus-within) .label {
259
+ color: var(--md-sys-color-error);
260
+ }
261
+
262
+ :host([invalid]) .supporting-text {
263
+ color: var(--md-sys-color-error);
264
+ }
265
+
266
+ /* Empty state for label floating */
267
+ .label:not(.floating) {
268
+ opacity: 1;
269
+ }
270
+
271
+ .has-content .label:not(.floating) {
272
+ opacity: 0;
273
+ }
274
+ `