@kennycorrea/ui 0.11.1 → 0.11.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.11.2 — 2026-10-19
4
+
5
+ - **`ChipGroup`** — centring the selected chip no longer calls `scrollIntoView`, whose `block: 'nearest'` scrolled the whole page to a strip below the fold (about 1000 px on a long page). The strip's own scroller is moved with `scrollTo({ left })`, and nothing else; `prefers-reduced-motion` gets an instant scroll.
6
+ - **`SegmentedControl`** — unselected labels are `--gray-12` instead of `--gray-11`: 4.23:1 on the track in light mode was under WCAG AA. The thumb still tells selected from unselected.
7
+
3
8
  ## 0.11.1 — 2026-10-19
4
9
 
5
10
  - **`ScrollStrip`** (axe `scrollable-region-focusable`) — now `role="region"` with an accessible name (`aria-label`, default `UiStrings.scrollableRegion` "Scrollable content"). It is a tab stop (`tabIndex=0`) only while its content overflows (ResizeObserver), with a `:focus-visible` ring; ArrowLeft/Right scroll about one item, Home/End jump. Layout, snap and `-mx-4` usage unchanged.
@@ -22,8 +22,16 @@ export function ChipGroup(props) {
22
22
  };
23
23
  // biome-ignore lint/correctness/useExhaustiveDependencies: re-run when the selection changes
24
24
  useEffect(() => {
25
- const chip = scroller.current?.querySelector('[data-selected="true"]');
26
- chip?.scrollIntoView?.({ inline: 'center', block: 'nearest', behavior: 'smooth' });
25
+ const el = scroller.current;
26
+ const chip = el?.querySelector('[data-selected="true"]');
27
+ // Scroll the strip itself, never the window or another ancestor (scrollIntoView does both).
28
+ if (el && chip) {
29
+ const reduce = window.matchMedia?.('(prefers-reduced-motion: reduce)').matches;
30
+ el.scrollTo?.({
31
+ left: chip.offsetLeft - (el.clientWidth - chip.offsetWidth) / 2,
32
+ behavior: reduce ? 'auto' : 'smooth',
33
+ });
34
+ }
27
35
  measure();
28
36
  }, [key]);
29
37
  // biome-ignore lint/correctness/useExhaustiveDependencies: measure only touches refs and a bailing setState
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kennycorrea/ui",
3
- "version": "0.11.1",
3
+ "version": "0.11.2",
4
4
  "description": "A React + TypeScript component library built on Radix Themes: atoms, a Tailwind token bridge and theming.",
5
5
  "private": false,
6
6
  "type": "module",
package/tokens.css CHANGED
@@ -836,7 +836,7 @@
836
836
  box-shadow: 0 1px 3px var(--black-a4), 0 0 0 0.5px var(--black-a3);
837
837
  transform: translateX(calc(var(--seg-index) * 100%)); transition: transform 220ms cubic-bezier(0.3, 0.7, 0.2, 1); }
838
838
  .ui-segmented__item { position: relative; z-index: 1; min-width: 24px; border: 0; background: none; font: inherit; font-weight: 500;
839
- color: var(--gray-11); border-radius: 999px; cursor: pointer; white-space: nowrap;
839
+ color: var(--gray-12); border-radius: 999px; cursor: pointer; white-space: nowrap;
840
840
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: color 150ms; }
841
841
  .ui-segmented__label { display: block; overflow: hidden; text-overflow: ellipsis; }
842
842
  .ui-segmented[data-size="md"] .ui-segmented__item { min-height: 32px; padding: 0 16px; font-size: 14px; }