@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,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
|
+
`
|