@r2digisolutions/components 0.21.17 → 0.21.19
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.
|
@@ -221,14 +221,9 @@
|
|
|
221
221
|
const available = Math.max(120, openUp ? spaceAbove : spaceBelow);
|
|
222
222
|
const ceiling = Math.min(maxHeight, available);
|
|
223
223
|
listHeightCeiling = ceiling;
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const raw = listboxEl.getBoundingClientRect().width;
|
|
228
|
-
// UA [popover] { inset: 0 } can report nearly the viewport until CSS/layout settles.
|
|
229
|
-
if (raw > 0 && raw < viewW * 0.5) measured = raw;
|
|
230
|
-
}
|
|
231
|
-
const width = Math.min(maxWidth, Math.max(rect.width, measured));
|
|
224
|
+
|
|
225
|
+
// Match the trigger: never narrower, never capped at an arbitrary px (was 320).
|
|
226
|
+
const width = Math.min(Math.max(rect.width, 0), viewW - margin * 2);
|
|
232
227
|
|
|
233
228
|
let left = rect.left;
|
|
234
229
|
if (left + width > viewLeft + viewW - margin) {
|
|
@@ -242,8 +237,8 @@
|
|
|
242
237
|
`left:${left}px`,
|
|
243
238
|
'right:auto',
|
|
244
239
|
`width:${width}px`,
|
|
245
|
-
`min-width:${
|
|
246
|
-
`max-width:${
|
|
240
|
+
`min-width:${width}px`,
|
|
241
|
+
`max-width:${width}px`,
|
|
247
242
|
`max-height:${ceiling}px`
|
|
248
243
|
].join('; ');
|
|
249
244
|
|
|
@@ -667,9 +662,9 @@
|
|
|
667
662
|
'transition-[background-color,color,box-shadow] duration-75',
|
|
668
663
|
option.disabled ? 'cursor-not-allowed opacity-40' : 'cursor-pointer',
|
|
669
664
|
isHighlighted && !option.disabled
|
|
670
|
-
? 'bg-
|
|
665
|
+
? 'bg-brand-500 text-white shadow-sm'
|
|
671
666
|
: isSelected && !option.disabled
|
|
672
|
-
? '
|
|
667
|
+
? 'font-medium text-primary'
|
|
673
668
|
: 'text-primary hover:bg-surface-overlay'
|
|
674
669
|
]}
|
|
675
670
|
>
|
|
@@ -678,14 +673,21 @@
|
|
|
678
673
|
class={[
|
|
679
674
|
'h-4 w-4 flex shrink-0 items-center justify-center rounded-full border transition-colors duration-75',
|
|
680
675
|
isSelected && !option.disabled
|
|
681
|
-
?
|
|
682
|
-
|
|
676
|
+
? isHighlighted
|
|
677
|
+
? 'border-white bg-white'
|
|
678
|
+
: 'border-brand-500 bg-brand-500'
|
|
679
|
+
: isHighlighted && !option.disabled
|
|
680
|
+
? 'border-white/80 bg-transparent'
|
|
681
|
+
: 'border-border-strong bg-transparent'
|
|
683
682
|
]}
|
|
684
683
|
aria-hidden="true"
|
|
685
684
|
>
|
|
686
685
|
{#if isSelected}
|
|
687
686
|
<svg
|
|
688
|
-
class=
|
|
687
|
+
class={[
|
|
688
|
+
'h-2.5 w-2.5',
|
|
689
|
+
isHighlighted && !option.disabled ? 'text-brand-500' : 'text-white'
|
|
690
|
+
]}
|
|
689
691
|
viewBox="0 0 24 24"
|
|
690
692
|
fill="none"
|
|
691
693
|
stroke="currentColor"
|
|
@@ -700,7 +702,12 @@
|
|
|
700
702
|
<span class="min-w-0 flex-1">
|
|
701
703
|
<span class="block break-words">{option.label}</span>
|
|
702
704
|
{#if secondary}
|
|
703
|
-
<span
|
|
705
|
+
<span
|
|
706
|
+
class={[
|
|
707
|
+
'mt-0.5 block text-[11px] break-words',
|
|
708
|
+
isHighlighted && !option.disabled ? 'text-white/80' : 'text-secondary'
|
|
709
|
+
]}
|
|
710
|
+
>
|
|
704
711
|
{secondary}
|
|
705
712
|
</span>
|
|
706
713
|
{/if}
|
|
@@ -708,7 +715,10 @@
|
|
|
708
715
|
|
|
709
716
|
{#if hasChildren}
|
|
710
717
|
<svg
|
|
711
|
-
class=
|
|
718
|
+
class={[
|
|
719
|
+
'h-4 w-4 shrink-0',
|
|
720
|
+
isHighlighted && !option.disabled ? 'text-white/80' : 'text-secondary'
|
|
721
|
+
]}
|
|
712
722
|
viewBox="0 0 24 24"
|
|
713
723
|
fill="none"
|
|
714
724
|
stroke="currentColor"
|