@r2digisolutions/components 0.21.17 → 0.21.18

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
- const maxWidth = Math.min(320, viewW - margin * 2);
225
- let measured = rect.width;
226
- if (listboxEl?.matches(':popover-open')) {
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:${Math.min(rect.width, maxWidth)}px`,
246
- `max-width:${maxWidth}px`,
240
+ `min-width:${width}px`,
241
+ `max-width:${width}px`,
247
242
  `max-height:${ceiling}px`
248
243
  ].join('; ');
249
244
 
@@ -667,7 +662,7 @@
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-surface-overlay text-primary shadow-sm'
665
+ ? 'bg-brand-500 text-white shadow-sm'
671
666
  : isSelected && !option.disabled
672
667
  ? 'bg-brand-500/10 font-medium text-primary'
673
668
  : 'text-primary hover:bg-surface-overlay'
@@ -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
- ? 'border-brand-500 bg-brand-500'
682
- : 'border-border-strong bg-transparent'
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="h-2.5 w-2.5 text-white"
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 class="mt-0.5 block text-[11px] break-words text-secondary">
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="h-4 w-4 shrink-0 text-secondary"
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"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@r2digisolutions/components",
3
- "version": "0.21.17",
3
+ "version": "0.21.18",
4
4
  "private": false,
5
5
  "description": "R2DigiSolutions Svelte 5 component library — Atomic Design, Tailwind 4, Light/Dark mode",
6
6
  "license": "MIT",