@joewinke/jatui 0.1.0

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 (62) hide show
  1. package/package.json +46 -0
  2. package/src/lib/components/AudioWaveform.svelte +694 -0
  3. package/src/lib/components/AvailabilityModal.svelte +173 -0
  4. package/src/lib/components/Badge.svelte +38 -0
  5. package/src/lib/components/BookingForm.svelte +276 -0
  6. package/src/lib/components/Button.svelte +72 -0
  7. package/src/lib/components/CalendarPicker.svelte +284 -0
  8. package/src/lib/components/Card.svelte +67 -0
  9. package/src/lib/components/CharacterCounter.svelte +82 -0
  10. package/src/lib/components/ChipInput.svelte +596 -0
  11. package/src/lib/components/ColorSelector.svelte +163 -0
  12. package/src/lib/components/ConfirmModal.svelte +75 -0
  13. package/src/lib/components/CountdownTimer.svelte +94 -0
  14. package/src/lib/components/DateRangePicker.svelte +192 -0
  15. package/src/lib/components/Drawer.svelte +110 -0
  16. package/src/lib/components/FilterDropdown.svelte +202 -0
  17. package/src/lib/components/ImageUpload.svelte +97 -0
  18. package/src/lib/components/InlineEdit.svelte +283 -0
  19. package/src/lib/components/LazyImage.svelte +122 -0
  20. package/src/lib/components/LoadingSpinner.svelte +102 -0
  21. package/src/lib/components/Modal.svelte +208 -0
  22. package/src/lib/components/PhoneInput.svelte +92 -0
  23. package/src/lib/components/ResizableDivider.svelte +305 -0
  24. package/src/lib/components/ResizablePanel.svelte +302 -0
  25. package/src/lib/components/SearchDropdown.svelte +341 -0
  26. package/src/lib/components/SelectInput.svelte +215 -0
  27. package/src/lib/components/SignaturePad.svelte +171 -0
  28. package/src/lib/components/SortDropdown.svelte +148 -0
  29. package/src/lib/components/Sparkline.svelte +107 -0
  30. package/src/lib/components/SpeechForm.svelte +114 -0
  31. package/src/lib/components/StatusBadge.svelte +155 -0
  32. package/src/lib/components/TextArea.svelte +143 -0
  33. package/src/lib/components/TextInput.svelte +108 -0
  34. package/src/lib/components/ThemeSelector.svelte +195 -0
  35. package/src/lib/components/TimeSlotPicker.svelte +162 -0
  36. package/src/lib/components/VoicePlayer.svelte +420 -0
  37. package/src/lib/components/messaging/Avatar.svelte +81 -0
  38. package/src/lib/components/messaging/ChannelInfoModal.svelte +163 -0
  39. package/src/lib/components/messaging/ChannelList.svelte +107 -0
  40. package/src/lib/components/messaging/ChannelMemberAvatarStack.svelte +69 -0
  41. package/src/lib/components/messaging/ChannelMembersModal.svelte +182 -0
  42. package/src/lib/components/messaging/CreateChannelModal.svelte +190 -0
  43. package/src/lib/components/messaging/DirectMessageList.svelte +145 -0
  44. package/src/lib/components/messaging/EmojiSelector.svelte +260 -0
  45. package/src/lib/components/messaging/MentionAutocomplete.svelte +193 -0
  46. package/src/lib/components/messaging/MessageAttachment.svelte +270 -0
  47. package/src/lib/components/messaging/MessageAttachmentUpload.svelte +243 -0
  48. package/src/lib/components/messaging/MessageInput.svelte +451 -0
  49. package/src/lib/components/messaging/MessageItem.svelte +338 -0
  50. package/src/lib/components/messaging/MessageThread.svelte +306 -0
  51. package/src/lib/components/messaging/NotificationSettingsModal.svelte +234 -0
  52. package/src/lib/components/messaging/QuotedMessageDisplay.svelte +118 -0
  53. package/src/lib/components/messaging/StartDMModal.svelte +100 -0
  54. package/src/lib/components/messaging/ThreadPanel.svelte +153 -0
  55. package/src/lib/index.ts +185 -0
  56. package/src/lib/types/booking.ts +143 -0
  57. package/src/lib/types/messaging.ts +459 -0
  58. package/src/lib/utils/currency.ts +20 -0
  59. package/src/lib/utils/daisyuiColors.ts +243 -0
  60. package/src/lib/utils/dateFormatters.ts +153 -0
  61. package/src/lib/utils/mentionParser.ts +188 -0
  62. package/src/lib/utils/phoneFormat.ts +74 -0
@@ -0,0 +1,596 @@
1
+ <script lang="ts">
2
+ /**
3
+ * ChipInput - Generic contenteditable input with inline chips and autocomplete.
4
+ *
5
+ * Handles:
6
+ * - Contenteditable div with placeholder
7
+ * - Chip insertion/deletion (non-editable inline spans)
8
+ * - Autocomplete dropdown with keyboard navigation
9
+ * - Serialization (DOM -> text with chip markers)
10
+ */
11
+
12
+ // --- Types ---
13
+ export interface ChipSuggestion {
14
+ label: string;
15
+ description?: string;
16
+ value: string;
17
+ category?: string;
18
+ icon?: string;
19
+ /** Extra data passed through to chip creation */
20
+ data?: Record<string, any>;
21
+ /** Number of chars before cursor to replace (alternative to triggerChar lookup) */
22
+ replaceLength?: number;
23
+ }
24
+
25
+ export interface SuggestionGroup {
26
+ label: string;
27
+ items: ChipSuggestion[];
28
+ }
29
+
30
+ export interface ChipInfo {
31
+ /** CSS class for the chip span */
32
+ className: string;
33
+ /** Display text inside the chip */
34
+ displayText: string;
35
+ /** Data attributes to set on the chip element */
36
+ dataAttrs: Record<string, string>;
37
+ /** Optional HTML content (overrides displayText) */
38
+ html?: string;
39
+ /** If true, insert as plain text instead of a chip element */
40
+ insertAsText?: boolean;
41
+ }
42
+
43
+ // --- Props ---
44
+ let {
45
+ value = $bindable(''),
46
+ placeholder = '',
47
+ disabled = false,
48
+ compact = false,
49
+ rows = 3,
50
+ monospace = false,
51
+ triggerChar = '',
52
+ onTrigger,
53
+ onChipCreate,
54
+ onSerialize,
55
+ onchange,
56
+ onfocus,
57
+ onblur,
58
+ onkeydown: externalKeydown,
59
+ }: {
60
+ value: string;
61
+ placeholder?: string;
62
+ disabled?: boolean;
63
+ compact?: boolean;
64
+ rows?: number;
65
+ monospace?: boolean;
66
+ /** Character that triggers autocomplete (e.g., '@', '{') */
67
+ triggerChar: string;
68
+ /** Called when trigger char is typed. Return suggestions for the dropdown. */
69
+ onTrigger?: (query: string, beforeCursor: string) => ChipSuggestion[] | SuggestionGroup[] | null;
70
+ /** Called when a suggestion is selected. Return chip info for DOM insertion. */
71
+ onChipCreate?: (suggestion: ChipSuggestion) => ChipInfo;
72
+ /** Called to serialize a chip element back to text. Return the text representation. */
73
+ onSerialize?: (chipEl: HTMLElement) => string;
74
+ onchange?: (value: string) => void;
75
+ onfocus?: (e: FocusEvent) => void;
76
+ onblur?: (e: FocusEvent) => void;
77
+ onkeydown?: (e: KeyboardEvent) => void;
78
+ } = $props();
79
+
80
+ // --- State ---
81
+ let editableRef = $state<HTMLDivElement | null>(null);
82
+ let autocompleteRef = $state<HTMLDivElement | null>(null);
83
+ let showAutocomplete = $state(false);
84
+ let flatSuggestions = $state<ChipSuggestion[]>([]);
85
+ let groupedSuggestions = $state<SuggestionGroup[]>([]);
86
+ let selectedIndex = $state(0);
87
+ let isGrouped = $state(false);
88
+
89
+ // Track last synced value to avoid infinite loops
90
+ let lastSyncedValue = '';
91
+
92
+ // Computed min-height from rows
93
+ let minHeight = $derived(compact ? '28px' : `${Math.max(rows * 24, 40)}px`);
94
+
95
+ // Total item count across flat or grouped suggestions
96
+ let totalItems = $derived.by(() => {
97
+ if (isGrouped) {
98
+ return groupedSuggestions.reduce((sum, g) => sum + g.items.length, 0);
99
+ }
100
+ return flatSuggestions.length;
101
+ });
102
+
103
+ // Selected suggestion detail
104
+ let selectedSuggestion = $derived.by(() => {
105
+ if (totalItems === 0) return null;
106
+ if (isGrouped) {
107
+ let idx = selectedIndex;
108
+ for (const group of groupedSuggestions) {
109
+ if (idx < group.items.length) return group.items[idx];
110
+ idx -= group.items.length;
111
+ }
112
+ return null;
113
+ }
114
+ return flatSuggestions[selectedIndex] ?? null;
115
+ });
116
+
117
+ // --- Sync contenteditable when value changes externally ---
118
+ $effect(() => {
119
+ if (editableRef && value !== lastSyncedValue) {
120
+ const currentDomText = serializeContent(editableRef);
121
+ if (value !== currentDomText) {
122
+ if (value === '') {
123
+ editableRef.innerHTML = '';
124
+ } else {
125
+ editableRef.textContent = value;
126
+ }
127
+ lastSyncedValue = value;
128
+ }
129
+ }
130
+ });
131
+
132
+ // --- Serialization ---
133
+ function serializeContent(el: HTMLElement): string {
134
+ let result = '';
135
+ for (const node of Array.from(el.childNodes)) {
136
+ if (node.nodeType === Node.TEXT_NODE) {
137
+ result += node.textContent || '';
138
+ } else if (node instanceof HTMLElement) {
139
+ if (node.dataset.chipValue !== undefined && onSerialize) {
140
+ result += onSerialize(node);
141
+ } else if (node.tagName === 'BR') {
142
+ result += '\n';
143
+ } else if (node.tagName === 'DIV' || node.tagName === 'P') {
144
+ if (result.length > 0 && !result.endsWith('\n')) result += '\n';
145
+ result += serializeContent(node);
146
+ } else {
147
+ result += serializeContent(node);
148
+ }
149
+ }
150
+ }
151
+ return result;
152
+ }
153
+
154
+ function syncValue() {
155
+ if (!editableRef) return;
156
+ value = serializeContent(editableRef);
157
+ lastSyncedValue = value;
158
+ onchange?.(value);
159
+ }
160
+
161
+ // --- Cursor helpers ---
162
+ function getTextBeforeCursor(): string {
163
+ const sel = window.getSelection();
164
+ if (!sel || sel.rangeCount === 0 || !editableRef) return '';
165
+ try {
166
+ const range = sel.getRangeAt(0);
167
+ const preRange = document.createRange();
168
+ preRange.selectNodeContents(editableRef);
169
+ preRange.setEnd(range.startContainer, range.startOffset);
170
+ return preRange.toString();
171
+ } catch {
172
+ return '';
173
+ }
174
+ }
175
+
176
+ // --- Input Handling ---
177
+ function handleInput() {
178
+ syncValue();
179
+ if (!value.trim() && editableRef) {
180
+ editableRef.innerHTML = '';
181
+ }
182
+
183
+ if (!onTrigger) {
184
+ showAutocomplete = false;
185
+ return;
186
+ }
187
+
188
+ const beforeCursor = getTextBeforeCursor();
189
+ const triggerResult = onTrigger(extractQuery(beforeCursor), beforeCursor);
190
+
191
+ if (triggerResult && Array.isArray(triggerResult) && triggerResult.length > 0) {
192
+ showAutocomplete = true;
193
+ selectedIndex = 0;
194
+
195
+ // Detect if grouped
196
+ if ('items' in triggerResult[0]) {
197
+ isGrouped = true;
198
+ groupedSuggestions = triggerResult as SuggestionGroup[];
199
+ flatSuggestions = [];
200
+ } else {
201
+ isGrouped = false;
202
+ flatSuggestions = triggerResult as ChipSuggestion[];
203
+ groupedSuggestions = [];
204
+ }
205
+ } else {
206
+ showAutocomplete = false;
207
+ flatSuggestions = [];
208
+ groupedSuggestions = [];
209
+ }
210
+ }
211
+
212
+ function extractQuery(beforeCursor: string): string {
213
+ if (!triggerChar) return '';
214
+ const lastTrigger = beforeCursor.lastIndexOf(triggerChar);
215
+ if (lastTrigger < 0) return '';
216
+ return beforeCursor.slice(lastTrigger + triggerChar.length);
217
+ }
218
+
219
+ function handleKeydown(e: KeyboardEvent) {
220
+ if (showAutocomplete && totalItems > 0) {
221
+ if (e.key === 'ArrowDown') {
222
+ e.preventDefault();
223
+ selectedIndex = (selectedIndex + 1) % totalItems;
224
+ return;
225
+ }
226
+ if (e.key === 'ArrowUp') {
227
+ e.preventDefault();
228
+ selectedIndex = (selectedIndex - 1 + totalItems) % totalItems;
229
+ return;
230
+ }
231
+ if (e.key === 'Tab' || e.key === 'Enter') {
232
+ e.preventDefault();
233
+ if (selectedSuggestion) {
234
+ selectSuggestion(selectedSuggestion);
235
+ }
236
+ return;
237
+ }
238
+ if (e.key === 'Escape') {
239
+ e.preventDefault();
240
+ showAutocomplete = false;
241
+ return;
242
+ }
243
+ }
244
+ externalKeydown?.(e);
245
+ }
246
+
247
+ // --- Suggestion Selection ---
248
+ function selectSuggestion(suggestion: ChipSuggestion) {
249
+ if (!editableRef || !onChipCreate) return;
250
+
251
+ const chipInfo = onChipCreate(suggestion);
252
+ const sel = window.getSelection();
253
+ if (!sel || sel.rangeCount === 0) return;
254
+
255
+ const range = sel.getRangeAt(0);
256
+ let textNode: Node = range.startContainer;
257
+ let cursorPos = range.startOffset;
258
+
259
+ // Navigate to the text node
260
+ if (textNode.nodeType !== Node.TEXT_NODE) {
261
+ const children = Array.from(textNode.childNodes);
262
+ const prev = children[cursorPos - 1];
263
+ if (prev && prev.nodeType === Node.TEXT_NODE) {
264
+ textNode = prev;
265
+ cursorPos = (prev.textContent || '').length;
266
+ } else if (prev) {
267
+ let last: Node | null = prev;
268
+ while (last && last.nodeType !== Node.TEXT_NODE) {
269
+ last = last.lastChild;
270
+ }
271
+ if (last) {
272
+ textNode = last;
273
+ cursorPos = (last.textContent || '').length;
274
+ } else return;
275
+ } else return;
276
+ }
277
+
278
+ const text = textNode.textContent || '';
279
+ const beforeCursor = text.slice(0, cursorPos);
280
+
281
+ // Find the replacement start position
282
+ let replaceStart: number;
283
+ if (suggestion.replaceLength !== undefined) {
284
+ replaceStart = cursorPos - suggestion.replaceLength;
285
+ } else if (triggerChar) {
286
+ replaceStart = beforeCursor.lastIndexOf(triggerChar);
287
+ if (replaceStart < 0) return;
288
+ } else {
289
+ return;
290
+ }
291
+
292
+ const beforeReplace = text.slice(0, replaceStart);
293
+ const afterText = text.slice(cursorPos);
294
+ const parent = textNode.parentNode!;
295
+
296
+ // Insert text before replacement point
297
+ if (beforeReplace) {
298
+ parent.insertBefore(document.createTextNode(beforeReplace), textNode);
299
+ }
300
+
301
+ if (chipInfo.insertAsText) {
302
+ const insertedText = chipInfo.displayText;
303
+ const afterNode = document.createTextNode(insertedText + afterText);
304
+ parent.insertBefore(afterNode, textNode);
305
+ parent.removeChild(textNode);
306
+
307
+ const newRange = document.createRange();
308
+ newRange.setStart(afterNode, insertedText.length);
309
+ newRange.collapse(true);
310
+ sel.removeAllRanges();
311
+ sel.addRange(newRange);
312
+ } else {
313
+ // Create chip element
314
+ const chip = document.createElement('span');
315
+ chip.contentEditable = 'false';
316
+ chip.className = chipInfo.className;
317
+ chip.dataset.chipValue = suggestion.value;
318
+ for (const [key, val] of Object.entries(chipInfo.dataAttrs)) {
319
+ chip.dataset[key] = val;
320
+ }
321
+ if (chipInfo.html) {
322
+ chip.innerHTML = chipInfo.html;
323
+ } else {
324
+ chip.textContent = chipInfo.displayText;
325
+ }
326
+ parent.insertBefore(chip, textNode);
327
+
328
+ const afterNode = document.createTextNode('\u00A0' + afterText);
329
+ parent.insertBefore(afterNode, textNode);
330
+ parent.removeChild(textNode);
331
+
332
+ const newRange = document.createRange();
333
+ newRange.setStart(afterNode, 1);
334
+ newRange.collapse(true);
335
+ sel.removeAllRanges();
336
+ sel.addRange(newRange);
337
+ }
338
+
339
+ syncValue();
340
+ showAutocomplete = false;
341
+ flatSuggestions = [];
342
+ groupedSuggestions = [];
343
+ }
344
+
345
+ function handleSuggestionClick(suggestion: ChipSuggestion, e: MouseEvent) {
346
+ e.preventDefault();
347
+ selectSuggestion(suggestion);
348
+ }
349
+
350
+ // --- Paste ---
351
+ function handlePaste(e: ClipboardEvent) {
352
+ e.preventDefault();
353
+ const text = e.clipboardData?.getData('text/plain') || '';
354
+ const sel = window.getSelection();
355
+ if (!sel || sel.rangeCount === 0) return;
356
+ const range = sel.getRangeAt(0);
357
+ range.deleteContents();
358
+ const textNode = document.createTextNode(text);
359
+ range.insertNode(textNode);
360
+ range.setStartAfter(textNode);
361
+ range.collapse(true);
362
+ sel.removeAllRanges();
363
+ sel.addRange(range);
364
+ syncValue();
365
+ }
366
+
367
+ function handleBlur(e: FocusEvent) {
368
+ setTimeout(() => { showAutocomplete = false; }, 200);
369
+ onblur?.(e);
370
+ }
371
+
372
+ // --- Public API ---
373
+ export function focus() {
374
+ editableRef?.focus();
375
+ }
376
+
377
+ export function clear() {
378
+ if (editableRef) editableRef.innerHTML = '';
379
+ value = '';
380
+ lastSyncedValue = '';
381
+ }
382
+
383
+ export function setText(text: string) {
384
+ if (editableRef) editableRef.textContent = text;
385
+ value = text;
386
+ lastSyncedValue = text;
387
+ }
388
+
389
+ export function getElement(): HTMLDivElement | null {
390
+ return editableRef;
391
+ }
392
+ </script>
393
+
394
+ <div class="chip-input-wrapper relative">
395
+ <div
396
+ bind:this={editableRef}
397
+ contenteditable={disabled ? 'false' : 'true'}
398
+ role="textbox"
399
+ aria-multiline="true"
400
+ class="chip-input-editable w-full rounded-md text-sm"
401
+ class:chip-input-monospace={monospace}
402
+ class:chip-input-compact={compact}
403
+ style="
404
+ min-height: {minHeight};
405
+ max-height: {compact ? '120px' : '240px'};
406
+ {disabled ? 'opacity: 0.5; cursor: not-allowed;' : ''}
407
+ "
408
+ oninput={handleInput}
409
+ onkeydown={handleKeydown}
410
+ onpaste={handlePaste}
411
+ onfocus={onfocus}
412
+ onblur={handleBlur}
413
+ ></div>
414
+
415
+ <!-- Placeholder overlay -->
416
+ {#if !value.trim()}
417
+ <div class="chip-input-placeholder absolute top-0 left-0 text-sm pointer-events-none"
418
+ class:chip-input-placeholder-compact={compact}
419
+ class:chip-input-placeholder-mono={monospace}
420
+ >
421
+ {placeholder}
422
+ </div>
423
+ {/if}
424
+
425
+ <!-- Autocomplete dropdown -->
426
+ {#if showAutocomplete && totalItems > 0}
427
+ <div
428
+ bind:this={autocompleteRef}
429
+ class="chip-input-dropdown absolute z-50 w-full mt-1 rounded-lg overflow-hidden shadow-xl"
430
+ >
431
+ {#if isGrouped}
432
+ {@const flatIdx = { current: 0 }}
433
+ {#each groupedSuggestions as group}
434
+ {#if group.items.length > 0}
435
+ <div class="chip-input-dropdown-header">
436
+ {group.label}
437
+ </div>
438
+ {#each group.items as item}
439
+ {@const idx = flatIdx.current++}
440
+ <button
441
+ class="chip-input-dropdown-item"
442
+ class:chip-input-dropdown-item-selected={idx === selectedIndex}
443
+ onmouseenter={() => selectedIndex = idx}
444
+ onmousedown={(e) => handleSuggestionClick(item, e)}
445
+ >
446
+ {#if item.icon}
447
+ <span class="chip-input-dropdown-icon">{item.icon}</span>
448
+ {/if}
449
+ <span class="chip-input-dropdown-label">{item.label}</span>
450
+ {#if item.description}
451
+ <span class="chip-input-dropdown-desc">{item.description}</span>
452
+ {/if}
453
+ {#if item.category}
454
+ <span class="chip-input-dropdown-category">{item.category}</span>
455
+ {/if}
456
+ </button>
457
+ {/each}
458
+ {/if}
459
+ {/each}
460
+ {:else}
461
+ {#each flatSuggestions as item, i}
462
+ <button
463
+ class="chip-input-dropdown-item"
464
+ class:chip-input-dropdown-item-selected={i === selectedIndex}
465
+ onmouseenter={() => selectedIndex = i}
466
+ onmousedown={(e) => handleSuggestionClick(item, e)}
467
+ >
468
+ {#if item.icon}
469
+ <span class="chip-input-dropdown-icon">{item.icon}</span>
470
+ {/if}
471
+ <span class="chip-input-dropdown-label">{item.label}</span>
472
+ {#if item.description}
473
+ <span class="chip-input-dropdown-desc">{item.description}</span>
474
+ {/if}
475
+ {#if item.category}
476
+ <span class="chip-input-dropdown-category">{item.category}</span>
477
+ {/if}
478
+ </button>
479
+ {/each}
480
+ {/if}
481
+
482
+ <div class="chip-input-dropdown-footer">
483
+ <span><kbd>↑↓</kbd> Navigate</span>
484
+ <span><kbd>Tab</kbd> Select</span>
485
+ <span><kbd>Esc</kbd> Close</span>
486
+ </div>
487
+ </div>
488
+ {/if}
489
+ </div>
490
+
491
+ <style>
492
+ .chip-input-editable {
493
+ padding: 0.5rem 0.75rem;
494
+ background: oklch(0.14 0.01 250);
495
+ border: 1px solid oklch(0.30 0.02 250);
496
+ color: oklch(0.90 0.01 250);
497
+ overflow-y: auto;
498
+ white-space: pre-wrap;
499
+ word-break: break-word;
500
+ outline: none;
501
+ resize: vertical;
502
+ line-height: 1.6;
503
+ }
504
+ .chip-input-editable:focus {
505
+ border-color: oklch(0.45 0.10 200);
506
+ box-shadow: 0 0 0 1px oklch(0.45 0.10 200 / 0.3);
507
+ }
508
+ .chip-input-compact {
509
+ padding: 0.25rem 0.375rem;
510
+ line-height: 1.4;
511
+ resize: none;
512
+ }
513
+ .chip-input-monospace {
514
+ font-family: 'JetBrains Mono', 'Fira Code', monospace;
515
+ font-size: 0.6875rem;
516
+ }
517
+ .chip-input-placeholder {
518
+ padding: 0.5rem 0.75rem;
519
+ color: oklch(0.40 0.01 250);
520
+ }
521
+ .chip-input-placeholder-compact {
522
+ padding: 0.25rem 0.375rem;
523
+ }
524
+ .chip-input-placeholder-mono {
525
+ font-family: 'JetBrains Mono', 'Fira Code', monospace;
526
+ font-size: 0.6875rem;
527
+ }
528
+
529
+ /* Dropdown */
530
+ .chip-input-dropdown {
531
+ background: oklch(0.18 0.01 250);
532
+ border: 1px solid oklch(0.30 0.03 250);
533
+ max-height: 280px;
534
+ overflow-y: auto;
535
+ }
536
+ .chip-input-dropdown-header {
537
+ padding: 0.25rem 0.5rem;
538
+ font-size: 0.625rem;
539
+ color: oklch(0.50 0.01 250);
540
+ border-bottom: 1px solid oklch(0.25 0.02 250);
541
+ }
542
+ .chip-input-dropdown-item {
543
+ width: 100%;
544
+ text-align: left;
545
+ padding: 0.25rem 0.5rem;
546
+ display: flex;
547
+ align-items: center;
548
+ gap: 0.375rem;
549
+ transition: background 0.1s;
550
+ font-size: 0.6875rem;
551
+ color: oklch(0.85 0.01 250);
552
+ background: transparent;
553
+ border: none;
554
+ cursor: pointer;
555
+ }
556
+ .chip-input-dropdown-item:hover,
557
+ .chip-input-dropdown-item-selected {
558
+ background: oklch(0.25 0.04 200 / 0.3);
559
+ }
560
+ .chip-input-dropdown-icon {
561
+ flex-shrink: 0;
562
+ font-size: 0.75rem;
563
+ }
564
+ .chip-input-dropdown-label {
565
+ white-space: nowrap;
566
+ overflow: hidden;
567
+ text-overflow: ellipsis;
568
+ }
569
+ .chip-input-dropdown-desc {
570
+ margin-left: auto;
571
+ font-size: 0.625rem;
572
+ color: oklch(0.50 0.01 250);
573
+ white-space: nowrap;
574
+ overflow: hidden;
575
+ text-overflow: ellipsis;
576
+ }
577
+ .chip-input-dropdown-category {
578
+ flex-shrink: 0;
579
+ font-size: 0.5625rem;
580
+ color: oklch(0.50 0.02 250);
581
+ }
582
+ .chip-input-dropdown-footer {
583
+ padding: 0.25rem 0.5rem;
584
+ font-size: 0.625rem;
585
+ color: oklch(0.40 0.01 250);
586
+ border-top: 1px solid oklch(0.25 0.02 250);
587
+ display: flex;
588
+ gap: 0.75rem;
589
+ }
590
+ .chip-input-dropdown-footer kbd {
591
+ background: oklch(0.25 0.02 250);
592
+ padding: 1px 4px;
593
+ border-radius: 2px;
594
+ font-size: 10px;
595
+ }
596
+ </style>