@api-client/ui 0.5.5 → 0.5.7

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 (114) 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/highlight/MarkdownStyles.d.ts.map +1 -1
  18. package/build/src/elements/highlight/MarkdownStyles.js +0 -13
  19. package/build/src/elements/highlight/MarkdownStyles.js.map +1 -1
  20. package/build/src/elements/http/BodyEditor.d.ts +0 -13
  21. package/build/src/elements/http/BodyEditor.d.ts.map +1 -1
  22. package/build/src/elements/http/BodyEditor.js +0 -13
  23. package/build/src/elements/http/BodyEditor.js.map +1 -1
  24. package/build/src/elements/http/BodyTextEditor.d.ts +0 -13
  25. package/build/src/elements/http/BodyTextEditor.d.ts.map +1 -1
  26. package/build/src/elements/http/BodyTextEditor.js +0 -13
  27. package/build/src/elements/http/BodyTextEditor.js.map +1 -1
  28. package/build/src/elements/http/BodyUrlEncodedEditor.d.ts +0 -13
  29. package/build/src/elements/http/BodyUrlEncodedEditor.d.ts.map +1 -1
  30. package/build/src/elements/http/BodyUrlEncodedEditor.js +0 -13
  31. package/build/src/elements/http/BodyUrlEncodedEditor.js.map +1 -1
  32. package/build/src/elements/http/UrlInput.d.ts +0 -13
  33. package/build/src/elements/http/UrlInput.d.ts.map +1 -1
  34. package/build/src/elements/http/UrlInput.js +0 -13
  35. package/build/src/elements/http/UrlInput.js.map +1 -1
  36. package/build/src/index.d.ts +2 -0
  37. package/build/src/index.d.ts.map +1 -1
  38. package/build/src/index.js +2 -0
  39. package/build/src/index.js.map +1 -1
  40. package/build/src/md/button/internals/base.d.ts +1 -0
  41. package/build/src/md/button/internals/base.d.ts.map +1 -1
  42. package/build/src/md/button/internals/base.js +7 -0
  43. package/build/src/md/button/internals/base.js.map +1 -1
  44. package/build/src/md/button/internals/button.styles.js +1 -1
  45. package/build/src/md/button/internals/button.styles.js.map +1 -1
  46. package/build/src/md/date/internals/DateTime.d.ts +0 -13
  47. package/build/src/md/date/internals/DateTime.d.ts.map +1 -1
  48. package/build/src/md/date/internals/DateTime.js +0 -13
  49. package/build/src/md/date/internals/DateTime.js.map +1 -1
  50. package/build/src/md/date-picker/index.d.ts +13 -0
  51. package/build/src/md/date-picker/index.d.ts.map +1 -0
  52. package/build/src/md/date-picker/index.js +13 -0
  53. package/build/src/md/date-picker/index.js.map +1 -0
  54. package/build/src/md/date-picker/internals/DatePicker.styles.d.ts +4 -0
  55. package/build/src/md/date-picker/internals/DatePicker.styles.d.ts.map +1 -0
  56. package/build/src/md/date-picker/internals/DatePicker.styles.js +409 -0
  57. package/build/src/md/date-picker/internals/DatePicker.styles.js.map +1 -0
  58. package/build/src/md/date-picker/internals/DatePickerCalendar.d.ts +272 -0
  59. package/build/src/md/date-picker/internals/DatePickerCalendar.d.ts.map +1 -0
  60. package/build/src/md/date-picker/internals/DatePickerCalendar.js +1062 -0
  61. package/build/src/md/date-picker/internals/DatePickerCalendar.js.map +1 -0
  62. package/build/src/md/date-picker/internals/DatePickerUtils.d.ts +93 -0
  63. package/build/src/md/date-picker/internals/DatePickerUtils.d.ts.map +1 -0
  64. package/build/src/md/date-picker/internals/DatePickerUtils.js +221 -0
  65. package/build/src/md/date-picker/internals/DatePickerUtils.js.map +1 -0
  66. package/build/src/md/date-picker/ui-date-picker-input.d.ts +160 -0
  67. package/build/src/md/date-picker/ui-date-picker-input.d.ts.map +1 -0
  68. package/build/src/md/date-picker/ui-date-picker-input.js +464 -0
  69. package/build/src/md/date-picker/ui-date-picker-input.js.map +1 -0
  70. package/build/src/md/date-picker/ui-date-picker-modal-input.d.ts +178 -0
  71. package/build/src/md/date-picker/ui-date-picker-modal-input.d.ts.map +1 -0
  72. package/build/src/md/date-picker/ui-date-picker-modal-input.js +538 -0
  73. package/build/src/md/date-picker/ui-date-picker-modal-input.js.map +1 -0
  74. package/build/src/md/date-picker/ui-date-picker-modal.d.ts +156 -0
  75. package/build/src/md/date-picker/ui-date-picker-modal.d.ts.map +1 -0
  76. package/build/src/md/date-picker/ui-date-picker-modal.js +423 -0
  77. package/build/src/md/date-picker/ui-date-picker-modal.js.map +1 -0
  78. package/build/src/md/dialog/internals/Dialog.styles.d.ts.map +1 -1
  79. package/build/src/md/dialog/internals/Dialog.styles.js +1 -0
  80. package/build/src/md/dialog/internals/Dialog.styles.js.map +1 -1
  81. package/demo/elements/currency/index.html +91 -0
  82. package/demo/elements/currency/index.ts +272 -0
  83. package/demo/elements/har/har2.json +1 -1
  84. package/demo/elements/index.html +3 -0
  85. package/demo/md/date-picker/date-picker.ts +336 -0
  86. package/demo/md/date-picker/index.html +171 -0
  87. package/demo/md/index.html +2 -0
  88. package/package.json +1 -1
  89. package/src/elements/currency/currency-picker.ts +14 -0
  90. package/src/elements/currency/internals/Picker.styles.ts +58 -0
  91. package/src/elements/currency/internals/Picker.ts +846 -0
  92. package/src/elements/highlight/MarkdownStyles.ts +0 -13
  93. package/src/elements/http/BodyEditor.ts +0 -13
  94. package/src/elements/http/BodyTextEditor.ts +0 -13
  95. package/src/elements/http/BodyUrlEncodedEditor.ts +0 -13
  96. package/src/elements/http/UrlInput.ts +0 -13
  97. package/src/index.ts +17 -0
  98. package/src/md/button/internals/base.ts +7 -0
  99. package/src/md/button/internals/button.styles.ts +1 -1
  100. package/src/md/date/internals/DateTime.ts +0 -14
  101. package/src/md/date-picker/README.md +184 -0
  102. package/src/md/date-picker/index.ts +17 -0
  103. package/src/md/date-picker/internals/DatePicker.styles.ts +411 -0
  104. package/src/md/date-picker/internals/DatePickerCalendar.ts +1031 -0
  105. package/src/md/date-picker/internals/DatePickerUtils.ts +288 -0
  106. package/src/md/date-picker/ui-date-picker-input.ts +333 -0
  107. package/src/md/date-picker/ui-date-picker-modal-input.ts +440 -0
  108. package/src/md/date-picker/ui-date-picker-modal.ts +346 -0
  109. package/src/md/dialog/internals/Dialog.styles.ts +1 -0
  110. package/test/README.md +3 -2
  111. package/test/elements/currency/CurrencyPicker.accessibility.test.ts +328 -0
  112. package/test/elements/currency/CurrencyPicker.core.test.ts +318 -0
  113. package/test/elements/currency/CurrencyPicker.integration.test.ts +482 -0
  114. package/test/elements/currency/CurrencyPicker.test.ts +486 -0
@@ -0,0 +1,411 @@
1
+ import { css } from 'lit'
2
+
3
+ export const calendarStyles = css`
4
+ :host {
5
+ display: block;
6
+ font-family: 'Roboto', sans-serif;
7
+ font-size: 14px;
8
+ border-radius: 12px;
9
+ background: var(--md-sys-color-surface-container-high);
10
+ border: 1px solid var(--md-sys-color-outline-variant);
11
+ box-shadow: var(--md-sys-elevation-2);
12
+ overflow: hidden;
13
+ }
14
+
15
+ .calendar {
16
+ padding: 20px 12px 12px 12px;
17
+ }
18
+
19
+ /* Header */
20
+ .header {
21
+ display: flex;
22
+ align-items: center;
23
+ justify-content: space-between;
24
+ margin-bottom: 30px;
25
+ gap: 8px;
26
+ }
27
+
28
+ .month-year {
29
+ display: flex;
30
+ align-items: center;
31
+ flex: 1;
32
+ justify-content: space-between;
33
+ }
34
+
35
+ .month-selector,
36
+ .year-selector {
37
+ display: flex;
38
+ align-items: center;
39
+ }
40
+
41
+ .month-year-text {
42
+ font-size: 16px;
43
+ font-weight: 500;
44
+ color: var(--md-sys-color-on-surface);
45
+ min-width: 120px;
46
+ }
47
+
48
+ /* Weekdays header */
49
+ .weekdays {
50
+ display: grid;
51
+ grid-template-columns: repeat(7, 40px);
52
+ margin-bottom: 16px;
53
+ }
54
+
55
+ .weekday {
56
+ display: flex;
57
+ align-items: center;
58
+ justify-content: center;
59
+ height: 32px;
60
+ font-size: 12px;
61
+ font-weight: 500;
62
+ color: var(--md-sys-color-on-surface-variant);
63
+ text-transform: uppercase;
64
+ }
65
+
66
+ /* Calendar grid */
67
+ .days {
68
+ display: grid;
69
+ grid-template-columns: repeat(7, 40px);
70
+ gap: 0;
71
+ }
72
+
73
+ .day-cell {
74
+ display: flex;
75
+ align-items: center;
76
+ justify-content: center;
77
+ position: relative;
78
+ width: 40px;
79
+ }
80
+
81
+ .day-cell.in-range.has-complete-range {
82
+ background: var(--md-sys-color-secondary-container);
83
+ }
84
+
85
+ .day-cell.range-start.has-complete-range:not(.range-end) {
86
+ background: linear-gradient(to right, transparent 50%, var(--md-sys-color-secondary-container) 50%);
87
+ }
88
+
89
+ .day-cell.range-end.has-complete-range:not(.range-start) {
90
+ background: linear-gradient(to left, transparent 50%, var(--md-sys-color-secondary-container) 50%);
91
+ }
92
+
93
+ .day-cell.range-start.range-end.has-complete-range {
94
+ background: transparent;
95
+ }
96
+
97
+ .day-button {
98
+ width: 40px !important;
99
+ height: 40px !important;
100
+ min-width: 40px !important;
101
+ padding: 0;
102
+ }
103
+
104
+ .day-button.other-month {
105
+ opacity: 0.38;
106
+ }
107
+
108
+ .nav-button,
109
+ .month-button,
110
+ .year-button,
111
+ .other-month .day-button:not([color='filled']):not([disabled]) {
112
+ color: var(--md-sys-color-on-surface-variant);
113
+ }
114
+
115
+ .month-button,
116
+ .year-button {
117
+ padding: 0;
118
+ }
119
+
120
+ .weekday:not([color='filled']),
121
+ .day-button:not([color='filled']):not([disabled]) {
122
+ color: var(--md-sys-color-on-surface);
123
+ }
124
+
125
+ .today .day-button:not([color='filled']) {
126
+ color: var(--md-sys-color-primary);
127
+ }
128
+
129
+ .today .day-button {
130
+ --md-button-outline-color: var(--md-sys-color-primary);
131
+ }
132
+
133
+ /* Dropdown views */
134
+ .dropdown-view {
135
+ min-height: 300px;
136
+ }
137
+
138
+ .close-button {
139
+ display: flex;
140
+ align-items: center;
141
+ justify-content: center;
142
+ width: 32px;
143
+ height: 32px;
144
+ border: none;
145
+ background: transparent;
146
+ color: var(--md-sys-color-on-surface-variant);
147
+ cursor: pointer;
148
+ border-radius: 16px;
149
+ transition: background-color 0.2s ease;
150
+ }
151
+
152
+ .close-button:hover {
153
+ background: color-mix(in srgb, var(--md-sys-color-on-surface) 8%, transparent);
154
+ }
155
+
156
+ .close-button:focus {
157
+ outline: none;
158
+ background: color-mix(in srgb, var(--md-sys-color-on-surface) 12%, transparent);
159
+ }
160
+
161
+ /* Month dropdown */
162
+ .month-list {
163
+ display: grid;
164
+ grid-template-columns: repeat(3, 1fr);
165
+ gap: 8px;
166
+ }
167
+
168
+ .year-option:not(.selected),
169
+ .month-option:not(.selected) {
170
+ color: var(--md-sys-color-on-surface-variant);
171
+ }
172
+
173
+ /* Year dropdown */
174
+ .year-grid {
175
+ display: grid;
176
+ grid-template-columns: repeat(4, 1fr);
177
+ gap: 4px;
178
+ max-height: 240px;
179
+ overflow-y: auto;
180
+ padding: 4px;
181
+ }
182
+
183
+ .actions {
184
+ margin-top: 8px;
185
+ display: flex;
186
+ justify-content: flex-end;
187
+ }
188
+ `
189
+
190
+ export const inputStyles = css`
191
+ :host {
192
+ display: inline-block;
193
+ width: 100%;
194
+ }
195
+
196
+ .input-container {
197
+ position: relative;
198
+ }
199
+
200
+ .dropdown-container {
201
+ position: absolute;
202
+ position-anchor: --ui-date-picker-anchor;
203
+ top: anchor(bottom);
204
+ left: anchor(left);
205
+ z-index: 1000;
206
+ margin-top: 4px;
207
+ min-width: anchor-size(width);
208
+ width: max-content;
209
+ max-width: calc(100vw - 32px);
210
+ }
211
+
212
+ .backdrop {
213
+ position: fixed;
214
+ top: 0;
215
+ left: 0;
216
+ right: 0;
217
+ bottom: 0;
218
+ z-index: 999;
219
+ background: transparent;
220
+ }
221
+
222
+ .calendar-icon {
223
+ cursor: pointer;
224
+ }
225
+ `
226
+
227
+ export const modalStyles = css`
228
+ .modal-header {
229
+ display: flex;
230
+ align-items: center;
231
+ justify-content: space-between;
232
+ padding: 24px 24px 16px;
233
+ }
234
+
235
+ .modal-title {
236
+ font-size: 24px;
237
+ font-weight: 400;
238
+ color: var(--md-sys-color-on-surface);
239
+ margin: 0;
240
+ }
241
+
242
+ .modal-content {
243
+ display: flex;
244
+ flex-direction: column;
245
+ align-items: center;
246
+ gap: 24px;
247
+ max-height: 60vh;
248
+ overflow-y: auto;
249
+ }
250
+
251
+ .modal-content ui-date-picker-calendar {
252
+ box-shadow: none;
253
+ }
254
+
255
+ .date-range-display {
256
+ display: flex;
257
+ align-items: center;
258
+ gap: 16px;
259
+ padding: 16px;
260
+ background: var(--md-sys-color-surface-container-highest);
261
+ border-radius: 12px;
262
+ width: 100%;
263
+ max-width: 320px;
264
+ }
265
+
266
+ .date-display {
267
+ flex: 1;
268
+ text-align: center;
269
+ }
270
+
271
+ .date-label {
272
+ font-size: 12px;
273
+ font-weight: 500;
274
+ color: var(--md-sys-color-on-surface-variant);
275
+ text-transform: uppercase;
276
+ margin-bottom: 4px;
277
+ }
278
+
279
+ .date-value {
280
+ font-size: 16px;
281
+ font-weight: 400;
282
+ color: var(--md-sys-color-on-surface);
283
+ }
284
+
285
+ .date-separator {
286
+ color: var(--md-sys-color-on-surface-variant);
287
+ font-size: 18px;
288
+ }
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
+
359
+ .modal-actions {
360
+ display: flex;
361
+ justify-content: flex-end;
362
+ gap: 8px;
363
+ padding: 16px 24px;
364
+ border-top: 1px solid var(--md-sys-color-outline-variant);
365
+ }
366
+
367
+ /* Calendar Action Buttons */
368
+ .actions {
369
+ display: flex;
370
+ justify-content: flex-end;
371
+ gap: 8px;
372
+ margin-top: 16px;
373
+ padding-top: 16px;
374
+ border-top: 1px solid var(--md-sys-color-outline-variant);
375
+ }
376
+
377
+ /* Pending selection state */
378
+ .day.pending {
379
+ background: var(--md-sys-color-secondary-container);
380
+ color: var(--md-sys-color-on-secondary-container);
381
+ border: 2px solid var(--md-sys-color-secondary);
382
+ }
383
+
384
+ .day.pending.selected {
385
+ background: var(--md-sys-color-secondary);
386
+ color: var(--md-sys-color-on-secondary);
387
+ }
388
+
389
+ .day.pending.range-start,
390
+ .day.pending.range-end {
391
+ background: var(--md-sys-color-secondary);
392
+ color: var(--md-sys-color-on-secondary);
393
+ }
394
+
395
+ .day.pending.in-range {
396
+ background: var(--md-sys-color-secondary-container);
397
+ color: var(--md-sys-color-on-secondary-container);
398
+ }
399
+
400
+ /* Responsive */
401
+ @media (max-width: 640px) {
402
+ .modal-content {
403
+ padding: 16px;
404
+ }
405
+
406
+ .calendar {
407
+ width: 100%;
408
+ max-width: 320px;
409
+ }
410
+ }
411
+ `