@cosxai/ui 0.23.0 → 0.23.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosxai/ui",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "description": "COSX design system \u2014 React 19 component primitives shared across product-meta and other consumers",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",
@@ -696,14 +696,36 @@ export const Select = forwardRef<HTMLButtonElement, SelectProps>(function Select
696
696
  opacity: disabled ? 0.55 : 1,
697
697
  }}
698
698
  >
699
- <span
700
- style={{
701
- overflow: "hidden",
702
- textOverflow: "ellipsis",
703
- whiteSpace: "nowrap",
704
- }}
705
- >
706
- {triggerLabel}
699
+ <span style={{ display: "inline-grid", overflow: "hidden" }}>
700
+ {/* fit="auto" width stabiliser: every option label renders
701
+ invisibly in the same grid cell, so the trigger takes
702
+ the WIDEST option's width up front. Without it the
703
+ trigger resized to each selection and the popover
704
+ (which matches trigger width) truncated longer options
705
+ to "E-sig…". Skipped for fit="full" (width is the
706
+ container's) and for searchable lists (potentially
707
+ hundreds of rows — and those popovers are wide anyway). */}
708
+ {fit === "auto" &&
709
+ !searchable &&
710
+ options.map((o) => (
711
+ <span
712
+ key={o.value}
713
+ aria-hidden
714
+ style={{ gridArea: "1 / 1", visibility: "hidden", whiteSpace: "nowrap" }}
715
+ >
716
+ {o.label}
717
+ </span>
718
+ ))}
719
+ <span
720
+ style={{
721
+ gridArea: "1 / 1",
722
+ overflow: "hidden",
723
+ textOverflow: "ellipsis",
724
+ whiteSpace: "nowrap",
725
+ }}
726
+ >
727
+ {triggerLabel}
728
+ </span>
707
729
  </span>
708
730
  <svg
709
731
  width="10"